Revert incorrect RCL_3 drop: RCL_3
authorPat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:30:35 +0100
branchRCL_3
changeset 22 fad26422216a
parent 21 b3cee849fa46
child 23 f8280f3bfeb7
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035
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_notepadwrapper.h
creator/engine/inc/creator_phonebook.h
creator/engine/inc/creator_phonebookapi.h
creator/engine/inc/creator_phonebookbase.h
creator/engine/inc/creator_phonebookwrapper.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_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_notepadwrapper.cpp
creator/engine/src/creator_phonebook.cpp
creator/engine/src/creator_phonebookapi.cpp
creator/engine/src/creator_phonebookbase.cpp
creator/engine/src/creator_phonebookwrapper.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_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
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/fbdrivelistviewitem.h
filebrowser/ui/inc/fbdrivemodel.h
filebrowser/ui/inc/fbdriveview.h
filebrowser/ui/inc/fbfilelistviewitem.h
filebrowser/ui/inc/fbfilemodel.h
filebrowser/ui/inc/fbfileview.h
filebrowser/ui/inc/fbmainwindow.h
filebrowser/ui/inc/filebrowsersettings.h
filebrowser/ui/inc/filebrowsersortfilterproxymodel.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/fbdrivelistviewitem.cpp
filebrowser/ui/src/fbdrivemodel.cpp
filebrowser/ui/src/fbdriveview.cpp
filebrowser/ui/src/fbfilelistviewitem.cpp
filebrowser/ui/src/fbfilemodel.cpp
filebrowser/ui/src/fbfileview.cpp
filebrowser/ui/src/fbmainwindow.cpp
filebrowser/ui/src/filebrowsersortfilterproxymodel.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
launcher/ReleaseNotes_Launcher.txt
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/rom/loadgen.iby
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/data/memspyui.rss
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/memspyheapdumpsview.h
memspyui/ui/hb/inc/memspykernelobjectdetailview.h
memspyui/ui/hb/inc/memspykernelobjecttypeview.h
memspyui/ui/hb/inc/memspykernelobjectview.h
memspyui/ui/hb/inc/memspylistview.h
memspyui/ui/hb/inc/memspymainview.h
memspyui/ui/hb/inc/memspyprocessview.h
memspyui/ui/hb/inc/memspysettingsview.h
memspyui/ui/hb/inc/memspyswmtview.h
memspyui/ui/hb/inc/memspythreaddetailindexview.h
memspyui/ui/hb/inc/memspythreaddetailview.h
memspyui/ui/hb/inc/memspythreadview.h
memspyui/ui/hb/inc/memspytrackingview.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/memspyheapdumpsview.cpp
memspyui/ui/hb/src/memspykernelobjectdetailview.cpp
memspyui/ui/hb/src/memspykernelobjecttypeview.cpp
memspyui/ui/hb/src/memspykernelobjectview.cpp
memspyui/ui/hb/src/memspylistview.cpp
memspyui/ui/hb/src/memspymainview.cpp
memspyui/ui/hb/src/memspyprocessview.cpp
memspyui/ui/hb/src/memspysettingsview.cpp
memspyui/ui/hb/src/memspyswmtview.cpp
memspyui/ui/hb/src/memspythreaddetailindexview.cpp
memspyui/ui/hb/src/memspythreaddetailview.cpp
memspyui/ui/hb/src/memspythreadview.cpp
memspyui/ui/hb/src/memspytrackingview.cpp
memspyui/ui/hb/src/memspyview.cpp
memspyui/ui/hb/src/viewmanager.cpp
perfmon/engine/inc/perfmon.hrh
perfmon/engine/inc/perfmon_engine.h
perfmon/engine/src/perfmon_engine.cpp
perfmon/group/ReleaseNotes_PerfMon.txt
perfmon/group/bld.inf
perfmon/group/bld_generic.inf
perfmon/group/group.pro
perfmon/group/perfmon.mmp
perfmon/inc/perfmon.hrh
perfmon/inc/perfmon_app.h
perfmon/inc/perfmon_appui.h
perfmon/inc/perfmon_datapopupcontainer.h
perfmon/inc/perfmon_document.h
perfmon/inc/perfmon_drawcallback.h
perfmon/inc/perfmon_graphscontainer.h
perfmon/inc/perfmon_graphsview.h
perfmon/inc/perfmon_model.h
perfmon/inc/perfmon_settingsviewdlg.h
perfmon/inc/perfmon_std.h
perfmon/inc/perfmon_valuescontainer.h
perfmon/inc/perfmon_valuesview.h
perfmon/perfmon.pro
perfmon/rom/perfmon.iby
perfmon/rom/perfmon_datapopup.iby
perfmon/src/perfmon_app.cpp
perfmon/src/perfmon_appui.cpp
perfmon/src/perfmon_datapopupcontainer.cpp
perfmon/src/perfmon_document.cpp
perfmon/src/perfmon_graphscontainer.cpp
perfmon/src/perfmon_graphsview.cpp
perfmon/src/perfmon_model.cpp
perfmon/src/perfmon_settingsviewdlg.cpp
perfmon/src/perfmon_valuescontainer.cpp
perfmon/src/perfmon_valuesview.cpp
perfmon/ui/avkon/group/bld.inf
perfmon/ui/avkon/group/perfmon.mmp
perfmon/ui/avkon/inc/perfmon_app.h
perfmon/ui/avkon/inc/perfmon_appui.h
perfmon/ui/avkon/inc/perfmon_datapopupcontainer.h
perfmon/ui/avkon/inc/perfmon_document.h
perfmon/ui/avkon/inc/perfmon_drawcallback.h
perfmon/ui/avkon/inc/perfmon_graphscontainer.h
perfmon/ui/avkon/inc/perfmon_graphsview.h
perfmon/ui/avkon/inc/perfmon_model.h
perfmon/ui/avkon/inc/perfmon_settingsviewdlg.h
perfmon/ui/avkon/inc/perfmon_std.h
perfmon/ui/avkon/inc/perfmon_valuescontainer.h
perfmon/ui/avkon/inc/perfmon_valuesview.h
perfmon/ui/avkon/src/perfmon_app.cpp
perfmon/ui/avkon/src/perfmon_appui.cpp
perfmon/ui/avkon/src/perfmon_datapopupcontainer.cpp
perfmon/ui/avkon/src/perfmon_document.cpp
perfmon/ui/avkon/src/perfmon_graphscontainer.cpp
perfmon/ui/avkon/src/perfmon_graphsview.cpp
perfmon/ui/avkon/src/perfmon_model.cpp
perfmon/ui/avkon/src/perfmon_settingsviewdlg.cpp
perfmon/ui/avkon/src/perfmon_valuescontainer.cpp
perfmon/ui/avkon/src/perfmon_valuesview.cpp
perfmon/ui/hb/app/app.pro
perfmon/ui/hb/app/inc/application.h
perfmon/ui/hb/app/inc/datacontainer.h
perfmon/ui/hb/app/inc/datapopup.h
perfmon/ui/hb/app/inc/enginewrapper.h
perfmon/ui/hb/app/inc/graphdatacontainer.h
perfmon/ui/hb/app/inc/mainview.h
perfmon/ui/hb/app/inc/mainwindow.h
perfmon/ui/hb/app/inc/popupdatacontainer.h
perfmon/ui/hb/app/inc/settingsview.h
perfmon/ui/hb/app/inc/valuedatacontainer.h
perfmon/ui/hb/app/src/application.cpp
perfmon/ui/hb/app/src/datapopup.cpp
perfmon/ui/hb/app/src/enginewrapper.cpp
perfmon/ui/hb/app/src/graphdatacontainer.cpp
perfmon/ui/hb/app/src/main.cpp
perfmon/ui/hb/app/src/mainview.cpp
perfmon/ui/hb/app/src/mainwindow.cpp
perfmon/ui/hb/app/src/popupdatacontainer.cpp
perfmon/ui/hb/app/src/settingsview.cpp
perfmon/ui/hb/app/src/valuedatacontainer.cpp
perfmon/ui/hb/datapopup/datapopup.pro
perfmon/ui/hb/datapopup/inc/perfmondatapopupdialog_p.h
perfmon/ui/hb/datapopup/inc/perfmondatapopupplugin_p.h
perfmon/ui/hb/datapopup/inc/perfmondatapopuppluginerrors_p.h
perfmon/ui/hb/datapopup/inc/perfmondatapopupwidget_p.h
perfmon/ui/hb/datapopup/src/perfmondatapopupdialog.cpp
perfmon/ui/hb/datapopup/src/perfmondatapopupplugin.cpp
perfmon/ui/hb/datapopup/src/perfmondatapopupwidget.cpp
perfmon/ui/hb/win/enginewrapper.cpp
perfmon/ui/hb/win/enginewrapper.h
perfmon/ui/hb/win/win.pro
piprofilerui/group/bld_generic.inf
piprofilerui/ui/avkon/data/piprofilerui.rss
piprofilerui/ui/avkon/rom/piprofilerui_avkon.iby
piprofilerui/ui/hb/hb.pro
piprofilerui/ui/hb/inc/notifications.h
piprofilerui/ui/hb/inc/pimainwindow.h
piprofilerui/ui/hb/rom/piprofilerui_hb.iby
piprofilerui/ui/hb/src/pimainview.cpp
piprofilerui/ui/hb/src/pisettingsview.cpp
screengrabber/ReleaseNotes_ScreenGrabber.txt
screengrabber/data/screengrabber.rss
screengrabber/data/screengrabber_reg.rss
screengrabber/envpatcher/EnvPatcher.pl
screengrabber/envpatcher/ReadMe.txt
screengrabber/group/ReleaseNotes_ScreenGrabber.txt
screengrabber/group/backup_registration.xml
screengrabber/group/bld.inf
screengrabber/group/screengrabber.mmp
screengrabber/group/screengrabber_icons_aif.mk
screengrabber/group/screengrabber_stub_sis.mk
screengrabber/inc/SG.hrh
screengrabber/inc/SGApp.h
screengrabber/inc/SGAppUi.h
screengrabber/inc/SGDocument.h
screengrabber/inc/SGGifAnimator.h
screengrabber/inc/SGMainContainer.h
screengrabber/inc/SGMainView.h
screengrabber/inc/SGModel.h
screengrabber/inc/SGSettingListContainer.h
screengrabber/inc/SGSettingListView.h
screengrabber/inc/SGStd.h
screengrabber/inc/application.h
screengrabber/inc/enginewrapper.h
screengrabber/inc/gifanimator.h
screengrabber/inc/mainview.h
screengrabber/inc/notifications.h
screengrabber/inc/settingsview.h
screengrabber/inc/sgengine.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/SGApp.cpp
screengrabber/src/SGAppUi.cpp
screengrabber/src/SGDocument.cpp
screengrabber/src/SGGifAnimator.cpp
screengrabber/src/SGMainContainer.cpp
screengrabber/src/SGMainView.cpp
screengrabber/src/SGModel.cpp
screengrabber/src/SGSettingListContainer.cpp
screengrabber/src/SGSettingListView.cpp
screengrabber/src/application.cpp
screengrabber/src/enginewrapper.cpp
screengrabber/src/gifanimator.cpp
screengrabber/src/main.cpp
screengrabber/src/mainview.cpp
screengrabber/src/notifications.cpp
screengrabber/src/settingsview.cpp
screengrabber/src/sgengine.cpp
sysdef_1_4_0.dtd
sysdef_1_5_1.dtd
--- a/creator/creator.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,223 +0,0 @@
-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: {
-        INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-	HEADERS += engine/inc/creator.hrh \
-			engine/inc/creator_calendar.h \
-			engine/inc/creator_calendarbase.h \
-			engine/inc/creator_calendarelement.h \
-			engine/inc/creator_cmdscriptrun.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_notepadwrapper.h \
-			engine/inc/creator_phonebook.h \
-			engine/inc/creator_phonebookwrapper.h \
-			engine/inc/creator_phonebookapi.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_calendar.cpp \
-			engine/src/creator_calendarelement.cpp \
-			engine/src/creator_cmdscriptrun.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_notepadwrapper.cpp \
-			engine/src/creator_phonebook.cpp \
-			engine/src/creator_phonebookwrapper.cpp \
-			engine/src/creator_phonebookapi.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 \
-			-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 \
-			-lnoteseditor \
-			-lxqservice \
-		    -lQtContacts \
-			-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!")
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/data/creator.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,2324 @@
+/*
+* 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";
+            },
+
+        MENU_ITEM 
+            {
+            command = ECmdCreatePhoneBookEntries;
+            cascade = r_creator_phonebookentries_submenu;
+             txt = "Phonebook";
+            },
+
+        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";
+            },
+*/
+    #ifdef __PRESENCE
+        MENU_ITEM 
+            {
+            command = ECmdCreateMiscEntryIMPSServers;
+             txt = "IMPS servers";
+            },
+    #endif
+    
+        MENU_ITEM 
+            {
+            command = ECmdCreateMiscEntryNotes;
+             txt = "Notes";
+            }
+ 
+
+/*            
+            ,
+        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";
+            },
+        MENU_ITEM 
+            {
+            command = ECmdDeleteMessages;
+            cascade = r_creator_deletemessages_submenu;
+            txt = "Messages";
+            },
+        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
+            },
+        MENU_ITEM 
+            {
+            command = ECmdDeleteIMPSs;
+            cascade = r_creator_deleteimps_submenu;
+            txt = "IMPS servers";
+            },
+        MENU_ITEM 
+            {
+            command = ECmdDeleteNotes;
+            cascade = r_creator_deletenotes_submenu;
+            txt = "Notes";
+            },
+        MENU_ITEM 
+            {
+            command = ECmdDeleteLandmarks;
+            cascade = r_creator_deletelandmarks_submenu;
+            txt = "Landmarks";
+            },            
+        MENU_ITEM 
+            {
+            command = ECmdDeleteContacts;
+            cascade = r_creator_deletecontacts_submenu;
+            txt = "Contacts";
+            },
+        MENU_ITEM 
+            {
+            command = ECmdDeleteContactGroups;
+            cascade = r_creator_deletecontactgroups_submenu;
+            txt = "Contact groups";
+            }
+            
+        /*
+        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";
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/data/creator_reg.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,35 @@
+/*
+* 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";
+    }
--- a/creator/data/datacreator.rss	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,665 +0,0 @@
-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."; }
-        };
-    }
-
--- a/creator/engine/inc/creator.hrh	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-/*
-* 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__
--- a/creator/engine/inc/creator.pan	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* 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__
--- a/creator/engine/inc/creator_accesspoint.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* 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 ); // 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/engine/inc/creator_browser.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* 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 CCreatorModuleBase
-    {
-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 ); // 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/engine/inc/creator_browserelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_calendar.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
-* 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
-    {
-enum TCreatorCalendarStatus{
-    ECreatorCalendarDelete = 0,
-    ECreatorCalendarStart, 
-    ECreatorCalendarGetWeeklyEntries,
-    ECreatorCalendarGetAttendies,
-    ECreatorCalendarGetStartDate,
-    ECreatorCalendarGetEndDate, 
-    ECreatorCalendarAddDefaultAlarm
-};
-
-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 ); // from MCreatorModuleBase
-    void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData); //from MUIObserver
-    
-    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__
--- a/creator/engine/inc/creator_calendarbase.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* 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 CCreatorModuleBase{
-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/engine/inc/creator_calendarelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_cmdscriptrun.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* 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 CBase, 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 TickL();
-	
-private:
-    CCreatorEngine* iEngine;
-	HBufC* iCommandLineScriptName;
-	HBufC* iCommandLineRandomDataFileName;
-	CHeartbeat* iTimer;
-	enum TTimerMode
-		{
-		ETimerModeNone,
-		ETimerModeStartScript,
-		ETimerModeExitAppUi
-		};
-	TTimerMode iMode;
-	TInt iTickCount;
-    };
-	
-#endif // __CREATORCMDSCRIPTRUN_H__	
--- a/creator/engine/inc/creator_connectionmethod.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-/*
-* 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 ); // 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/engine/inc/creator_connectionmethodbase.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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 CCreatorModuleBase
-    {
-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/engine/inc/creator_connectionmethodelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_contactelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_contactsetcache.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* 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();
-    void AppendL(TUint32);
-    TInt NumberOfExistingContacts() const;
-    RArray<TUint32> ContactLinks();
-    const RArray<TUint32> ContactLinks() const;
-
-    TInt LinkId() const;
-
-private:
-    CCreatorContactSet(TInt aLinkId, TInt aNumOfExistingContacts);    
-    //void ConstructL();
-    TInt iLinkId;
-    TInt iNumOfExistingContacts;
-    RArray<TUint32> iContactLinks;
-};
-
-class MContactLinkCache
-{
-public:
-    virtual void AppendL(CCreatorContactSet* aContactSet) = 0;
-    virtual RArray<TUint32> ContactLinks(TInt aLinkId) = 0;
-    virtual const RArray<TUint32> ContactLinks(TInt aLinkId) const = 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_*/
--- a/creator/engine/inc/creator_factory.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_file.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* 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 CCreatorModuleBase
-    {
-enum TCreatorFilesState{
-    ECreatorFilesDelete,
-    ECreatorFilesStart,
-    ECreatorFilesGetDirectory,
-    ECreatorFilesAskDRMData,
-    ECreatorFilesAskDRM_CD_Counts,
-    ECreatorFilesAskDRM_CD_Minutes
-};
-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 ); // from MCreatorModuleBase
-    void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData); //from MUIObserver
-    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();
-    void StorePathsForDeleteL( CDesCArray& aPaths );
-    void GenerateFileNameL( TFileName& aRootName );
-    
-private:
-    CFilesParameters* iParameters;
-    CFilesParameters* iUserParameters;
-    TFileName 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/engine/inc/creator_fileelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* 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
--- a/creator/engine/inc/creator_landmark.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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 CCreatorModuleBase
-    {
-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 ); // 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/engine/inc/creator_landmarkelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_log.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-/*
-* 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 MUIObserver
-    {
-enum TCreatorLogsStatus{
-    ECreatorLogsDelete = 0,
-    ECreatorLogsStart
-};
-
-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 ); // from MCreatorModuleBase
-    void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData);    
-    
-    TInt CreateMissedCallEntryL(CLogsParameters *aParameters);    
-    TInt CreateReceivedCallEntryL(CLogsParameters *aParameters);
-    TInt CreateDialledNumberEntryL(CLogsParameters *aParameters);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-private:
-    CCreatorEngine* iEngine;
-    TInt iCommand;
-    TInt iEntriesToBeCreated;
-    TInt iDummy;
-
-    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/engine/inc/creator_logelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_mailbox.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
-* 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 CCreatorModuleBase, 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 ); // 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/engine/inc/creator_mailboxelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* 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"
-
-class CMailboxesParameters;
-
-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/engine/inc/creator_message.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
-* 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 CCreatorModuleBase, public MMsvSessionObserver
-    {
-enum TCreatorMessagesStatus{
-    ECreatorMessagesDelete = 0,
-    ECreatorMessagesStart, 
-    ECreatorMessagesMessageType,
-    ECreatorMessagesFolderType,
-    ECreatorMessagesMessageStatus, 
-    ECreatorMessagesCharsInBody,
-    ECreatorMessagesAttachment,
-};
-
-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 SetSenderToEntryDetailsL(TMsvEntry& aMsgEntry, const CMessagesParameters& aParameters, TBool aUseEmailAddress);
-    void SetRecipientToEntryDetailsL(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 ); // from MCreatorModuleBase
-    void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData); //from MUIObserver
-    
-    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__
--- a/creator/engine/inc/creator_messageelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_modulebase.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
-* 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>
-
-#include "engine.h"
-#include "creator_traces.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;
-
-_LIT(KSavingText, "Saving");
-_LIT(KDeletingText, "Deleting");
-
-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 ) = 0;
-    virtual void DeleteAllL() = 0;
-    virtual void DeleteAllCreatedByCreatorL() = 0;
-    };
-
-
-class CCreatorModuleBase : public CBase, public MCreatorModuleBase, public MUIObserver
-    {
-
-public:
-    enum TCreatorModuleStatus
-        {
-        ECreatorModuleDelete = 0, 
-        ECreatorModuleStart
-        };
-    
-    CCreatorModuleBase()
-        {
-        iEntriesToBeCreated = 1; 
-        }
-    
-    virtual TBool AskDataFromUserL(TInt aCommand)
-        {
-        iCommand = aCommand;
-        return EFalse;// will finish user interaction and engine will shutdown modules
-        }
-    
-    virtual void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
-        {
-        LOGSTRING("Creator: CCreatorModuleBase::QueryDialogClosedL");
-        
-        if( aPositiveAction == EFalse )
-            {
-            iEngine->ShutDownEnginesL();
-            return;
-            }
-        const TDesC* showText = &KSavingText;
-        TBool finished(EFalse);
-        TBool retval(ETrue);
-        switch(aUserData)
-            {
-            case ECreatorModuleDelete:
-                showText = &KDeletingText;
-                iEntriesToBeCreated = 1;
-                finished = ETrue;
-                break;
-            case ECreatorModuleStart:
-                finished = ETrue;
-                break;
-            default:
-                //some error
-                retval = EFalse;
-                break;
-            }
-        if( retval == EFalse )
-            {
-            iEngine->ShutDownEnginesL();
-            }
-        else if( finished )
-            {
-            // add this command to command array
-            iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
-            // started exucuting commands
-            iEngine->ExecuteFirstCommandL( *showText );
-            }
-        }
-
-protected:
-    // constructs the module, add "iEngine = aEngine" and other construction stuff to the body
-    virtual void ConstructL(CCreatorEngine* aEngine)
-        {
-        iEngine = aEngine;
-        };
-    
-protected:
-    CCreatorEngine* iEngine;
-    TInt iCommand;
-    TInt iEntriesToBeCreated;
-    TInt iDummy;
-    };
-
-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__
- 
--- a/creator/engine/inc/creator_note.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* 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 "creator_notepadwrapper.h"
-
-#include <e32base.h>
-
-static const TInt KNotepadFieldLength = 1024;
-
-class CCreatorEngine;
-class CNotepadParameters;
-class CCreatorNotepadWrapper;
-
-
-class CCreatorNotepad : public CCreatorModuleBase
-    {
-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 ); // from MCreatorModuleBase
-    
-    TInt CreateNoteEntryL(CNotepadParameters *aParameters);
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-
-private:
-    CCreatorNotepadWrapper* iNotepadWrapper;
-
-    CNotepadParameters* iParameters;
-    RFs& iFs;
-
-public:
-    };
-
-
-class CNotepadParameters : public CCreatorModuleBaseParameters
-    {
-public: 
-    HBufC*              iNoteText;
-
-public:
-    CNotepadParameters();
-    ~CNotepadParameters();
-    };
-
-
-
-#endif // __CREATORNOTEPAD_H__
--- a/creator/engine/inc/creator_noteelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_notepadwrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* 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 __CREATORNOTEPADWRAPPER_H__
-#define __CREATORNOTEPADWRAPPER_H__
-
-//#include "engine.h"
-//#include "creator_modulebase.h"
-
-
-#include <e32base.h>
-#include <NotesEditorInterface>
-#include <AgendaUtil>
-#include <AgendaEntry>
-
-
-class CCreatorNotepadWrapper : public CBase
-	{
-	public:
-		static CCreatorNotepadWrapper* NewL();
-		static CCreatorNotepadWrapper* NewLC();
-		~CCreatorNotepadWrapper();
-		
-	private:
-		CCreatorNotepadWrapper();
-		void ConstructL();
-		
-	public:
-		TInt CreateNoteL( const TDesC& aText );
-		void DeleteAllL();
-		
-	private:
-		AgendaUtil *iAgendaUtil;
-		NotesEditorInterface *iNotepadApi;	//QT Notes api
-	};
-
-#endif // __CREATORNOTEPADWRAPPER_H__
--- a/creator/engine/inc/creator_phonebook.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* 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 "creator_phonebookbase.h"
-#include "creator_randomdatafield.h"
-#include "creator_phonebookwrapper.h"
-
-
-
-class CCreatorEngine;
-class CCreatorModuleBaseParameters;
-
-class CContactDatabase;	
-class CPhonebookParameters;	
-class CCreatorPhonebookWrapper;
-
-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); 
-
-    
-    void DeleteAllL();
-    void DeleteAllCreatedByCreatorL();
-    void DeleteAllGroupsL();
-    void DeleteAllGroupsCreatedByCreatorL();
-    
-    void TestPrintOut(CPhonebookParameters* aParam);
-    
-private:
-    
-    void InitializeContactParamsL();
-    TBool IsContactGroupL( TUint32& aLink );
-    void StoreLinksForDeleteL( RArray<TUint32>& aLinks, TUid aStoreUid );
-    void DeleteContactsL( RArray<TUint32>& aContactsToDelete, TUid aStoreUid );
-    void DeleteItemsCreatedWithCreatorL( TUid aStoreUid );
-    void DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore );
-    TBool HasOtherThanGroupsL();
-    
-
-private:
-	CCreatorPhonebookWrapper* iPhonebookWrapper;
-    TInt iOpCounter;
-    
-    CPhonebookParameters* iParameters;
-    
-    static TInt iUrlFields[];
-    static TInt iEmailFields[];
-    
-    RArray<TUint32> iContactLinkArray;
-    RArray<TUint32>  iContactsToDelete;	
-    RArray<TUint32>  iContactGroupsToDelete;	
-    
-    RArray<TUint32> iPreviousDeleteLinks;
-    
-private:
-	//new variables
-	/// Ref: the target of the copy
-  
-    
-    /// Own: Contact database for this store
-    CContactDatabase* iContactDb;    
-    //Contacts found in contacts db.
-    
-    };
-
-/**
- * phonebook parameters
- */
-    
-
-class CPhonebookParameters : public CCreatorModuleBaseParameters
-    {
-public:
-	void ParseL(CCommandParser* parser, TParseParams /*aCase = 0*/);
-	
-	TInt CPhonebookParameters::ScriptLinkId() const;
-	void CPhonebookParameters::SetScriptLinkId(TInt aLinkId);
-
-	TCreatorContactFields iContactFields;
-
-    HBufC*  iGroupName; 	
-    TInt iContactsInGroup;
-    TInt iNumberOfPhoneNumberFields;
-    TInt iNumberOfURLFields;
-    TInt iNumberOfEmailAddressFields;
-    TInt iContactSetPtr;
-    RArray<TLinkIdParam> iLinkIds; // For contactgroup. Stores the linked contact ids.
-    
-    
-public:
-    CPhonebookParameters();
-    ~CPhonebookParameters();
-    
-private:
-    TInt iLinkId; // For contact. Stores the contact id
-    };
-
-
-class CCreatorContactField : public CBase				//, public MCreatorRandomDataField
-    {
-public:    
-    static CCreatorContactField* NewL();
-    void AddFieldToParamL( CCreatorEngine* aEngine, CPhonebookParameters* aParam, TInt aType, TInt aRand = KErrNotFound );
-    void AddFieldToParamL( CPhonebookParameters* aParam, TInt aType, TPtrC aContent );
-    ~CCreatorContactField();
-private:
-    CCreatorContactField();
-    void ConstructL();
-    };
-
-#endif // __CREATORPHONEBOOK_H__
--- a/creator/engine/inc/creator_phonebookapi.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* 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_PHONEBOOKAPI_H_
-#define CREATOR_PHONEBOOKAPI_H_
-
-#include <QString>
-#include <qglobal.h>
-#include <QTime>
-#include <qtcontacts.h>
-QTM_USE_NAMESPACE
-
-
-class CCreatorPhonebookAPI
-    {
-public:
-    CCreatorPhonebookAPI ();
-    ~CCreatorPhonebookAPI ();
-
-    quint32 saveContact( const QList<QContactDetail>& list );
-    quint32 createGroup( const QString& groupName );
-    int numberOfContacts();
-    int addContactToGroup( QContactLocalId group, QContactLocalId contact );
-    int addToGroup(QContactLocalId group, int amount);
-    bool deleteAllContacts();
-    bool deleteAllContacts( const QString& type );
-    bool deleteContacts( const QList<QContactLocalId>& list );
-    QContact contact( const QContactLocalId& contactId );
-
-private:
-    bool IsContactGroupL( const QContact& contact );
-    
-private:
-    QContactManager* mContactMngr;
-
-    };
-
-#endif /* CREATOR_PHONEBOOKAPI_H_ */
--- a/creator/engine/inc/creator_phonebookbase.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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 = 1;
-
-class CCreatorModuleBaseParameters;
-
-class CCreatorPhonebookBase : public CCreatorModuleBase
-{
-enum TCreatorPhonebookStatus{
-    ECreatorPhonebookDelete = 0,
-    ECreatorPhonebookStart,
-    ECreatorPhonebookGetContactFields,
-    ECreatorPhonebookGetPhoneNumbersCount,
-    ECreatorPhonebookGetUrlsCount,
-    ECreatorPhonebookGetEmailsCount,
-    ECreatorPhonebookContactsAllFields,
-    ECreatorPhonebookGetGroupFields,
-    ECreatorPhonebookGetContactsInGroup
-};
-
-public:
-
-    virtual TInt CreateContactEntryL(CCreatorModuleBaseParameters *aParameters) = 0;    
-    virtual TInt CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
-    virtual TInt CreateSubscribedContactEntryL(CCreatorModuleBaseParameters *aParameters) = 0;
-    virtual TBool AskDataFromUserL( TInt aCommand ); // from MCreatorModuleBase
-    virtual void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData); //from MUIObserver
-
-//    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;
-    TBool iAddAllFields;
-};
-
-
-#endif /*__CCREATORPHONEBOOKBASE_H_*/
--- a/creator/engine/inc/creator_phonebookwrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
-* 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 __CREATORPHONEBOOKWRAPPER_H__
-#define __CREATORPHONEBOOKWRAPPER_H__
-
-#include "creator_phonebookbase.h"
-#include "creator_randomdatafield.h"
-
-#include <map>
-
-#include "creator_phonebookapi.h"
-
-class CCreatorEngine;
-class CCreatorModuleBaseParameters;
-
-class CContactDatabase;	
-//class CPhonebookWrapperParameters;	
-class CPhonebookParameters;
-
-typedef typename std::map<const TInt, HBufC*> TCreatorContactFields;
-typedef typename std::pair<const TInt, HBufC*> TCreatorContactField;
-
-class CCreatorPhonebookWrapper : public CBase 
-    {
-public:
-	enum ContactDetailType{
-	ELastName,					//0
-	ELastNameReading,			//1
-	EFirstName,
-	EFirstNameReading,
-	EPrefix,
-	ESuffix,					//5
-	ESecondName,
-	ELandPhoneHome,
-	EMobilePhoneHome,
-	EVideoNumberHome,
-	EFaxNumberHome,				//10
-	EVoipHome,
-	EEmailHome,
-	EUrlHome,
-	EAddrLabelHome,
-	EAddrPoHome,				//15
-	EAddrExtHome,
-	EAddrStreetHome,
-	EAddrLocalHome,
-	EAddrRegionHome,
-	EAddrPostCodeHome,			//20
-	EAddrCountryHome,
-	EJobTitle,
-	ECompanyName,
-	ELandPhoneWork,
-	EMobilePhoneWork,			//25
-	EVideoNumberWork,
-	EFaxNumberWork,
-	EVoipWork,
-	EEmailWork,
-	EUrlWork,					//30
-	EAddrLabelWork,
-	EAddrPoWork,
-	EAddrExtWork,
-	EAddrStreetWork,
-	EAddrLocalWork,				//35
-	EAddrRegionWork,
-	EAddrPostCodeWork,
-	EAddrCountryWork,
-	ELandPhoneGen,
-	EMobilePhoneGen,			//40
-	EVideoNumberGen,
-	EFaxNumberGen,
-	EVoipGen,
-	EPoc,
-	ESwis,						//45
-	ESip,
-	EEmailGen,
-	EUrlGen,
-	EAddrLabelGen,
-	EAddrPoGen,					//50
-	EAddrExtGen,
-	EAddrStreetGen,
-	EAddrLocalGen,
-	EAddrRegionGen,
-	EAddrPostCodeGen,			//55
-	EAddrCountryGen,
-	EPagerNumber,
-	EDtmfString,
-	EWVAddress,
-	EDate,						//60
-	ENote,
-	EThumbnailPic,
-	ERingTone,
-	ECallerObjImg,
-	ECallerObjText,				//65
-	EMiddleName,
-	EDepartment,
-	EAsstName,
-	ESpouse,
-	EChildren,					//70
-	EAsstPhone,
-	ECarPhone,
-	EAnniversary,
-	ESyncClass,
-	ELocPrivacy,				//75
-	EGenLabel,
-	ETopContact,
-	EIMPP,
-	};
-
-	
-public: 
-    static CCreatorPhonebookWrapper* NewL();
-    static CCreatorPhonebookWrapper* NewLC();
-    ~CCreatorPhonebookWrapper();
-
-private:
-    CCreatorPhonebookWrapper();
-    void ConstructL();
-
-public:  
-    TUint32 CreateContactEntryL(const TCreatorContactFields& Map);    
-    TUint32 CreateGroupEntryL( HBufC* aGroupName );
-    TInt CreateSubscribedContactEntryL(); 
-
-    /**
-     * NumberOfContacts() will return all contacts from Contact API
-     */
-    TInt NumberOfContacts();
-    
-    TInt AddContactToGroup( TUint32 aGroupId, TUint32 aContact );
-    TInt AddToGroup( TUint32 aGroupId, TInt aAmount );
-    
-    
-    void DeleteAllL();
-    void DeleteAllGroupsL();
-    void DeleteContactsL( RArray<TUint32>& aContactsToDelete, TUid aStoreUid );
-    
-private:
-    QList<QContactDetail> CreateContactDetailsFromParameters( const TCreatorContactFields& Map );
-    QContactDetail CreateContactDetail( QList<QContactDetail>& aContactDetailList,QString aDetail, QString aFieldContext, QString aFieldString, QString aData );
-    void AddFieldToList( QList<QContactDetail>& aDetailList, QContactDetail aDetail);
-    
-    TBool IsContactGroupL( TUint32& aLink );
-    
-    void DeleteItemsCreatedWithCreatorL( TUid aStoreUid );
-    void DoDeleteItemsCreatedWithCreatorL( TUid aStoreUid, CDictionaryFileStore* aStore );
-    TBool HasOtherThanGroupsL();
-    
-
-private:
-	
-    TInt iOpCounter;
-    
-    static QString iPhoneNumberFields[];
-    static TInt iUrlFields[];
-    static TInt iEmailFields[];
-    
-    RArray<TUint32> iContactLinkArray;
-    RArray<TUint32>  iContactsToDelete;	
-    RArray<TUint32>  iContactGroupsToDelete;	
-    
-    RArray<TUint32> iPreviousDeleteLinks;
-    //RPointerArray<MVPbkContactLinkArray> iPreviousDeleteLinks;  //modify
-    
-private:
-	//new variables
-	/// Ref: the target of the copy
-	QContact* iStore;       
-    
-    /// Own: Contact database for this store
-    CContactDatabase* iContactDb;    
-    
-    //Contacts found in contacts db.
-    QList<QContactId>* iContactResults;
-    // Contact groups that are found in the store. These are used in filtering
-    // the groups from the find results.
-    QList<QContactId>* iContactGroupsInStore;
-    
-    CCreatorPhonebookAPI* iPhonebookAPI;
-    };
-
-#endif // __CREATORPHONEBOOKWRAPPER_H__
--- a/creator/engine/inc/creator_randomdatafield.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_randomdataparser.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,131 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_scriptelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,350 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_scriptelementfactory.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_scriptentry.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* 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 <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, MUIObserver
-    {
-enum TCommandParserStatus{
-    EGetingScript,
-    EGetingRandomDataFile
-};
-
-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:
-    /**
-     * Called when some dialog in UI is closed
-     *
-     * @since S60 10.1
-     * @param aPositiveAction ETrue if "Ok", "Yes" or other "positive" button was pressed
-     * @param aUserData number that was passed to UI before dialog was opened
-     * @return None.
-     */
-    virtual void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData);
-    
-public:
-    void OpenScriptL();
-    TBool OpenScriptL(MCommandParserObserver* aObserver);
-    TBool GetRandomDataFilenameL(MCommandParserObserver* aObserver);
-
-private:
-    CCreatorEngine* iEngine;
-    CDesCArrayFlat* iSearchArray;
-    TInt iSelectedItem;
-    
-    TInt iParserPosition;
-    TInt iParserOldPosition;
-
-    HBufC8* iReadBuf;
-
-    MCommandParserObserver* iObserver;
-    };
-
-
-
-#endif // __FILEUTILS_H__
-
--- a/creator/engine/inc/creator_scriptparser.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
-* 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_*/
--- a/creator/engine/inc/creator_std.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* 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__
--- a/creator/engine/inc/creator_traces.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* 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__
-
--- a/creator/engine/inc/creator_wepsecuritysettings.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
-* 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();
-
-
-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_*/
--- a/creator/engine/inc/randomdata.txt	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,589 +0,0 @@
-// ---------------------------------------------------------
-
-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.";
-        };
-
-
--- a/creator/engine/src/creator_accesspoint.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,473 +0,0 @@
-/*
-* 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)
-    {
-    LOGSTRING("Creator: CCreatorAccessPoints::AskDataFromUserL");
-    
-    CCreatorModuleBase::AskDataFromUserL( aCommand );//ignore retval
-    
-    if( aCommand == ECmdDeleteIAPs )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all Access Points?"), this, ECreatorModuleDelete );
-        }
-    else if( aCommand == ECmdDeleteCreatorIAPs )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all Access Points created with Creator?"), this, ECreatorModuleDelete );
-        }
-
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog(&iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorModuleStart );
-    }
-
-
-//----------------------------------------------------------------------------
-
-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/engine/src/creator_browser.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,595 +0,0 @@
-/*
-* 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)
-    {
-    LOGSTRING("Creator: CCreatorBrowser::AskDataFromUserL");
-
-    CCreatorModuleBase::AskDataFromUserL( aCommand );//ignore retval
-    
-    TBool result( EFalse );
-    switch ( aCommand )
-        {
-        case ECmdDeleteBrowserBookmarks:
-            {
-            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser bookmarks?"), this, ECreatorModuleDelete );
-            break;
-            }
-        case ECmdDeleteCreatorBrowserBookmarks:
-            {
-            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser bookmarks created with Creator?"), this, ECreatorModuleDelete );
-            break;
-            }
-        case ECmdDeleteBrowserBookmarkFolders:
-            {
-            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser bookmark folders?"), this, ECreatorModuleDelete );
-            break;
-            }
-        case ECmdDeleteCreatorBrowserBookmarkFolders:
-            {
-            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser bookmark folders created with Creator?"), this, ECreatorModuleDelete );
-            break;
-            }
-        case ECmdDeleteBrowserSavedPages:
-            {
-            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser saved pages?"), this, ECreatorModuleDelete );
-            break;
-            }
-        case ECmdDeleteCreatorBrowserSavedPages:
-            {
-            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser saved pages created with Creator?"), this, ECreatorModuleDelete );
-            break;
-            }
-        case ECmdDeleteBrowserSavedPageFolders:
-            {
-            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser saved pages folders?"), this, ECreatorModuleDelete );
-            break;
-            }
-        case ECmdDeleteCreatorBrowserSavedPageFolders:
-            {
-            result = iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Browser saved pages folders created with Creator?"), this, ECreatorModuleDelete );
-            break;
-            }
-        default:
-            {
-            result = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorModuleStart );
-            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/engine/src/creator_browserelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-/*
-* 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...
-    }
--- a/creator/engine/src/creator_calendar.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1340 +0,0 @@
-/*
-* 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;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorInterimCalendar::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::QueryDialogClosedL");
-    
-    if( aPositiveAction == EFalse && aUserData != ECreatorCalendarAddDefaultAlarm )
-        {
-        iEngine->ShutDownEnginesL();
-        return;
-        }
-    
-    const TDesC* showText = &KSavingText;
-    TBool finished(EFalse);
-    TBool retval(ETrue);
-    switch(aUserData)
-        {
-        case ECreatorCalendarDelete:
-            iEntriesToBeCreated = 1;
-            showText = &KDeletingText;
-            finished = ETrue;
-            break;
-        case ECreatorCalendarStart:
-            if( iCommand == ECmdCreateCalendarEntryEvents || iCommand == ECmdCreateCalendarEntryAppointments )
-                {
-                _LIT(KRepeatingNum, "How many repeating (weekly) entries");
-                retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iNumberRepeatingEntries, KRepeatingNum, ETrue, this, ECreatorCalendarGetWeeklyEntries);
-                }
-            else
-                {
-                _LIT(KStartPeriodDate, "Start date of creation period");// \n dd/mm/yyyy
-                retval = iEngine->GetEngineWrapper()->TimeQueryDialog(&iRandomModeStartTime, KStartPeriodDate, this, ECreatorCalendarGetStartDate); // ask start date
-                }
-            break;
-        case ECreatorCalendarGetWeeklyEntries:
-            _LIT(KAttendeesNum, "How many attendees to create");
-            retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iNumberOfAttendees, KAttendeesNum, ETrue, this, ECreatorCalendarGetAttendies);
-            break;
-        case ECreatorCalendarGetAttendies:
-            {
-            // ask start date
-            _LIT(KStartPeriodDate, "Start date of creation period");
-            retval = iEngine->GetEngineWrapper()->TimeQueryDialog(&iRandomModeStartTime, KStartPeriodDate, this, ECreatorCalendarGetStartDate ); 
-            }
-            break;
-        case ECreatorCalendarGetStartDate:
-            {
-            _LIT(KEndPeriodDate, "End date of creation period\n dd/mm/yyyy");
-            iEngine->GetEngineWrapper()->TimeQueryDialog (&iRandomModeEndTime, KEndPeriodDate, this, ECreatorCalendarGetEndDate ); // ask end date
-            }
-            break;
-        case ECreatorCalendarGetEndDate:
-           if (iRandomModeStartTime > iRandomModeEndTime ) // check end date is ok
-                {
-                iEngine->GetEngineWrapper()->ShowNote(_L("End date must be after start date") );
-                retval = EFalse;
-                }
-            else 
-                {
-                retval = iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Add default alarm?"), this, ECreatorCalendarAddDefaultAlarm);
-                }
-           break;
-        case ECreatorCalendarAddDefaultAlarm:
-            iSetAlarm = aPositiveAction;
-            finished = ETrue;
-            break;
-        default:
-            //some error
-            retval = EFalse;
-            break;
-        }
-    if( retval == EFalse )
-        {
-        iEngine->ShutDownEnginesL();
-        }
-    else if( finished )
-        {
-        // add this command to command array
-        iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
-        // started exucuting commands
-        iEngine->ExecuteFirstCommandL( *showText );
-        }
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorInterimCalendar::AskDataFromUserL( TInt aCommand )
-    {
-    LOGSTRING("Creator: CCreatorInterimCalendar::AskDataFromUserL");
-    
-    CCreatorModuleBase::AskDataFromUserL( aCommand );//ignore retval
-    
-    if( aCommand == ECmdDeleteCalendarEntries )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all calendar entries?"), this, ECreatorCalendarDelete );
-        }
-    if( aCommand == ECmdDeleteCreatorCalendarEntries )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all calendar entries created with Creator?"), this, ECreatorCalendarDelete ); 
-        }
-
-    // display queries
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog(&iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorCalendarStart ); // ask number of entries to create
-    }
-
-//----------------------------------------------------------------------------
-
-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 );
-    }
-
-//----------------------------------------------------------------------------
-
--- a/creator/engine/src/creator_calendarelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,595 +0,0 @@
-/*
-* 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;
-    }
--- a/creator/engine/src/creator_cmdscriptrun.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/*
-* 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()
-	{
-	TRAP_IGNORE( TickL() );
-	}
-
-void  CCreatorCmdScriptRun::Synchronize()
-	{
-    TRAP_IGNORE( TickL() );
-	}
-
-void  CCreatorCmdScriptRun::TickL()
-	{
-	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();
-	    	}
-		}
-	}
--- a/creator/engine/src/creator_connectionmethod.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,954 +0,0 @@
-/*
-* 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)
-    {
-    LOGSTRING("Creator: CCreatorConnectionSettings::AskDataFromUserL");
-    
-    CCreatorModuleBase::AskDataFromUserL( aCommand );
-    
-    if( aCommand == ECmdDeleteIAPs )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all Connection Methods?"), this, ECreatorModuleDelete );
-        }
-    else if( aCommand == ECmdDeleteCreatorIAPs )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all Connection Methods created with Creator?"), this, ECreatorModuleDelete );
-        }
-    else
-        {
-        return iEngine->GetEngineWrapper()->EntriesQueryDialog(&iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorModuleStart );
-        }
-    }
-
-
-//----------------------------------------------------------------------------
-
-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 );
-    }
-//----------------------------------------------------------------------------
--- a/creator/engine/src/creator_connectionmethodelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,333 +0,0 @@
-/*
-* 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
-			}
-		}
-	}
--- a/creator/engine/src/creator_contactelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,405 +0,0 @@
-/*
-* 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_phonebook.h"
-#include "creator_factory.h"
-#include "creator_contactsetcache.h"
-#include <xml/documentparameters.h>
-#include <qtcontacts.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;
-};
-FieldMapping fieldMappingTbl[] = {
-       {TPtrC(KFirstname), CCreatorPhonebookWrapper::EFirstName, EDataTypeText},
-       {TPtrC(KLastname), CCreatorPhonebookWrapper::ELastName, EDataTypeText},
-       {TPtrC(KFirstnameReading), CCreatorPhonebookWrapper::EFirstNameReading, EDataTypeText},
-       {TPtrC(KLastnameReading), CCreatorPhonebookWrapper::ELastNameReading, EDataTypeText},
-       {TPtrC(KPrefix), CCreatorPhonebookWrapper::EPrefix, EDataTypeText},
-       {TPtrC(KSuffix), CCreatorPhonebookWrapper::ESuffix, EDataTypeText},
-       {TPtrC(KSecondname), CCreatorPhonebookWrapper::ESecondName, EDataTypeText},
-       {TPtrC(KLandphoneHome), CCreatorPhonebookWrapper::ELandPhoneHome, EDataTypeText},
-       
-       {TPtrC(KMobilephoneHome), CCreatorPhonebookWrapper::EMobilePhoneHome, EDataTypeText},
-       {TPtrC(KVideonumberHome), CCreatorPhonebookWrapper::EVideoNumberHome, EDataTypeText},
-       {TPtrC(KFaxnumberHome), CCreatorPhonebookWrapper::EFaxNumberHome, EDataTypeText},
-       {TPtrC(KVoipHome), CCreatorPhonebookWrapper::EVoipHome, EDataTypeText},
-       {TPtrC(KEmailHome), CCreatorPhonebookWrapper::EEmailHome, EDataTypeText},
-       {TPtrC(KUrlHome), CCreatorPhonebookWrapper::EUrlHome, EDataTypeText},
-       {TPtrC(KAddrlabelHome), CCreatorPhonebookWrapper::EAddrLabelHome, EDataTypeText},
-       {TPtrC(KAddrpoHome), CCreatorPhonebookWrapper::EAddrPoHome, EDataTypeText},
-       
-       {TPtrC(KAddrextHome), CCreatorPhonebookWrapper::EAddrExtHome, EDataTypeText},
-       {TPtrC(KAddrstreetHome), CCreatorPhonebookWrapper::EAddrStreetHome, EDataTypeText},
-       {TPtrC(KAddrlocalHome), CCreatorPhonebookWrapper::EAddrLocalHome, EDataTypeText},
-       {TPtrC(KAddrregionHome), CCreatorPhonebookWrapper::EAddrRegionHome, EDataTypeText},
-       {TPtrC(KAddrpostcodeHome), CCreatorPhonebookWrapper::EAddrPostCodeHome, EDataTypeText},
-       {TPtrC(KAddrcountryHome), CCreatorPhonebookWrapper::EAddrCountryHome, EDataTypeText},
-       {TPtrC(KJobtitle), CCreatorPhonebookWrapper::EJobTitle, EDataTypeText},
-       {TPtrC(KCompanyname), CCreatorPhonebookWrapper::ECompanyName, EDataTypeText},
-       
-       {TPtrC(KLandphoneWork), CCreatorPhonebookWrapper::ELandPhoneWork, EDataTypeText},
-       {TPtrC(KMobilephoneWork), CCreatorPhonebookWrapper::EMobilePhoneWork, EDataTypeText},
-       {TPtrC(KVideonumberWork), CCreatorPhonebookWrapper::EVideoNumberWork, EDataTypeText},
-       {TPtrC(KFaxnumberWork), CCreatorPhonebookWrapper::EFaxNumberWork, EDataTypeText},
-       {TPtrC(KVoipWork), CCreatorPhonebookWrapper::EVoipWork, EDataTypeText},
-       {TPtrC(KEmailWork), CCreatorPhonebookWrapper::EEmailWork, EDataTypeText},
-       {TPtrC(KUrlWork), CCreatorPhonebookWrapper::EUrlWork, EDataTypeText},
-       {TPtrC(KAddrlabelWork), CCreatorPhonebookWrapper::EAddrLabelWork, EDataTypeText},
-       
-       {TPtrC(KAddrpoWork), CCreatorPhonebookWrapper::EAddrPoWork, EDataTypeText},
-       {TPtrC(KAddrextWork), CCreatorPhonebookWrapper::EAddrExtWork, EDataTypeText},
-       {TPtrC(KAddrstreetWork), CCreatorPhonebookWrapper::EAddrStreetWork, EDataTypeText},
-       {TPtrC(KAddrlocalWork), CCreatorPhonebookWrapper::EAddrLocalWork, EDataTypeText},
-       {TPtrC(KAddrregionWork), CCreatorPhonebookWrapper::EAddrRegionWork, EDataTypeText},
-       {TPtrC(KAddrpostcodeWork), CCreatorPhonebookWrapper::EAddrPostCodeWork, EDataTypeText},
-       {TPtrC(KAddrcountryWork), CCreatorPhonebookWrapper::EAddrCountryWork, EDataTypeText},
-       {TPtrC(KLandphoneGen), CCreatorPhonebookWrapper::ELandPhoneGen, EDataTypeText},
-       
-       {TPtrC(KMobilephoneGen), CCreatorPhonebookWrapper::EMobilePhoneGen, EDataTypeText},
-       {TPtrC(KVideonumberGen), CCreatorPhonebookWrapper::EVideoNumberGen, EDataTypeText},
-       {TPtrC(KFaxnumberGen), CCreatorPhonebookWrapper::EFaxNumberGen, EDataTypeText},
-       {TPtrC(KVoipGen), CCreatorPhonebookWrapper::EVoipGen, EDataTypeText},
-       {TPtrC(KPoc), CCreatorPhonebookWrapper::EPoc, EDataTypeText},
-       {TPtrC(KSwis), CCreatorPhonebookWrapper::ESwis, EDataTypeText},
-       {TPtrC(KSip), CCreatorPhonebookWrapper::ESip, EDataTypeText},
-       {TPtrC(KEmailGen), CCreatorPhonebookWrapper::EEmailGen, EDataTypeText},
-       
-       {TPtrC(KUrlGen), CCreatorPhonebookWrapper::EUrlGen, EDataTypeText},
-       {TPtrC(KAddrlabelGen), CCreatorPhonebookWrapper::EAddrLabelGen, EDataTypeText},
-       {TPtrC(KAddrpoGen), CCreatorPhonebookWrapper::EAddrPoGen, EDataTypeText},
-       {TPtrC(KAddrextGen), CCreatorPhonebookWrapper::EAddrExtGen, EDataTypeText},
-       {TPtrC(KAddrstreetGen), CCreatorPhonebookWrapper::EAddrStreetGen, EDataTypeText},
-       {TPtrC(KAddrlocalGen), CCreatorPhonebookWrapper::EAddrLocalGen, EDataTypeText},
-       {TPtrC(KAddrregionGen), CCreatorPhonebookWrapper::EAddrRegionGen, EDataTypeText},
-       {TPtrC(KAddrpostcodeGen), CCreatorPhonebookWrapper::EAddrPostCodeGen, EDataTypeText},
-       
-       {TPtrC(KAddrcountryGen), CCreatorPhonebookWrapper::EAddrCountryGen, EDataTypeText},
-       {TPtrC(KPagerNumber), CCreatorPhonebookWrapper::EPagerNumber, EDataTypeText},
-       {TPtrC(KDtmfString), CCreatorPhonebookWrapper::EDtmfString, EDataTypeText},
-       {TPtrC(KWvAddress), CCreatorPhonebookWrapper::EWVAddress, EDataTypeText},
-       {TPtrC(KDate), CCreatorPhonebookWrapper::EDate, EDataTypeDateTime},
-       {TPtrC(KNote), CCreatorPhonebookWrapper::ENote, EDataTypeText},
-       {TPtrC(KThumbnailPath), CCreatorPhonebookWrapper::EThumbnailPic, EDataTypeText},
-       {TPtrC(KThumbnailId), CCreatorPhonebookWrapper::EThumbnailPic, EDataTypeText},
-       {TPtrC(KRingTone), CCreatorPhonebookWrapper::ERingTone, EDataTypeText},
-       {TPtrC(KRingToneId), CCreatorPhonebookWrapper::ERingTone, EDataTypeText},
-       
-       {TPtrC(KCallerobjImg), CCreatorPhonebookWrapper::ECallerObjImg, EDataTypeText},
-       {TPtrC(KCallerobjText), CCreatorPhonebookWrapper::ECallerObjText, EDataTypeText},
-       {TPtrC(KMiddlename), CCreatorPhonebookWrapper::EMiddleName, EDataTypeText},
-       {TPtrC(KDepartment), CCreatorPhonebookWrapper::EDepartment, EDataTypeText},
-       {TPtrC(KAsstname), CCreatorPhonebookWrapper::EAsstName, EDataTypeText},
-       {TPtrC(KSpouse), CCreatorPhonebookWrapper::ESpouse, EDataTypeText},
-       {TPtrC(KChildren), CCreatorPhonebookWrapper::EChildren, EDataTypeText},
-       {TPtrC(KAsstphone), CCreatorPhonebookWrapper::EAsstPhone, EDataTypeText},
-       
-       {TPtrC(KCarphone), CCreatorPhonebookWrapper::ECarPhone, EDataTypeText},
-       {TPtrC(KAnniversary), CCreatorPhonebookWrapper::EAnniversary, EDataTypeDateTime},
-       {TPtrC(KSyncclass), CCreatorPhonebookWrapper::ESyncClass, EDataTypeText},
-       {TPtrC(KLocPrivacy), CCreatorPhonebookWrapper::ELocPrivacy, EDataTypeText},
-       {TPtrC(KGenlabel), CCreatorPhonebookWrapper::EGenLabel, EDataTypeText}
-};
-
-//*********************************************************************************
-
-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()
-    {    
-    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 )
-        {
-        CPhonebookParameters* param = (CPhonebookParameters*) 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();
-                CCreatorContactField* field = 0;
-				field = CCreatorContactField::NewL();
-
-                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() );
-                    }
-                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) )
-                            {
-							CCreatorContactField* field = CCreatorContactField::NewL();
-                        	CleanupStack::PushL(field);
-                        	field->AddFieldToParamL( iEngine,param, mapping.iFieldCode, KErrNotFound );
-                          	CleanupStack::Pop(field);
-                            }
-                        else
-                        	{
-							CCreatorContactField* field = CCreatorContactField::NewL();
-                            CleanupStack::PushL(field);
-                            field->AddFieldToParamL( param, mapping.iFieldCode, content );
-                            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 = CCreatorContactField::NewL();
-                CleanupStack::PushL(field);
-                field->AddFieldToParamL( iEngine,param, fieldMappingTbl[i].iFieldCode, KErrNotFound );
-                CleanupStack::Pop(field);
-                }
-                
-            }
-        iEngine->AppendToCommandArrayL(ECmdCreatePhoneBookEntryContacts, param);
-        iParameters.AppendL(param); // Save the pointer to the parametes. 
-        CleanupStack::Pop(param);
-        }
-    }
-
-
-/*
-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()
-    {
-    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 )
-            {    
-            CPhonebookParameters* param = (CPhonebookParameters*) 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);
-            }
-        }
-    }
-
-/*
-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)
-    { }
--- a/creator/engine/src/creator_contactsetcache.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/*
-* 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;
-    }
-
-void CCreatorContactSet::AppendL(TUint32 aContactLink)
-    {
-    iContactLinks.AppendL(aContactLink);
-    }
-
-RArray<TUint32> CCreatorContactSet::ContactLinks()
-    {
-    return iContactLinks;
-    }
-
-const RArray<TUint32> CCreatorContactSet::ContactLinks() const
-    {
-    return iContactLinks;
-    }
-
-
-TInt CCreatorContactSet::NumberOfExistingContacts() const
-    {
-    return iNumOfExistingContacts;
-    }
-
-CCreatorContactSet::~CCreatorContactSet()
-    {
-    iContactLinks.Reset();
-    iContactLinks.Close();
-    }
-
-
-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 RArray<TUint32> ContactLinks(TInt aLinkId);
-    virtual const RArray<TUint32> ContactLinks(TInt aLinkId) const;
-
-    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();
-    
-    RArray<TUint32> iEmptyLinks;
-
-    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()
-    {
-    iEmptyLinks.Reset();// just in case...
-    iEmptyLinks.Close();
-
-    iContactSets.ResetAndDestroy();
-    iContactSets.Close();
-    delete iDummyContactSet;
-    }
-void CContactLinkCacheImp::AppendL(CCreatorContactSet* aContactSet)
-    {
-    iContactSets.AppendL(aContactSet);
-    }
-RArray<TUint32> CContactLinkCacheImp::ContactLinks(TInt aLinkId)
-    {
-    for( TInt i = 0; i < iContactSets.Count(); ++i )
-        {
-        if( iContactSets[i]->LinkId() == aLinkId )
-            {
-            return iContactSets[i]->ContactLinks();
-            }
-        }
-    return iEmptyLinks;
-    }
-
-const RArray<TUint32> CContactLinkCacheImp::ContactLinks(TInt aLinkId) const
-    {
-    for( TInt i = 0; i < iContactSets.Count(); ++i )
-        {
-        if( iContactSets[i]->LinkId() == aLinkId )
-            {
-            return iContactSets[i]->ContactLinks();
-            }
-        }
-    return iEmptyLinks;
-    }
-
-
-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/engine/src/creator_factory.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* 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) CPhonebookParameters;
-	}
-/*
-CCreatorConnectionSettingsBase* TCreatorFactory::CreateConnectionSettingsL(CCreatorEngine* aEngine)
-{
-    return CCreatorAccessPoints::NewL(aEngine); 
-}
-
-CCreatorModuleBaseParameters* TCreatorFactory::CreateConnectionSettingsParametersL()
-    {
-    return new(ELeave) CAccessPointsParameters;
-    }
-*/
--- a/creator/engine/src/creator_file.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,831 +0,0 @@
-/*
-* 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 )
-        {
-        TRAP_IGNORE(    
-            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;
-
-    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 iParameters;
-    delete iUserParameters;
-    iApaLs.Close();
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorFiles::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
-    {
-    LOGSTRING("Creator: CCreatorFiles::QueryDialogClosedL");
-    
-    if( aPositiveAction == EFalse )
-        {
-        iEngine->ShutDownEnginesL();
-        return;
-        }
-    
-    const TDesC* showText = &KSavingText;
-    TBool finished(EFalse);
-    TBool retval(ETrue);
-    switch(aUserData)
-        {
-        case ECreatorFilesDelete:
-            showText = &KDeletingText;
-            iEntriesToBeCreated = 1;
-            finished = ETrue;
-            break;
-        case ECreatorFilesStart:
-            {
-            // set a default directory  (eg. c:\Nokia\Images\)
-            iEngine->SetDefaultPathForFileCommandL(iCommand, iDirectoryQueriedFromUser);
-            TBuf<50> promptText;
-            if (iCommand == ECmdCreateFileEntryEmptyFolder)
-                promptText.Copy( _L("Specify the folder path and name") );
-            else
-                promptText.Copy( _L("Specify the directory") );
-            
-            // show directory query dialog
-            retval = iEngine->GetEngineWrapper()->DirectoryQueryDialog(promptText, iDirectoryQueriedFromUser, this, ECreatorFilesGetDirectory );
-            }
-            break;
-        case ECreatorFilesGetDirectory:
-            // check that the root folder is correct
-            if ( iDirectoryQueriedFromUser.Length() < 3  ||  BaflUtils::CheckFolder( iFs, iDirectoryQueriedFromUser.Left(3) ) != KErrNone )
-                {
-                iEngine->GetEngineWrapper()->ShowErrorMessage(_L("Invalid path"));
-                retval = EFalse;
-                }        
-            else
-                {
-                // check the directory contains a trailing backlash
-                if ( iDirectoryQueriedFromUser.Right(1) != _L("\\") )
-                    {
-                    iDirectoryQueriedFromUser.Append(_L("\\"));
-                    }
-                // copy the directory name to a class member
-                if ( iCommand == ECmdCreateFileEntryEmptyFolder )
-                    {
-                    finished = ETrue;
-                    }
-                else
-                    {
-                    retval = AskDRMDataFromUserL();
-                    }
-                }
-            break;
-        case ECreatorFilesAskDRMData:
-            if ( iDummy > 0 )
-                {
-                iUserParameters->iEncrypt = ETrue;
-                }
-            if ( iDummy == 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
-                iDummy = 0;
-                retval = iEngine->GetEngineWrapper()->EntriesQueryDialog( &iDummy, _L("How many counts(0=unlimited)?"), ETrue, this, ECreatorFilesAskDRM_CD_Counts );
-                }
-            else
-                {
-                finished = ETrue;
-                }
-            break;
-        case ECreatorFilesAskDRM_CD_Counts:
-            if ( iDummy > 0 )
-                {
-                TInt count = iDummy;
-                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;
-                }
-            iDummy = 0;
-            retval = iEngine->GetEngineWrapper()->EntriesQueryDialog( &iDummy, _L("How many minutes until expire(0=unlimited)?"), ETrue, 
-                this, ECreatorFilesAskDRM_CD_Minutes
-                );
-            break;
-        case ECreatorFilesAskDRM_CD_Minutes:
-            if ( iDummy > 0 )
-                {
-                TInt minutes = iDummy;
-                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();
-                }
-            finished = ETrue;
-            break;
-        default:
-            //some error
-            retval = EFalse;
-            break;
-        }
-    if( retval == EFalse )
-        {
-        iEngine->ShutDownEnginesL();
-        }
-    else if( finished )
-        {
-        // add this command to command array
-        iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
-        // started exucuting commands
-        iEngine->ExecuteFirstCommandL( *showText );
-        }
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorFiles::AskDataFromUserL(TInt aCommand)
-    {
-    LOGSTRING("Creator: CCreatorFiles::AskDataFromUserL");
-    
-    CCreatorModuleBase::AskDataFromUserL( aCommand );
-    
-    if ( aCommand == ECmdDeleteCreatorFiles )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all files created with Creator?"), this, ECreatorFilesDelete );
-        }
-    
-    delete iUserParameters;
-    iUserParameters = NULL;
-    iUserParameters = new(ELeave) CFilesParameters();
-    
-    iDirectoryQueriedFromUser.Copy( KNullDesC );
-
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog(&iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorFilesStart );
-    }
-
-
-//----------------------------------------------------------------------------
-
-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.Length() > 0)
-        	directoryToBeCreated = iDirectoryQueriedFromUser;
-        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.Length() > 0 )
-            {
-            // target path = directory + the file name from source path
-            TParse parser;
-            parser.Set(fullSourcePath, NULL, NULL);
-
-            fullTargetPath = iDirectoryQueriedFromUser;
-            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
-    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") );
-
-    
-	// create a popup list
-    iDummy = 0;
-    TBool retval = iEngine->GetEngineWrapper()->PopupListDialog(_L("Encryption"), items, &iDummy, this, ECreatorFilesAskDRMData );
-    CleanupStack::PopAndDestroy( items );
-    return retval;
-    }
-
-//----------------------------------------------------------------------------
-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/engine/src/creator_fileelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,316 +0,0 @@
-/*
-* 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
--- a/creator/engine/src/creator_landmark.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,502 +0,0 @@
-/*
-* 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)
-    {
-    LOGSTRING("Creator: CCreatorLandmarks::AskDataFromUserL");
-    
-    CCreatorModuleBase::AskDataFromUserL( aCommand );
-    
-    if ( aCommand == ECmdDeleteLandmarks )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Landmarks?"), this, ECreatorModuleDelete );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorLandmarks )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Landmarks created with Creator?"), this, ECreatorModuleDelete );
-        }
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog(&iEntriesToBeCreated, _L("How many landmarks to create?"), EFalse, this, ECreatorModuleStart );    
-    }
-
-/**
- * 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/engine/src/creator_landmarkelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,257 +0,0 @@
-/*
-* 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);
-    	}
-    }
--- a/creator/engine/src/creator_log.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,486 +0,0 @@
-/*
-* 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)
-    {
-    iEntriesToBeCreated = 1;
-    }
-
-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;
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorLogs::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
-    {
-    LOGSTRING("Creator: CCreatorModuleBase::QueryDialogClosedL");
-    
-    if( aPositiveAction == EFalse )
-        {
-        iEngine->ShutDownEnginesL();
-        return;
-        }
-    
-    const TDesC* showText = &KSavingText;
-    TBool finished(EFalse);
-    TBool retval(ETrue);
-    switch(aUserData)
-        {
-        case ECreatorLogsDelete:
-            showText = &KDeletingText;
-            iEntriesToBeCreated = 1;
-            finished = ETrue;
-            break;
-        case ECreatorLogsStart:
-            finished = ETrue;
-            break;
-        default:
-            //some error
-            retval = EFalse;
-            break;
-        }
-    if( retval == EFalse )
-        {
-        iEngine->ShutDownEnginesL();
-        }
-    else if( finished )
-        {
-        // add this command to command array
-        iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
-        // started exucuting commands
-        iEngine->ExecuteFirstCommandL( *showText );
-        }
-    }
-    
-//----------------------------------------------------------------------------
-
-TBool CCreatorLogs::AskDataFromUserL(TInt aCommand)
-    {
-    LOGSTRING("Creator: CCreatorLogs::AskDataFromUserL");
-    
-    iCommand = aCommand;
-    
-    if ( aCommand == ECmdDeleteLogs )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries?"), this, ECreatorLogsDelete );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorLogs )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all log entries created with Creator?"), this, ECreatorLogsDelete );
-        }
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog( &iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorLogsStart );
-    }
-
-//----------------------------------------------------------------------------
-
-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 );
-    }
--- a/creator/engine/src/creator_logelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/*
-* 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...
-    }
--- a/creator/engine/src/creator_mailbox.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,797 +0,0 @@
-/*
-* 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)
-    {
-    LOGSTRING("Creator: CCreatorMailboxes::AskDataFromUserL");
-    
-    CCreatorModuleBase::AskDataFromUserL( aCommand );//ignore retval
-    
-    if ( aCommand == ECmdDeleteMailboxes )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all mailboxes?"), this, ECreatorModuleDelete );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorMailboxes )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all mailboxes created with Creator?"), this, ECreatorModuleDelete );
-        }
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog( &iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorModuleStart );
-    }
-
-
-//----------------------------------------------------------------------------
-
-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/engine/src/creator_mailboxelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,496 +0,0 @@
-/*
-* 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);
-    	}
-    }
--- a/creator/engine/src/creator_message.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1802 +0,0 @@
-/*
-* 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 <utf.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();
-    }
-
-//----------------------------------------------------------------------------
-
-void CCreatorMessages::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
-    {
-    LOGSTRING("Creator: CCreatorMessages::QueryDialogClosedL");  
-    
-    if( aPositiveAction == EFalse )
-        {
-        iEngine->ShutDownEnginesL();
-        return;
-        }
-    
-    const TDesC* showText = &KSavingText;
-    TBool finished(EFalse);
-    TBool retval(ETrue);
-    switch(aUserData)
-        {
-        case ECreatorMessagesDelete:
-            showText = &KDeletingText;
-            iEntriesToBeCreated = 1;
-            finished = ETrue;
-            break;
-        case ECreatorMessagesStart:
-            // message type query
-            retval = iEngine->GetEngineWrapper()->ListQueryDialog(_L("Message type"), R_MESSAGE_TYPE_QUERY, (TInt*) &iMessageType, this, ECreatorMessagesMessageType);
-            break;
-        case ECreatorMessagesMessageType:
-            retval = iEngine->GetEngineWrapper()->ListQueryDialog(_L("Folder type"), R_FOLDER_TYPE_QUERY, (TInt*) &iFolderType, this, ECreatorMessagesFolderType);
-            break;
-        case ECreatorMessagesFolderType:
-            // query create as unread
-            retval = iEngine->GetEngineWrapper()->ListQueryDialog(_L("Message status"), R_UNREAD_QUERY, (TInt*)&iCreateAsUnread, this, ECreatorMessagesMessageStatus);
-            break;
-        case ECreatorMessagesMessageStatus:
-            if( iMessageType == ESMS || iMessageType == EMMS || iMessageType == EEmail )
-                {
-                iDefinedMessageLength = 100;
-                retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iDefinedMessageLength, _L("Amount of characters in message body?"), ETrue, 
-                    this, ECreatorMessagesCharsInBody
-                    );
-                break;
-                }
-            else
-                {
-                iDefinedMessageLength = 0;
-                // goto query attachments ... :-) DO NOT break;
-                }
-        case ECreatorMessagesCharsInBody:
-            // query attachments
-            iAttachments->Reset();
-            if( iMessageType == EMMS || iMessageType == EEmail)
-                {
-                retval = iEngine->GetEngineWrapper()->ListQueryDialog(_L("Choose attachment:"), R_ATTACHMENT_MULTI_SELECTION_QUERY, 
-                    iAttachments, this, ECreatorMessagesAttachment
-                    );
-                }
-            else if( iMessageType == EAMS )
-                {
-                iAttachments->AppendL( TInt(0) );
-                retval = iEngine->GetEngineWrapper()->ListQueryDialog(_L("Choose attachment:"), R_AMS_ATTACHMENT_SINGLE_SELECTION_QUERY, 
-                    &iAttachments->At(0), this, ECreatorMessagesAttachment
-                    );
-                }
-            else if( iMessageType == EIrMessage || iMessageType == EBTMessage )
-                {
-                iAttachments->AppendL( TInt(0) );
-                retval = iEngine->GetEngineWrapper()->ListQueryDialog(_L("Choose attachment:"), R_ATTACHMENT_SINGLE_SELECTION_QUERY,
-                    &iAttachments->At(0), this, ECreatorMessagesAttachment
-                    );
-                }
-            else
-                {
-                finished = ETrue;
-                }
-            break;
-        case ECreatorMessagesAttachment:
-            finished = ETrue;
-            if(iMessageType== EMMS || iMessageType == EEmail)
-                {
-                // "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 
-
-                    }
-                }
-            break;
-        default:
-            //some error
-            retval = EFalse;
-            break;
-        }
-    if( retval == EFalse )
-        {
-        iEngine->ShutDownEnginesL();
-        }
-    else if( finished )
-        {
-        // add this command to command array
-        iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
-        // started exucuting commands
-        iEngine->ExecuteFirstCommandL( *showText );
-        }
-    }
-//----------------------------------------------------------------------------
-
-TBool CCreatorMessages::AskDataFromUserL(TInt aCommand)
-    {
-    LOGSTRING("Creator: CCreatorMessages::AskDataFromUserL");
-
-    CCreatorModuleBase::AskDataFromUserL(aCommand);
-    
-    if ( aCommand == ECmdDeleteMessages )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all messages?"), this, ECreatorMessagesDelete );
-        }
-    else if ( aCommand ==  ECmdDeleteCreatorMessages )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all messages created with Creator?"), this, ECreatorMessagesDelete  );
-        }
-
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog( &iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorMessagesStart );
-    }
-
-//----------------------------------------------------------------------------
-
-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
-    // !!! This will cause CRASH
-    /*if (parameters.iFolderType == EInbox)
-        {
-        CSmsHeader* smsHeader = &clientMtm->SmsHeader();
-        delete smsHeader; // <-- This will cause CRASH
-        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)
-        {
-        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);        
-        }
-    else
-        {
-        SetRecipientToEntryDetailsL(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 = CnvUtfConverter::ConvertFromUnicodeToUtf8L( parameters.iMessageBodyText->Des() );
-    CleanupStack::PushL(tempBuf);
-    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)
-        {
-        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);        
-        }
-    else
-        {
-        SetRecipientToEntryDetailsL(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)
-        {
-        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);        
-        }  
-    else
-        {
-        SetRecipientToEntryDetailsL(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 );
-        SetSenderToEntryDetailsL(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 );
-        SetRecipientToEntryDetailsL(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)
-        {
-        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);        
-        }        
-    else
-        {
-        SetRecipientToEntryDetailsL(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)
-        {
-        SetSenderToEntryDetailsL(messageEntry, parameters, EFalse);
-        }        
-    else
-        {
-        SetRecipientToEntryDetailsL(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::SetSenderToEntryDetailsL(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::SetRecipientToEntryDetailsL(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;
-    }
--- a/creator/engine/src/creator_messageelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,475 +0,0 @@
-/*
-* 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
--- a/creator/engine/src/creator_note.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
-* 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;
-    iNotepadWrapper = CCreatorNotepadWrapper::NewL();
-    }
-
-CCreatorNotepad::~CCreatorNotepad()
-    {
-    LOGSTRING("Creator: CCreatorNotepad::~CCreatorNotepad");
-    
-    if (iParameters)
-        {
-        delete iParameters;
-        iParameters;
-        }
-    
-    if (iNotepadWrapper)
-    	{
-		delete iNotepadWrapper;
-    	}
-    }
-
-//----------------------------------------------------------------------------
-
-TBool CCreatorNotepad::AskDataFromUserL(TInt aCommand)
-    {
-    LOGSTRING("Creator: CCreatorNotepad::AskDataFromUserL");
-
-    CCreatorModuleBase::AskDataFromUserL(aCommand);
-        
-    if ( aCommand == ECmdDeleteNotes )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog( _L("Delete all Notes?"), this, ECreatorModuleDelete );
-        }
-    
-    // By Creator not supported because 
-    // note id is not available via Notepad API
-
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog( &iEntriesToBeCreated, _L("How many entries to create?"), EFalse,  this, ECreatorModuleStart );
-    }
-
-
-//----------------------------------------------------------------------------
-
-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;
-
-    iNotepadWrapper->CreateNoteL(parameters->iNoteText->Des());
-    
-    return err;
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorNotepad::DeleteAllL()
-    {
-    LOGSTRING("Creator: CCreatorNotepad::DeleteAllL");
-    iNotepadWrapper->DeleteAllL();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorNotepad::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorNotepad::DeleteAllCreatedByCreatorL");
-    // Not supported because note id is not available via Notepad API
-    User::Leave( KErrNotSupported );
-    }
--- a/creator/engine/src/creator_noteelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* 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);
-    	}
-    }
--- a/creator/engine/src/creator_notepadwrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-/*
-* 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_notepadwrapper.h"
-
-	/**
-	* Constructor
-	*/
-CCreatorNotepadWrapper::CCreatorNotepadWrapper()
-	{
-	}
-	
-	/**
-	* Destructor
-	*/
-CCreatorNotepadWrapper::~CCreatorNotepadWrapper()
-	{
-/*    
-	if(iNotepadApi)
-        {
-        delete iNotepadApi;
-        iNotepadApi = NULL;
-        }
- */   
-    if(iAgendaUtil)
-        {
-        delete iAgendaUtil;
-        iAgendaUtil = NULL;
-        }
-	}
-	
-	/**
-	* Two-Phased constructor
-	*/
-CCreatorNotepadWrapper* CCreatorNotepadWrapper::NewL()
-	{
-	CCreatorNotepadWrapper* self = CCreatorNotepadWrapper::NewLC();
-	CleanupStack::Pop(self);
-    return self;
-	}
-
-	/**
-	* Two-Phased constructor
-	*/
-CCreatorNotepadWrapper* CCreatorNotepadWrapper::NewLC()
-	{
-	CCreatorNotepadWrapper* self = new (ELeave) CCreatorNotepadWrapper;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-    return self;
-	}
-	
-	/**
-	* ConstructL()
-	*/
-
-void CCreatorNotepadWrapper::ConstructL()
-	{
-	iAgendaUtil = new AgendaUtil();
-//	iNotepadApi = new NotesEditor(iAgendaUtil);
-	}
-
-TInt CCreatorNotepadWrapper::CreateNoteL( const TDesC& aText )
-	{
-	TInt err = KErrNone;
-	QString textNote = QString::fromUtf16( aText.Ptr(),aText.Length());
-    iNotepadApi->edit(textNote,iAgendaUtil);
-    iNotepadApi->close(NotesEditorInterface::CloseWithSave, iAgendaUtil);
-	return err;
-    }
-void CCreatorNotepadWrapper::DeleteAllL()
-	{
-	
-	QList<AgendaEntry> ael;
-    AgendaUtil::FilterFlags filter = AgendaUtil::FilterFlags(AgendaUtil::IncludeNotes);
-
-    ael = iAgendaUtil->fetchAllEntries(filter);
-    for(int i=0 ; i<ael.count() ; i++)
-    	{
-        iAgendaUtil->deleteEntry(ael[i].id());
-    	}
-		
-	}
-	
--- a/creator/engine/src/creator_phonebook.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,770 +0,0 @@
-/*
-* 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_contactsetcache.h"
-
-#include "creator_phonebook.h"
-#include "creator_traces.h"
-
-#include <bautils.h> 
-
-_LIT(KTempPath, "C:\\Data\\Creator\\");
-
-
-typedef struct {
-TInt iFieldCode;
-TInt iRandomType;
-} DetailFieldInfo;
-static const TInt RND_TYPE_UNDEF = -99;
-DetailFieldInfo CreatorPbkMiscTextFields[] = {        
-        {CCreatorPhonebookWrapper::EFirstName, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::EFirstNameReading, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::ELastName, (TInt) CCreatorEngine::ESurname},
-        {CCreatorPhonebookWrapper::ELastNameReading, (TInt) CCreatorEngine::ESurname},
-        {CCreatorPhonebookWrapper::ECompanyName, (TInt) CCreatorEngine::ECompany},
-        {CCreatorPhonebookWrapper::EJobTitle, (TInt) CCreatorEngine::EJobTitle},
-        {CCreatorPhonebookWrapper::EPrefix, (TInt) CCreatorEngine::EPrefix},
-        {CCreatorPhonebookWrapper::ESuffix, (TInt) CCreatorEngine::ESuffix},
-        {CCreatorPhonebookWrapper::ESecondName, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::EAddrLabelGen, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrPoGen, (TInt) CCreatorEngine::EPobox},
-        {CCreatorPhonebookWrapper::EAddrExtGen, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrStreetGen, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrLocalGen, (TInt) CCreatorEngine::ECity},
-        {CCreatorPhonebookWrapper::EAddrRegionGen, (TInt) CCreatorEngine::EState},
-        {CCreatorPhonebookWrapper::EAddrPostCodeGen, (TInt) CCreatorEngine::EPostcode},
-        {CCreatorPhonebookWrapper::EAddrCountryGen, (TInt) CCreatorEngine::ECountry},
-        {CCreatorPhonebookWrapper::EAddrLabelHome, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrPoHome, (TInt) CCreatorEngine::EPobox},
-        {CCreatorPhonebookWrapper::EAddrExtHome, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrStreetHome, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrLocalHome, (TInt) CCreatorEngine::ECity},
-        {CCreatorPhonebookWrapper::EAddrRegionHome, (TInt) CCreatorEngine::EState},
-        {CCreatorPhonebookWrapper::EAddrPostCodeHome, (TInt) CCreatorEngine::EPostcode},
-        {CCreatorPhonebookWrapper::EAddrCountryHome, (TInt) CCreatorEngine::ECountry},
-        {CCreatorPhonebookWrapper::EAddrLabelWork, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrPoWork, (TInt) CCreatorEngine::EPobox},
-        {CCreatorPhonebookWrapper::EAddrExtWork, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrStreetWork, (TInt) CCreatorEngine::EAddress},
-        {CCreatorPhonebookWrapper::EAddrLocalWork, (TInt) CCreatorEngine::ECity},
-        {CCreatorPhonebookWrapper::EAddrRegionWork, (TInt) CCreatorEngine::EState},
-        {CCreatorPhonebookWrapper::EAddrPostCodeWork, (TInt) CCreatorEngine::EPostcode},
-        {CCreatorPhonebookWrapper::EAddrCountryWork, (TInt) CCreatorEngine::ECountry},
-        {CCreatorPhonebookWrapper::EPoc, (TInt) CCreatorEngine::EPhoneNumber},
-        {CCreatorPhonebookWrapper::ESwis, (TInt) CCreatorEngine::EPhoneNumber},
-        {CCreatorPhonebookWrapper::ESip, (TInt) CCreatorEngine::EPhoneNumber},
-        {CCreatorPhonebookWrapper::EDtmfString, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::ENote,(TInt)  CCreatorEngine::EMemoText},
-        {CCreatorPhonebookWrapper::EMiddleName, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::EDepartment, (TInt) CCreatorEngine::ECompany},
-        {CCreatorPhonebookWrapper::EAsstName, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::ESpouse, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::EChildren, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::ESyncClass, RND_TYPE_UNDEF},
-        {CCreatorPhonebookWrapper::ELocPrivacy, RND_TYPE_UNDEF},
-        {CCreatorPhonebookWrapper::EGenLabel, (TInt) CCreatorEngine::EFirstName},
-        {CCreatorPhonebookWrapper::EWVAddress, (TInt) CCreatorEngine::EPhoneNumber},
-        {CCreatorPhonebookWrapper::ERingTone, RND_TYPE_UNDEF},
-        {CCreatorPhonebookWrapper::EThumbnailPic, RND_TYPE_UNDEF},
-        {CCreatorPhonebookWrapper::ECallerObjText, (TInt) CCreatorEngine::EFirstName}
-        };
-                  
-
-TInt CreatorPbkBinaryFields[] = {
-        CCreatorPhonebookWrapper::ECallerObjImg//,
-        //R_VPBK_FIELD_TYPE_THUMBNAILPATH
-        };
-
-TInt CreatorPbkDateTimeFields[] = {
-        CCreatorPhonebookWrapper::EAnniversary
-        };
-
-//----------------------------------------------------------------------------
-TInt CreatorPbkPhoneNumberFields[] =
-    {
-    CCreatorPhonebookWrapper::ELandPhoneGen,
-    CCreatorPhonebookWrapper::ELandPhoneHome,
-    CCreatorPhonebookWrapper::ELandPhoneWork,                        
-    CCreatorPhonebookWrapper::EMobilePhoneGen,
-    CCreatorPhonebookWrapper::EMobilePhoneHome,
-    CCreatorPhonebookWrapper::EMobilePhoneWork,
-    CCreatorPhonebookWrapper::EFaxNumberGen,
-    CCreatorPhonebookWrapper::EFaxNumberHome,
-    CCreatorPhonebookWrapper::EFaxNumberWork,
-    CCreatorPhonebookWrapper::EPagerNumber,           
-    CCreatorPhonebookWrapper::EVideoNumberGen,
-    CCreatorPhonebookWrapper::EVideoNumberHome,
-    CCreatorPhonebookWrapper::EVideoNumberWork,
-    CCreatorPhonebookWrapper::EVoipGen,
-    CCreatorPhonebookWrapper::EVoipHome,
-    CCreatorPhonebookWrapper::EVoipWork,
-    CCreatorPhonebookWrapper::EAsstPhone,
-    CCreatorPhonebookWrapper::ECarPhone
-    };
-
-TInt CreatorPbkUrlFields[] =
-    {
-    CCreatorPhonebookWrapper::EUrlGen,
-    CCreatorPhonebookWrapper::EUrlHome,
-    CCreatorPhonebookWrapper::EUrlWork
-    };
-
-TInt CreatorPbkEmailFields[] =
-    {
-    CCreatorPhonebookWrapper::EEmailGen,
-    CCreatorPhonebookWrapper::EEmailHome,
-    CCreatorPhonebookWrapper::EEmailWork
-    };
-
-CPhonebookParameters::CPhonebookParameters()
-    {
-    LOGSTRING("Creator: CPhonebookParameters::CVirtualPhonebookParameters");
-    iGroupName = HBufC::New(KPhonebookFieldLength);  
-    }
-
-CPhonebookParameters::~CPhonebookParameters()
-    {
-    LOGSTRING("Creator: CPhonebookParameters::~CPhonebookParameters");
-
-    delete iGroupName;   
-    for( TCreatorContactFields::iterator it = iContactFields.begin(); it != iContactFields.end(); ++it)
-        {
-        HBufC* temp =  (*it).second;
-        iContactFields.erase(it);
-        delete temp;
-        }
-    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;
-	
-	iPhonebookWrapper = CCreatorPhonebookWrapper::NewL();
-
-	SetDefaultParameters();
-    }
-	
-
-CCreatorPhonebook::~CCreatorPhonebook()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::~CCreatorPhonebook");
- 
-    if ( iContactsToDelete.Count() )
-    	{
-        TRAP_IGNORE( StoreLinksForDeleteL( iContactsToDelete, KUidDictionaryUidContacts ) );
-        }
-    if ( iContactGroupsToDelete.Count() )
-    	{
-        TRAP_IGNORE( StoreLinksForDeleteL( iContactGroupsToDelete, KUidDictionaryUidContactGroups ) );
-        }
-    
-	if( iPhonebookWrapper )
-		{
-		delete iPhonebookWrapper;
-		}
-    
-    if (iParameters)
-    	{
-        delete iParameters;
-    	}
-  
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorPhonebook::CreateContactEntryL(CCreatorModuleBaseParameters *aParameters)
-    {
-	TInt err = KErrNone;
-	delete iParameters;
-	    iParameters = 0;
-	CPhonebookParameters* parameters = 0;
-	
-	if( aParameters == 0 )
-	    {
-	    InitializeContactParamsL();
-	    parameters = iParameters;
-	    }
-	else
-	    {
-	    parameters = (CPhonebookParameters*) aParameters;
-	    }
-	    
-	int numberOfFields = parameters->iContactFields.size();
-	// create a new contact item
-	
-	TUint32 contactId = iPhonebookWrapper->CreateContactEntryL( parameters->iContactFields ); //wrapper should return contact id to store
-	iContactsToDelete.Append( contactId );
-	
-
-	// 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() )
-	                {
-	                if( contactId )
-	                    {
-	                    contactsets[i]->AppendL( contactId );
-	                    iContactLinkArray.AppendL( contactId );
-	                    }
-	                setFound = ETrue;
-	                break;
-	                }
-	            }
-	        if( !setFound )
-	            {
-	            LOGSTRING2("Error: Contact set id %d not found.", parameters->ScriptLinkId());
-	            }
-	        }
-	    
-    return err;
-    }
-
-
-//----------------------------------------------------------------------------
-
-
-
-//----------------------------------------------------------------------------
-
-void CCreatorPhonebook::DeleteAllL()
-    {
-	iPhonebookWrapper->DeleteAllL();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteAllCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllCreatedByCreatorL");
-    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContacts );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteAllGroupsL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllGroupsL");
-    iPhonebookWrapper->DeleteAllGroupsL();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteAllGroupsCreatedByCreatorL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::DeleteAllGroupsCreatedByCreatorL");
-    DeleteItemsCreatedWithCreatorL( KUidDictionaryUidContactGroups );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DeleteContactsL( RArray<TUint32>& aContactsToDelete, TUid aStoreUid	)
-    {
-	iPhonebookWrapper->DeleteContactsL( aContactsToDelete, aStoreUid );
-    }
-
-//----------------------------------------------------------------------------
-
-
-void CCreatorPhonebook::DeleteItemsCreatedWithCreatorL( TUid aStoreUid )
-    {
-	CDictionaryFileStore* store = iEngine->FileStoreLC();
-    User::LeaveIfNull( store );
-    
-    RArray<TUint32> 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();
-               contacts.AppendL( creatorLink );
-           }while( creatorLink );
-       );
-       
-       CleanupStack::PopAndDestroy(); // in
-       }
-    
-    
-    iPhonebookWrapper->DeleteContactsL( contacts, aStoreUid );
-    
-    store->Remove( aStoreUid );
-    store->CommitL();
-    
-    CleanupStack::PopAndDestroy( store );
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebook::DoDeleteItemsCreatedWithCreatorL( TUid /*aStoreUid*/, CDictionaryFileStore* /*aStore*/ )
-    {
-    
-    }
-
-//----------------------------------------------------------------------------
-TBool CCreatorPhonebook::HasOtherThanGroupsL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::HasOtherThanGroupsL");
-    TBool result( EFalse );
-    return result;
-    }
-
-
-//----------------------------------------------------------------------------
-
-
-//----------------------------------------------------------------------------
-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] );
-           }
-       
-       // write new links
-       for(int i=0; i < aLinks.Count(); i++)
-    	   {
-		   out.WriteUint32L( aLinks[i] );
-    	   }
-       out.CommitL();
-       CleanupStack::PopAndDestroy(); // out
-       
-       store->CommitL();
-
-       CleanupStack::PopAndDestroy( store );
-    }
-
-//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
-
-void CCreatorPhonebook::InitializeContactParamsL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::InitializeContactParamsL");        
- 
-    iParameters = new (ELeave) CPhonebookParameters;
-           
-    iParameters->iNumberOfPhoneNumberFields = iNumberOfPhoneNumberFields;
-    iParameters->iNumberOfURLFields = iNumberOfURLFields;
-    iParameters->iNumberOfEmailAddressFields = iNumberOfEmailAddressFields;       
-    
-    TPtrC fname = iEngine->RandomString(CCreatorEngine::EFirstName);
-    TPtrC lname = iEngine->RandomString(CCreatorEngine::ESurname);
-    
-    
-    if( iAddAllFields )
-        {
-		TInt textFieldCount = sizeof(CreatorPbkMiscTextFields) / sizeof(DetailFieldInfo);
-		for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
-			{ 
-			CCreatorContactField* field = CCreatorContactField::NewL();
-			CleanupStack::PushL(field);
-	        field->AddFieldToParamL( iEngine,iParameters, CreatorPbkMiscTextFields[tfIndex].iFieldCode, CreatorPbkMiscTextFields[tfIndex].iRandomType );
-  	        CleanupStack::Pop(field);
-            }
-		
-		// Add binary fields:
-		
-		RFs& fs = CCoeEnv::Static()->FsSession();
-		      
-        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());
-		TPtrC picture;
-		picture.Set(destPath);
-		CCreatorContactField* picturefield = CCreatorContactField::NewL();
-		CleanupStack::PushL(picturefield);
-		picturefield->AddFieldToParamL( iParameters, CCreatorPhonebookWrapper::EThumbnailPic, picture );
-		CleanupStack::Pop(picturefield);
-		// Add date-time fields:
-		TPtrC anniv;
-		TBuf<20> timeString;
-		TTime datetime = iEngine->RandomDate( CCreatorEngine::EDateFuture );
-		_LIT(KDateString,"%D%M%Y%/0%1%/1%2%/2%3%/3");
-		TRAP_IGNORE( datetime.FormatL(timeString, KDateString) );
-		
-		anniv.Set(timeString);
- 
-		CCreatorContactField* fieldAnniv = CCreatorContactField::NewL();
-		CleanupStack::PushL( fieldAnniv );
-		fieldAnniv->AddFieldToParamL(iParameters,CCreatorPhonebookWrapper::EAnniversary, anniv );
-		CleanupStack::Pop( fieldAnniv );
-    //***************************************************************************
-    
-        }
-    else
-        {
-		CCreatorContactField* field = CCreatorContactField::NewL();
-    	CleanupStack::PushL(field);
-    	field->AddFieldToParamL( iParameters, CCreatorPhonebookWrapper::EFirstName, fname );
-		field->AddFieldToParamL( iParameters, CCreatorPhonebookWrapper::ELastName, lname );
-		CleanupStack::Pop(field);
-        }
-                        
-      // Phone numbers:
-    TInt phoneFieldCount = sizeof(CreatorPbkPhoneNumberFields) / sizeof(TInt);
-    
-    TInt inc=0;
-    for( TInt i=0; i<iNumberOfPhoneNumberFields; i++ )
-    	{
-    
-		if(inc >= phoneFieldCount )
-        	{
-    		inc = 0;
-        	}
-		
-		CCreatorContactField* field = CCreatorContactField::NewL();
-        CleanupStack::PushL(field);
-		field->AddFieldToParamL(iEngine, iParameters, CreatorPbkPhoneNumberFields[inc] );
-		CleanupStack::Pop(field);
-    
-		inc++;
-    	}
-    
-    
-    
-    // URLs:
-    TInt urlFieldCount = sizeof(CreatorPbkUrlFields) / sizeof(TInt);
-    inc = 0;
-    for( TInt i=0; i<iNumberOfURLFields; i++ )
-        {
-    
-		if(inc >= urlFieldCount )
-          	{
-        	inc = 0;
-           	}
-    
-		CCreatorContactField* field = CCreatorContactField::NewL();
-        CleanupStack::PushL(field);
-    	field->AddFieldToParamL(iEngine, iParameters, CreatorPbkUrlFields[inc] );
-    	CleanupStack::Pop(field);
-    	inc++;
-        }
-
-    // EMail addresses:
-    TInt emailFieldCount = sizeof(CreatorPbkEmailFields) / sizeof(TInt);
-    inc = 0;
-    for( int i=0; i<iNumberOfEmailAddressFields; i++ )
-    	{
-		if(inc >= emailFieldCount )
-           	{
-          	inc = 0;
-           	}
-        CCreatorContactField* field = CCreatorContactField::NewL();
-        CleanupStack::PushL(field);
-        field->AddFieldToParamL(iEngine, iParameters, CreatorPbkEmailFields[inc] );
-        CleanupStack::Pop(field);
-        inc++;
-    	}
-    
-    TestPrintOut(iParameters);
-    
-   }
-
-void CCreatorPhonebook::TestPrintOut(CPhonebookParameters* aParam)
-	{
-	LOGSTRING("Creator: CCreatorPhonebook::TestPrintOut");
-	for( TCreatorContactFields::iterator it = aParam->iContactFields.begin(); it != aParam->iContactFields.end(); ++it)
-        {
-        HBufC* temp = (*it).second;
-        if(temp)
-        	{
-			LOGSTRING3("Type: %d Content:%S ", (*it).first, &temp->Des() );
-        	}
-        }
-    }
-
-// Checks if the link is a group or not
-TBool CCreatorPhonebook::IsContactGroupL( TUint32& aLink )
-	{
-	//not used right now
-	return EFalse;
-	}
-
-
-TInt CCreatorPhonebook::CreateGroupEntryL(CCreatorModuleBaseParameters *aParameters)
-    {
-	 LOGSTRING("Creator: CCreatorPhonebook::CreateGroupEntryL");
-	 TInt err = KErrNone;
-	 
-	    delete iParameters;
-	    iParameters = 0;
-	    
-	    CPhonebookParameters* parameters = (CPhonebookParameters*) aParameters;
-	    
-	    if( !parameters )
-	       {
-	       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) );
-	       parameters = iParameters;
-	       }
-	   
-	    // create a new contact group
-	    
-	    TUint32 newGroupId = iPhonebookWrapper->CreateGroupEntryL( parameters->iGroupName );
-	    
-	    // 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 RArray<TUint32> links = set.ContactLinks();//ContactLinkCache::Instance()->ContactSets();//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 )
-	                {
-					
-					addedMembers += iPhonebookWrapper->AddContactToGroup(newGroupId,links[j]);
-	           
-	                }
-	            if( addedMembers < maxAmount )
-	            	{
-	            	// Add existing contacts, withing the limits set by maxAmount:
-	            	amountOfContactsToBeAdded += maxAmount - addedMembers;
-	            	}
-	            }
-	        }
-	    if( amountOfContactsToBeAdded > 0 )
-	        {
-			TInt addedContacts = iPhonebookWrapper->AddToGroup(newGroupId, amountOfContactsToBeAdded);
-		
-	        }
-	    
-	    // 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( newGroupId );
-	    
-	    return err;
-    }
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorPhonebook::CreateSubscribedContactEntryL(CCreatorModuleBaseParameters* /*aParameters*/)
-    {
-    LOGSTRING("Creator: CCreatorPhonebook::CreateSubscribedContactEntryL");
-
-    return KErrNotSupported;
-    }
-
-//----------------------------------------------------------------------------
-
-CCreatorContactField::CCreatorContactField()
-    {
-    }
-CCreatorContactField::~CCreatorContactField()
-    {
-    }
-
-CCreatorContactField* CCreatorContactField::NewL()
-    {
-    CCreatorContactField* self = new (ELeave) CCreatorContactField();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-    return self;
-    }
-void CCreatorContactField::ConstructL()
-    {
-    }
-
-
-void CCreatorContactField::AddFieldToParamL( CCreatorEngine* aEngine, CPhonebookParameters* aParam, TInt aType, TInt aRand )
-    {
-    HBufC* content = NULL;
-    if( aRand == KErrNotFound ) 
-        {
-        TInt textFieldCount = sizeof(CreatorPbkPhoneNumberFields)/sizeof(TInt);;
-        for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
-            {
-            if( CreatorPbkPhoneNumberFields[tfIndex] == aType )
-                {
-                content = aEngine->RandomString(CCreatorEngine::EPhoneNumber).AllocL();
-                break;
-                }
-            }
-    
-        textFieldCount = sizeof(CreatorPbkUrlFields)/sizeof(TInt);;
-        for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
-            {
-            if( CreatorPbkUrlFields[tfIndex] == aType )
-                {
-                content = aEngine->CreateHTTPUrlLC(); 
-                CleanupStack::Pop();
-                break;
-                }
-            }
-        textFieldCount = sizeof(CreatorPbkEmailFields)/sizeof(TInt);;
-        for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
-            {
-            if( CreatorPbkEmailFields[tfIndex] == aType )
-                {
-                content = aEngine->CreateEmailAddressLC();
-                CleanupStack::Pop();
-                break;
-                }
-            }
-        
-    
-        //if there is textfield without specified random number
-        textFieldCount = sizeof(CreatorPbkMiscTextFields) / sizeof(DetailFieldInfo);
-        for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
-            {
-			if( CreatorPbkMiscTextFields[tfIndex].iFieldCode == aType && CreatorPbkMiscTextFields[tfIndex].iRandomType != RND_TYPE_UNDEF )
-            	{
-				TInt rand =  CreatorPbkMiscTextFields[tfIndex].iRandomType;
-				content = aEngine->RandomString((CCreatorEngine::TRandomStringType) rand).AllocL();
-				break;
-				}
-			}	
-        }
-
-    if( aRand != KErrNotFound && aRand != RND_TYPE_UNDEF ) 
-        {
-        TInt textFieldCount = sizeof(CreatorPbkMiscTextFields) / sizeof(DetailFieldInfo);
-        for( TInt tfIndex = 0; tfIndex < textFieldCount; ++tfIndex )
-            {
-            if( CreatorPbkMiscTextFields[tfIndex].iFieldCode == aType )
-                {
-                content = aEngine->RandomString((CCreatorEngine::TRandomStringType) aRand).AllocL();
-                }
-            }
-        }
-	
-	aParam->iContactFields.insert( TCreatorContactField(aType, content) );
-	}
-
-void CCreatorContactField::AddFieldToParamL( CPhonebookParameters* aParam, TInt aType, TPtrC aContent )
-    {
-    aParam->iContactFields.insert( TCreatorContactField(aType, aContent.AllocL()) );
-    }
-
-//----------------------------------------------------------------------------
-
-//----------------------------------------------------------------------------
-
--- a/creator/engine/src/creator_phonebookapi.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,161 +0,0 @@
-/*
-* 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_phonebookapi.h"
-
-CCreatorPhonebookAPI::CCreatorPhonebookAPI ()
-    {
-    mContactMngr = new QContactManager("symbian");
-    }
-
-CCreatorPhonebookAPI::~CCreatorPhonebookAPI ()
-    {
-    if( mContactMngr )
-        {
-        delete mContactMngr;
-        mContactMngr = NULL;
-        }
-    }
-
-quint32 CCreatorPhonebookAPI::saveContact( const QList<QContactDetail>& list )
-    {
-    // create a new contact item
-    QContact store;
-    quint32 id;
-    bool success = false;
-    for(int i = 0 ; i < list.count() ; i++ )
-    	{
-		QContactDetail cntdetail = list.at(i);
-		success = store.saveDetail(&cntdetail);
-    	}
-    /*foreach( QContactDetail cntdetail, list )
-        {
-        success = store.saveDetail( &cntdetail );
-        }
-    */
-    success = mContactMngr->saveContact( &store );
-    id = store.localId();
-    return id;
-    }
-
-quint32 CCreatorPhonebookAPI::createGroup( const QString& groupName )
-	{
-	QContact newGroup;
-	newGroup.setType(QContactType::TypeGroup);
-	QContactName newGroupName;
-	newGroupName.setCustomLabel( groupName );
-	newGroup.saveDetail(&newGroupName);
-	mContactMngr->saveContact(&newGroup);
-	return newGroup.localId();
-	}
-
-int CCreatorPhonebookAPI::numberOfContacts()
-	{
-	QList<QContactLocalId> contacts = mContactMngr->contactIds();
-	return contacts.count();
-	
-	}
-
-bool CCreatorPhonebookAPI::IsContactGroupL( const QContact& contact )
-	{
-	 
-	if( contact.type() == QContactType::TypeGroup )
-		{
-		return true;
-		}
-	return false;
-	}
-
-int CCreatorPhonebookAPI::addContactToGroup( QContactLocalId group, QContactLocalId contact )
-	{
-	QContact newGroup = mContactMngr->contact( group );
-	QContact contactLink = mContactMngr->contact( contact );
-	int ret = 0;
-	if( contact && IsContactGroupL( contactLink ) == false )
-	    {
-        QList<QContactRelationship> relationships = contactLink.relationships(QContactRelationship::HasMember);
-        if( !relationships.count() && contactLink.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( contactLink.id() );
-			mContactMngr->saveRelationship( contactRel );
-			delete contactRel;
-			ret++;
-			}         
-		}
-	return ret;
-	}
-int CCreatorPhonebookAPI::addToGroup(QContactLocalId group, int amount)
-	{
-	QList<QContactLocalId> contacts = mContactMngr->contactIds();
-	int ret = 0;		
-	int tmp = 0;
-	int cnt = 0;
-	
-	for( int i=0; cnt < amount && i < contacts.count() ; i++ )
-		{
-		QContact contact = mContactMngr->contact( mContactMngr->contactIds().at(i) );
-		if( contact.type() == QContactType::TypeContact )
-			{
-			tmp = addContactToGroup(group,mContactMngr->contactIds().at(i)); 
-			ret += tmp;
-			if(tmp)
-				{
-				cnt++;
-				tmp = 0;
-				}
-			}
-		}
-	return ret;
-	}
-
-
-bool CCreatorPhonebookAPI::deleteAllContacts()
-    {
-    QList<QContactLocalId> all = mContactMngr->contactIds();
-    return deleteContacts( all );
-    }
-
-bool CCreatorPhonebookAPI::deleteAllContacts( const QString& type )
-    {
-    QList<QContactLocalId> contactsToDelete;
-    QList<QContactLocalId> contacts = mContactMngr->contactIds();
-    foreach(QContactLocalId contactId, contacts)
-        {
-        QContact contact = mContactMngr->contact( contactId );
-        if( contact.type() == type )
-            {
-            contactsToDelete.append( contact.localId() );
-            }
-        }
-    return deleteContacts( contactsToDelete );
-    }
-
-
-bool CCreatorPhonebookAPI::deleteContacts( const QList<QContactLocalId>& list )
-    {
-    QMap<int, QContactManager::Error> errorMap;
-    return mContactMngr->removeContacts( list, &errorMap );
-    }
-
-QContact CCreatorPhonebookAPI::contact( const QContactLocalId& contactId )
-    {
-    return mContactMngr->contact( contactId );
-    }
-// End of File
--- a/creator/engine/src/creator_phonebookbase.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
-* 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"
-
-void CCreatorPhonebookBase::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
-    {
-    LOGSTRING("Creator: CCreatorPhonebookBase::QueryDialogClosedL");
-    
-    if(aPositiveAction == EFalse && aUserData!=ECreatorPhonebookGetContactFields )
-        {
-        iEngine->ShutDownEnginesL();
-        return;
-        }
-    
-    const TDesC* showText = &KSavingText;
-    TBool finished(EFalse);
-    TBool retval(ETrue);
-    switch(aUserData)
-        {
-        case ECreatorPhonebookDelete:
-            showText = &KDeletingText;
-            finished = ETrue;
-            iEntriesToBeCreated = 1;
-            break;
-        case ECreatorPhonebookStart:
-        	if(iCommand == ECmdCreatePhoneBookEntryContacts )
-        		{
-				retval = iEngine->GetEngineWrapper()->ListQueryDialog(_L("Fields in contact"), R_CONTACT_CREATION_TYPE_QUERY, 
-        	                &iDummy, this, ECreatorPhonebookGetContactFields );
-        		}
-        	else
-        		{
-				retval = iEngine->GetEngineWrapper()->ListQueryDialog(_L("Number of contacts "), R_GROUP_CREATION_TYPE_QUERY, 
-        	       	                &iDummy, this, ECreatorPhonebookGetGroupFields );
-        		}
-            break;
-        case ECreatorPhonebookGetContactFields:
-            if(iDummy==0)// first item, use default fields
-                    
-                {
-                iDefaultFieldsSelected = ETrue;
-                finished = ETrue;
-                }
-            else
-                {
-                retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iNumberOfPhoneNumberFields, _L("Amount of phone number fields in one contact?"), 
-                    ETrue, this, ECreatorPhonebookGetPhoneNumbersCount 
-                    );
-                }
-            break;
-        case ECreatorPhonebookGetPhoneNumbersCount:
-            retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iNumberOfURLFields, _L("Amount of URL fields in one contact?"), 
-                ETrue, this, ECreatorPhonebookGetUrlsCount 
-                );
-            break;
-        case ECreatorPhonebookGetUrlsCount:
-            retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iNumberOfEmailAddressFields, _L("Amount of email fields in one contact?"), 
-                ETrue, this, ECreatorPhonebookGetEmailsCount
-                );
-            break;
-        case ECreatorPhonebookGetEmailsCount:
-            retval = iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Add all the other fields to contacts?"), this, ECreatorPhonebookContactsAllFields);
-            break;
-        case ECreatorPhonebookContactsAllFields:
-            iAddAllFields = aPositiveAction;
-            // finaly we have all informations from user, start engine
-            finished = ETrue;
-            break;
-        case ECreatorPhonebookGetGroupFields:
-            iContactsInGroup = KCreateRandomAmountOfGroups;
-            if(iDummy==0)// first item, use default fields
-                {
-                finished = ETrue;
-                }
-            else
-                {
-                retval = iEngine->GetEngineWrapper()->EntriesQueryDialog(&iContactsInGroup, _L("Amount of contacts in one group?"), 
-                    ETrue, this, ECreatorPhonebookGetContactsInGroup);
-                }
-            break;
-        case ECreatorPhonebookGetContactsInGroup:
-            // finaly we have all informations from user, start engine
-            finished = ETrue;
-            break;
-        default:
-            //some error
-            retval = EFalse;
-            break;
-        }
-    if( retval == EFalse )
-        {
-        iEngine->ShutDownEnginesL();
-        }
-    else if( finished )
-        {
-        // add this command to command array
-        iEngine->AppendToCommandArrayL(iCommand, NULL, iEntriesToBeCreated);
-        // started exucuting commands
-        iEngine->ExecuteFirstCommandL( *showText );
-        }
-    }
-    
-TBool CCreatorPhonebookBase::AskDataFromUserL(TInt aCommand)
-    {
-    LOGSTRING("Creator: CCreatorPhonebookBase::AskDataFromUserL");
-    iCommand = aCommand;
-    
-    if( aCommand == ECmdDeleteContacts )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all contacts?"), this, ECreatorPhonebookDelete );
-        }
-    if( aCommand == ECmdDeleteCreatorContacts )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all contacts created with Creator?"), this, ECreatorPhonebookDelete ); 
-        }
-    if( aCommand == ECmdDeleteContactGroups )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all contact groups?"), this, ECreatorPhonebookDelete );
-        }
-    if( aCommand == ECmdDeleteCreatorContactGroups )
-        {
-        return iEngine->GetEngineWrapper()->YesNoQueryDialog(_L("Delete all contact groups created with Creator?"), this, ECreatorPhonebookDelete ); 
-        }    
-    // display queries
-    return iEngine->GetEngineWrapper()->EntriesQueryDialog( &iEntriesToBeCreated, _L("How many entries to create?"), EFalse, this, ECreatorPhonebookStart); // ask number of entries to create
-    }
-
-
-void CCreatorPhonebookBase::SetDefaultParameters()
-    {
-    iNumberOfPhoneNumberFields = 1;
-    iNumberOfURLFields = 0;
-    iNumberOfEmailAddressFields = 0;
-    iContactsInGroup = 50;
-    iDefaultFieldsSelected = EFalse;
-    }
--- a/creator/engine/src/creator_phonebookwrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,654 +0,0 @@
-/*
-* 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_contactsetcache.h"
-
-#include "creator_phonebookwrapper.h" 
-#include "creator_traces.h"
-
-#include <bautils.h> 
-
-_LIT(KTempPath, "C:\\Data\\Creator\\");
-
-typedef struct {
-TInt iFieldCode;
-QString iDetail;
-QString iFieldContext;
-QString iFieldString;
-} QDetailFieldInfo;
-//static const TInt RND_TYPE_UNDEF = -99;
-QDetailFieldInfo CreatorPbkTextFields[] = {        
-        { (TInt)CCreatorPhonebookWrapper::EFirstName,(QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldFirstName).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::ELastName,(QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldLastName).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::ECompanyName,(QContactOrganization::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactOrganization::FieldName).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EJobTitle,(QContactOrganization::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactOrganization::FieldTitle).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EPrefix,(QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldPrefix).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::ESuffix,(QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldSuffix).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EMiddleName,(QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactName::FieldMiddleName).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrStreetHome,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldStreet).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrLocalHome,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldLocality).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrRegionHome,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldRegion).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrPostCodeHome,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldPostcode).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrCountryHome,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactAddress::FieldCountry).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrStreetGen,(QContactAddress::DefinitionName).operator QString(), "", (QContactAddress::FieldStreet).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrLocalGen,(QContactAddress::DefinitionName).operator QString(), "", (QContactAddress::FieldLocality).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrRegionGen,(QContactAddress::DefinitionName).operator QString(), "", (QContactAddress::FieldRegion).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrPostCodeGen,(QContactAddress::DefinitionName).operator QString(), "", (QContactAddress::FieldPostcode).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrCountryGen,(QContactAddress::DefinitionName).operator QString(), "", (QContactAddress::FieldCountry).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrStreetWork,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldStreet).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrLocalWork,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldLocality).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrRegionWork,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldRegion).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrPostCodeWork,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldPostcode).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAddrCountryWork,(QContactAddress::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactAddress::FieldCountry).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EMobilePhoneWork,(QContactPhoneNumber::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactPhoneNumber::SubTypeMobile).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::ELandPhoneWork,(QContactPhoneNumber::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactPhoneNumber::SubTypeLandline).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::ENote,(QContactNote::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactNote::FieldNote).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EDepartment,(QContactOrganization::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactOrganization::FieldDepartment).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EAsstName,(QContactOrganization::DefinitionName).operator QString(), (QContactDetail::ContextWork).operator QString(), (QContactOrganization::FieldAssistantName).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::ESpouse,(QContactFamily::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactFamily::FieldSpouse).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EChildren,(QContactFamily::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(), (QContactFamily::FieldChildren).operator QString()},
-        { (TInt)CCreatorPhonebookWrapper::EGenLabel,(QContactName::DefinitionName).operator QString(), (QContactDetail::ContextHome).operator QString(),  (QContactName::FieldCustomLabel).operator QString()}
-        };
-                  
-
-typedef struct{
-TInt iFieldCode;
-QString iFieldContext;
-QString iFieldString;
-}PhoneNumInfo;
-PhoneNumInfo CreatorPhoneNumberFields[] =
-    {
-    { CCreatorPhonebookWrapper::ELandPhoneGen,"", "Landline"},
-    { CCreatorPhonebookWrapper::ELandPhoneHome,"Home", "Landline"},
-    { CCreatorPhonebookWrapper::ELandPhoneWork,"Work", "Landline"},                        
-    { CCreatorPhonebookWrapper::EMobilePhoneGen,"","Mobile"},
-    { CCreatorPhonebookWrapper::EMobilePhoneHome,"Home","Mobile"},
-    { CCreatorPhonebookWrapper::EMobilePhoneWork,"Work", "Mobile"},
-    { CCreatorPhonebookWrapper::EFaxNumberGen, "", "Facsimile"},
-    { CCreatorPhonebookWrapper::EFaxNumberHome, "Home", "Facsimile"},
-    { CCreatorPhonebookWrapper::EFaxNumberWork, "Work", "Facsimile"},
-    { CCreatorPhonebookWrapper::EPagerNumber, "Work", "Pager"},
-    { CCreatorPhonebookWrapper::EVideoNumberGen, "", "Video"},
-    { CCreatorPhonebookWrapper::EVideoNumberHome, "Home", "Video"},
-    { CCreatorPhonebookWrapper::EVideoNumberWork, "Work", "Video"},   //{ "Home", "Voice" },//{ "Work", "Voice" },
-    { CCreatorPhonebookWrapper::EAsstPhone, "Work", "Assistant" },
-    { CCreatorPhonebookWrapper::ECarPhone, "Home",  "Car" }
-    };
-
-
-typedef struct{
-	TInt iFieldCode;
-	QString iFieldContext;
-}EmailInfo;
-EmailInfo CreatorEmailFields[] =
-	{
-    {CCreatorPhonebookWrapper::EEmailGen,""},
-    {CCreatorPhonebookWrapper::EEmailHome,(QContactDetail::ContextHome).operator QString()},
-    {CCreatorPhonebookWrapper::EEmailWork,(QContactDetail::ContextWork).operator QString()}
-    };
-
-typedef struct{
-	TInt iFieldCode;
-	QString iFieldContext;
-}UrlInfo;
-UrlInfo CreatorUrlFields[] =
-    {
-    {CCreatorPhonebookWrapper::EUrlGen,""},
-    {CCreatorPhonebookWrapper::EUrlHome,(QContactDetail::ContextHome).operator QString()},
-    {CCreatorPhonebookWrapper::EUrlWork,(QContactDetail::ContextWork).operator QString()}
-    };
-
-CCreatorPhonebookWrapper* CCreatorPhonebookWrapper::NewL()
-    {
-    CCreatorPhonebookWrapper* self = CCreatorPhonebookWrapper::NewLC();
-    CleanupStack::Pop(self);
-    return self;
-    }
-
-CCreatorPhonebookWrapper* CCreatorPhonebookWrapper::NewLC()
-    {
-    CCreatorPhonebookWrapper* self = new (ELeave) CCreatorPhonebookWrapper();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-    }
-
-
-CCreatorPhonebookWrapper::CCreatorPhonebookWrapper() 
-    {
-    }
-
-void CCreatorPhonebookWrapper::ConstructL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebookWrapper::ConstructL");
-
-    QT_TRYCATCH_LEAVING( iPhonebookAPI = new CCreatorPhonebookAPI() );
-	
-	}
-	
-
-CCreatorPhonebookWrapper::~CCreatorPhonebookWrapper()
-    {
-    LOGSTRING("Creator: CCreatorPhonebookWrapper::~CCreatorPhonebookWrapper");
-	if( iPhonebookAPI )
-        {
-        delete iPhonebookAPI;
-        iPhonebookAPI = NULL;
-        }
-    }
-
-//----------------------------------------------------------------------------
-
-QList<QContactDetail> CCreatorPhonebookWrapper::CreateContactDetailsFromParameters( const TCreatorContactFields& aFields )
-	{
-	QList<QContactDetail> contDetList;
-	QString content;
-	HBufC* temp;
-	TInt arraySize = sizeof(CreatorPbkTextFields)/sizeof(QDetailFieldInfo);
-	for (TInt i = 0; i < arraySize; i++)
-		{
-	    TCreatorContactFields::const_iterator it = aFields.find(CreatorPbkTextFields[i].iFieldCode);
-		if( it != aFields.end() )
-			{
-		    temp = (*it).second;
-			content = QString::fromUtf16( temp->Des().Ptr(), temp->Length() );
-			QContactDetail contactDetail =  CreateContactDetail(contDetList, CreatorPbkTextFields[i].iDetail,CreatorPbkTextFields[i].iFieldContext,CreatorPbkTextFields[i].iFieldString, content );
-			AddFieldToList( contDetList, contactDetail );
-			}
-		
-		}
-	arraySize = sizeof(CreatorPhoneNumberFields)/sizeof(PhoneNumInfo);
-		for (TInt i = 0; i < arraySize; i++)
-			{
-			TCreatorContactFields::const_iterator it = aFields.find(CreatorPhoneNumberFields[i].iFieldCode);
-			if( it != aFields.end() )
-				{
-			    temp = (*it).second;
-				content = QString::fromUtf16( temp->Des().Ptr(), temp->Length() );
-				QContactDetail contactDetail =  CreateContactDetail(contDetList, QContactPhoneNumber::DefinitionName ,CreatorPhoneNumberFields[i].iFieldContext,CreatorPhoneNumberFields[i].iFieldString, content );
-				AddFieldToList( contDetList, contactDetail );
-				}
-			}
-		
-	arraySize = sizeof(CreatorEmailFields)/sizeof(EmailInfo);
-		for (TInt i = 0; i < arraySize; i++)
-			{
-			TCreatorContactFields::const_iterator it = aFields.find(CreatorEmailFields[i].iFieldCode);
-			if( it != aFields.end() )
-				{
-			    temp = (*it).second;
-				content = QString::fromUtf16( temp->Des().Ptr(), temp->Length() );
-				QContactDetail contactDetail =  CreateContactDetail(contDetList, QContactEmailAddress::DefinitionName ,CreatorEmailFields[i].iFieldContext,"", content );
-				AddFieldToList( contDetList, contactDetail );
-				}
-			}
-		
-	arraySize = sizeof(CreatorUrlFields)/sizeof(UrlInfo);
-			for (TInt i = 0; i < arraySize; i++)
-				{
-				TCreatorContactFields::const_iterator it = aFields.find(CreatorUrlFields[i].iFieldCode);
-				if( it != aFields.end() )
-					{
-				    temp = (*it).second;
-					content = QString::fromUtf16( temp->Des().Ptr(), temp->Length() );
-					QContactDetail contactDetail =  CreateContactDetail(contDetList, QContactUrl::DefinitionName ,CreatorUrlFields[i].iFieldContext,"", content );
-					AddFieldToList( contDetList, contactDetail );
-					}
-				}	
-	arraySize = sizeof(CreatorUrlFields)/sizeof(UrlInfo);
-			for (TInt i = 0; i < arraySize; i++)
-				{
-				TCreatorContactFields::const_iterator it = aFields.find(CreatorUrlFields[i].iFieldCode);
-				if( it != aFields.end() )
-					{
-					temp = (*it).second;
-					content = QString::fromUtf16( temp->Des().Ptr(), temp->Length() );
-					QContactDetail contactDetail =  CreateContactDetail(contDetList, QContactUrl::DefinitionName ,CreatorUrlFields[i].iFieldContext,"", content );
-					AddFieldToList( contDetList, contactDetail );
-					}
-				}
-			
-			TCreatorContactFields::const_iterator it = aFields.find(CCreatorPhonebookWrapper::EThumbnailPic);
-			if( it != aFields.end() )
-				{
-				temp = (*it).second;
-				if(temp)
-					{
-					content = QString::fromUtf16( temp->Des().Ptr(), temp->Length() );
-					QContactDetail contactDetail =  CreateContactDetail(contDetList, QContactAvatar::DefinitionName ,"","", content );
-					AddFieldToList( contDetList, contactDetail );
-					}
-				}
-			it = aFields.find(CCreatorPhonebookWrapper::EAnniversary);
-				if( it != aFields.end() )
-					{
-					temp = (*it).second;
-					if(temp)
-						{
-						content = QString::fromUtf16( temp->Des().Ptr(), temp->Length() );
-						QContactDetail contactDetail =  CreateContactDetail(contDetList, QContactAnniversary::DefinitionName ,"","", content );
-						AddFieldToList( contDetList, contactDetail );
-						}
-					}
-		
-	return contDetList;
-	}
-QContactDetail CCreatorPhonebookWrapper::CreateContactDetail( QList<QContactDetail>& aContactDetailList,QString aDetail, QString aFieldContext, QString aFieldString, QString aData )
-    {
-    QContactDetail contactDetail;
-        
-        if( aDetail == QContactPhoneNumber::DefinitionName)
-            {
-            QContactPhoneNumber phoneNumber;// = contactDetail;
-            if(!aFieldContext.isEmpty())
-            	{
-				phoneNumber.setContexts(aFieldContext);
-            	}
-            phoneNumber.setSubTypes(aFieldString);
-            //QString number = QString::fromUtf16(aData.Ptr(),aData.Length());
-            phoneNumber.setNumber(aData);
-            return phoneNumber;
-            }
-        else if( aDetail == QContactName::DefinitionName )          //--Contact NAME-----------------------------
-            {
-            QContactName contactName;
-            for(int i = 0 ; i < aContactDetailList.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
-                {
-                if(aContactDetailList.at(i).definitionName() == QContactName::DefinitionName )
-                    {
-                    contactName = aContactDetailList.at(i);
-                    }
-                }
-            //QString name = QString::fromUtf16(aData.Ptr(),aData.Length());
-            if(aFieldString == QContactName::FieldFirstName)
-                {
-                if(contactName.firstName().isEmpty())
-                    {
-                    contactName.setFirstName( aData );
-                    }
-                }
-            else if(aFieldString == QContactName::FieldLastName)
-                {
-                if(contactName.lastName().isEmpty())
-                    {
-                    contactName.setLastName( aData );
-                    }
-                }
-            else if(aFieldString == QContactName::FieldMiddleName)
-                {
-                if(contactName.middleName().isEmpty())
-                    {
-                    contactName.setMiddleName( aData );
-                    }
-                }
-            else if(aFieldString == QContactName::FieldPrefix)
-                {
-                if(contactName.prefix().isEmpty())
-                    {
-                    contactName.setPrefix( aData );
-                    }
-                }
-            else if(aFieldString == QContactName::FieldSuffix)
-                {
-                if(contactName.suffix().isEmpty())
-                    {
-                    contactName.setSuffix( aData );
-                    }
-                }
-            else        //QContactName::FieldCustomLabel:
-                {
-                if(contactName.customLabel().isEmpty())
-                    {
-                    contactName.setCustomLabel( aData );
-                    }
-                }
-            return contactName;
-            }
-        else if( aDetail == QContactOrganization::DefinitionName )          //--Contact Company-----------------------------
-            {
-            QContactOrganization contactCompany;
-            
-            for(int i = 0 ; i < aContactDetailList.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
-                {
-                if(aContactDetailList.at(i).definitionName() == QContactOrganization::DefinitionName )
-                    {
-                    contactCompany = aContactDetailList.at(i);
-                    }
-                }
-            
-            //QString company = QString::fromUtf16(aData.Ptr(),aData.Length());
-            if(aFieldString == QContactOrganization::FieldName)
-                {
-                if(contactCompany.name().isEmpty())
-                    {
-                    contactCompany.setName( aData );
-                    }
-                }
-            if(aFieldString == QContactOrganization::FieldTitle)
-                {
-                if(contactCompany.title().isEmpty())
-                    {
-                    contactCompany.setTitle( aData );
-                    }
-                }
-            if(aFieldString == QContactOrganization::FieldDepartment)
-                {
-                QStringList depList = contactCompany.department();
-                depList.append(aData);
-                contactCompany.setDepartment(depList);
-                }
-            if(aFieldString == QContactOrganization::FieldAssistantName)
-                {
-                if(contactCompany.assistantName().isEmpty())
-                    {
-                    contactCompany.setAssistantName( aData );
-                    }
-                }
-            return contactCompany;
-            }
-        else if( aDetail == QContactAddress::DefinitionName )           //--Contact Address-----------------------------
-                {
-                QContactAddress contactAddress;
-                
-                for(int i = 0 ; i < aContactDetailList.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
-                    {
-                    if(aContactDetailList.at(i).definitionName() == QContactAddress::DefinitionName && aContactDetailList.at(i).value(QContactDetail::FieldContext) == aFieldContext )
-                        {
-                        contactAddress = aContactDetailList.at(i);
-                        }
-                    }
-                if( !aFieldContext.isEmpty() )
-                    {
-					contactAddress.setContexts( aFieldContext );
-                    }
-                //QString address = QString::fromUtf16(aData.Ptr(),aData.Length());
-                if(aFieldString == QContactAddress::FieldStreet )
-                    {
-                    if( contactAddress.street().isEmpty() )
-                        {
-                        contactAddress.setStreet( aData );
-                        }
-                    }
-                else if(aFieldString == QContactAddress::FieldLocality )
-                    {
-                    if( contactAddress.locality().isEmpty() )
-                        {
-                        contactAddress.setLocality( aData );
-                        }
-                    }
-                else if(aFieldString == QContactAddress::FieldRegion )
-                    {
-                    if( contactAddress.region().isEmpty() )
-                        {
-                        contactAddress.setRegion( aData );
-                        }
-                    }
-                else if(aFieldString == QContactAddress::FieldPostcode )
-                    {
-                    if( contactAddress.postcode().isEmpty() )
-                        {
-                        contactAddress.setPostcode( aData );
-                        }
-                    }
-                else if(aFieldString == QContactAddress::FieldCountry )
-                    {
-                    if( contactAddress.country().isEmpty() )
-                        {
-                        contactAddress.setCountry( aData );
-                        }
-                    }
-                else 
-                    {
-                    return contactDetail;
-                    }
-                return contactAddress;
-                }
-        else if( aDetail == QContactNote::DefinitionName )          //--Contact Note-----------------------------
-                    {
-                    QContactNote contactNote;
-                    //QString note = QString::fromUtf16(aData.Ptr(),aData.Length());
-                    contactNote.setNote(aData);
-                    return contactNote;
-                    }
-        else if( aDetail == QContactFamily::DefinitionName )            //--Contact Family-----------------------------
-                    {
-                    QContactFamily contactFamily;
-                    
-                    for(int i = 0 ; i < aContactDetailList.count() ; i++ ) //go through all contact details to check if there is already Contact Name to set other details
-                        {
-                        if(aContactDetailList.at(i).definitionName() == QContactFamily::DefinitionName && aContactDetailList.at(i).value(QContactDetail::FieldContext) == aFieldContext )
-                            {
-                            contactFamily = aContactDetailList.at(i);
-                            }
-                        }
-                   
-                    //QString familyData = QString::fromUtf16(aData.Ptr(),aData.Length());
-                    if(aFieldString == QContactFamily::FieldSpouse )
-                        {
-                        if( contactFamily.spouse().isEmpty() )
-                            {
-                            contactFamily.setSpouse( aData );
-                            }
-                        }
-                    if(aFieldString == QContactFamily::FieldChildren )
-                        {
-                            QStringList children = contactFamily.children();
-                            children.append( aData );
-                            contactFamily.setChildren( children );
-                        }
-                    
-                    return contactFamily;
-                    }
-        
-        if( aDetail == QContactAvatar::DefinitionName)                      //--Contact Picture-----------------------------
-                {
-                QContactAvatar contactAvatar;
-                /*TBuf<KMaxFileName> srcPath;
-                aEngine->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() );
-                */
-                QUrl imageUrl;
-                imageUrl.setUrl(aData);
-                contactAvatar.setImageUrl(imageUrl);
-
-                return contactAvatar;
-                }
-        if( aDetail == QContactAnniversary::DefinitionName) //--Anniversary------------------------------
-                {
-                QContactAnniversary contactAnniversary;
-                aData.replace(QChar('/'), QChar('-'));
-       		    QDate date = QDate::fromString(aData, "dd-MM-yyyy");
-                //TTime datetime = aEngine->RandomDate( CCreatorEngine::EDateFuture );
-                //date.setDate( datetime.DateTime().Year(),(int) (datetime.DateTime().Month()+1), datetime.DateTime().Day() );
-                contactAnniversary.setOriginalDate( date );
-                return contactAnniversary;
-                }
-        if( aDetail == QContactEmailAddress::DefinitionName) //--Email------------------------------------
-            {
-            QContactEmailAddress email;
-            //QString emailAddr = QString::fromUtf16(aData.Ptr(),aData.Length());
-            if( !aFieldContext.isEmpty() )
-            	{
-				email.setContexts( aFieldContext );
-            	}
-            email.setEmailAddress( aData );
-            return email;
-            }
-        if( aDetail == QContactUrl::DefinitionName )    //--Url-------------------------------------------
-            {
-            QContactUrl url;
-            //QString urlStr = QString::fromUtf16(aData.Ptr(),aData.Length());
-            if( !aFieldContext.isEmpty() )
-                {
-				url.setContexts( aFieldContext );
-                }
-            url.setUrl(aData);
-            return url;
-            }
-        if( aDetail == QContactBirthday::DefinitionName )   //--Birthday-----------------------------------
-            {
-            QContactBirthday birthday;
-            QDate date = QDate::fromString(aData);
-            //TTime datetime = aEngine->RandomDate( CCreatorEngine::EDatePast );
-            //date.setDate( datetime.DateTime().Year(),(int) (datetime.DateTime().Month()+1), datetime.DateTime().Day() );
-            birthday.setDate( date );
-            return birthday;
-            }
-                
-        return contactDetail;
-    }
-
-void CCreatorPhonebookWrapper::AddFieldToList( QList<QContactDetail>& aDetailList, QContactDetail aDetail)
-    {
-     bool replace = false;
-     for(int i = 0 ; i< aDetailList.count() ; i++) //go through
-          {
-           if( !aDetail.isEmpty() && aDetail.definitionName() == aDetailList.at(i).definitionName() 
-        		   && aDetail.definitionName() != QContactPhoneNumber::DefinitionName 
-        		   && aDetail.definitionName() != QContactEmailAddress::DefinitionName
-        		   && aDetail.definitionName() != QContactUrl::DefinitionName )
-               {
-               QString context = aDetail.value(QContactDetail::FieldContext);
-               bool isContextEmpty = context.isEmpty();
-               if( isContextEmpty ||  ( aDetail.value(QContactDetail::FieldContext) == aDetailList.at(i).value(QContactDetail::FieldContext)) )
-                   {
-                   //replace
-                   aDetailList.replace(i,aDetail);
-                   replace = true;
-                   }
-               }
-          }
-          if(!replace)
-             {
-             if(!aDetail.isEmpty())
-                {
-                aDetailList.append(aDetail);
-                }
-             }
-      
-    }
-
-TUint32 CCreatorPhonebookWrapper::CreateContactEntryL(const TCreatorContactFields& aFields)
-    {
-	QList<QContactDetail> list = CreateContactDetailsFromParameters( aFields );
-	
-	return iPhonebookAPI->saveContact( list );
-    }
-
-
-//----------------------------------------------------------------------------
-
-
-
-//----------------------------------------------------------------------------
-
-void CCreatorPhonebookWrapper::DeleteAllL()
-    {
-	iPhonebookAPI->deleteAllContacts();
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebookWrapper::DeleteAllGroupsL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebookWrapper::DeleteAllGroupsL");
-    
-    iPhonebookAPI->deleteAllContacts( QContactType::TypeGroup );
-
-    }
-
-//----------------------------------------------------------------------------
-void CCreatorPhonebookWrapper::DeleteContactsL( RArray<TUint32>& aContactsToDelete, TUid aStoreUid )
-    {
-	QList<QContactLocalId> contacts; 
-	for( TInt i = 0; i < aContactsToDelete.Count(); ++i )
-	    {
-	    QContact contact = iPhonebookAPI->contact( QContactLocalId( aContactsToDelete[i] ) );
-	    if( (contact.type() == QContactType::TypeGroup && aStoreUid == KUidDictionaryUidContactGroups ) ||  (contact.type() != QContactType::TypeGroup && aStoreUid != KUidDictionaryUidContactGroups) )
-            {
-            contacts.append( QContactLocalId( aContactsToDelete[i] ) );
-            }
-	    }
-    QMap<int, QContactManager::Error> errorMap;
-	iPhonebookAPI->deleteContacts( contacts );
-    }
-
-//----------------------------------------------------------------------------
-TBool CCreatorPhonebookWrapper::HasOtherThanGroupsL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebookWrapper::HasOtherThanGroupsL");
-    TBool result( EFalse );
-    return result;
-    }
-
-
-TUint32 CCreatorPhonebookWrapper::CreateGroupEntryL( HBufC* aGroupName )
-    {
-	TUint32 id = 0;
-	QString groupName = QString::fromUtf16( aGroupName->Des().Ptr(), aGroupName->Length() );
-	
-	id = iPhonebookAPI->createGroup( groupName );
-	
-	return id; 
-    }
-TInt CCreatorPhonebookWrapper::NumberOfContacts()
-	{
-	//return all stored contacts
-	return iPhonebookAPI->numberOfContacts();
-	}
-
-TInt CCreatorPhonebookWrapper::AddContactToGroup( TUint32 aGroupId, TUint32 aContact )
-	{
-	QContactLocalId group = QContactLocalId(aGroupId);
-	QContactLocalId contact = QContactLocalId(aContact);
-	
-	TInt ret = iPhonebookAPI->addContactToGroup(group, contact);
-
-	return ret;
-	}
-TInt CCreatorPhonebookWrapper::AddToGroup( TUint32 aGroupId, TInt aAmount )
-	{
-	QContactLocalId group = QContactLocalId(aGroupId);
-	TInt ret = iPhonebookAPI->addToGroup( group, (int) aAmount );
-	return ret;
-	}
-
-
-//----------------------------------------------------------------------------
-
-TInt CCreatorPhonebookWrapper::CreateSubscribedContactEntryL()
-    {
-    LOGSTRING("Creator: CCreatorPhonebookWrapper::CreateSubscribedContactEntryL");
-
-    return KErrNotSupported;
-    }
-
--- a/creator/engine/src/creator_randomdataparser.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,325 +0,0 @@
-/*
-* 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;
-	}
--- a/creator/engine/src/creator_scriptelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,722 +0,0 @@
-/*
-* 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)
-    { }
--- a/creator/engine/src/creator_scriptelementfactory.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
-* 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);
-        }       
-    }
--- a/creator/engine/src/creator_scriptentry.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,682 +0,0 @@
-/*
-* 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"
-#include "creator_scriptentry.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;
-        iSearchArray = NULL;
-    }
-
-    if (iReadBuf)
-        delete iReadBuf;
-	}
-
-// ---------------------------------------------------------------------------
-
-void CCommandParser::QueryDialogClosedL(TBool aPositiveAction, TInt aUserData)
-    {
-    User::LeaveIfNull(iSearchArray);
-    
-    if( aUserData == EGetingScript )
-        {
-        if(aPositiveAction)
-            {
-            iObserver->ScriptChosenL( ETrue, iSearchArray->MdcaPoint(iSelectedItem) );
-            }
-        else
-            {
-            iObserver->ScriptChosenL( EFalse );
-            }
-        }
-    else if( aUserData == EGetingRandomDataFile && aPositiveAction && iSearchArray->Count() )
-        {
-        if(aPositiveAction)
-            {
-            TFileName fileName;
-            if (iSelectedItem == (iSearchArray->Count() - 1))
-                {
-                // "default" (resource file) selected
-                fileName.Copy(KNullDesC);
-                }
-            else
-                {
-                // xml file selected
-                fileName.Copy(iSearchArray->MdcaPoint(iSelectedItem));
-                }
-            iObserver->RandomDataFileChosenL( ETrue, fileName );
-            }
-        else
-            {
-            iObserver->RandomDataFileChosenL( EFalse );
-            }
-        }
-    }
-
-// ---------------------------------------------------------------------------
-//#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
-void CCommandParser::OpenScriptL() {}
-TBool CCommandParser::OpenScriptL(MCommandParserObserver* aObserver)
-    {    
-    LOGSTRING("Creator: CCommandParser::OpenScriptL");
-    
-    User::LeaveIfNull( aObserver );
-    iObserver = aObserver;
-    iSelectedItem = 0;
-    
-    TBool ret = EFalse;
-
-    // init the search array
-    delete iSearchArray;
-    iSearchArray = NULL;
-    iSearchArray = new(ELeave) CDesCArrayFlat(20);
-
-    // 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());
-                }
-            }
-
-        ret = iEngine->GetEngineWrapper()->PopupListDialog(_L("Select script"), fileNameArray, &iSelectedItem, this, EGetingScript);
-		CleanupStack::PopAndDestroy(fileNameArray);
-        }
-    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(MCommandParserObserver *aObserver)
-    {    
-    LOGSTRING("Creator: CCommandParser::GetRandomDataFilenameL");
-    TBool ret = EFalse;
-
-    User::LeaveIfNull( aObserver );
-    iObserver = aObserver;
-    iSelectedItem = 0;
-
-    // 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"));
-
-		ret = iEngine->GetEngineWrapper()->PopupListDialog(_L("Select random data file"), fileNameArray, &iSelectedItem, this, EGetingRandomDataFile);
-        CleanupStack::PopAndDestroy(fileNameArray);
-        }
-    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
-    {
-    }
-
-//----------------------------------------------------------------------------
-
--- a/creator/engine/src/creator_scriptparser.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,395 +0,0 @@
-/*
-* 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);
-    iEngine->SortCommands();
-    }
-
-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/engine/src/creator_wepsecuritysettings.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* 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
-    */
-    }
-
--- a/creator/files/backup_registration.xml	Tue Aug 31 15:15:20 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/group/ReleaseNotes_Creator.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,206 @@
+===============================================================================
+
+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".
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/group/backup_registration.xml	Wed Sep 01 12:30:35 2010 +0100
@@ -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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/group/bld.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,102 @@
+/*
+* 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>
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/group/creator.mmp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,158 @@
+/*
+* 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>
+
+
+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_note.cpp
+SOURCE            creator_noteelement.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_imps.cpp
+SOURCE		      creator_impselement.cpp 
+SOURCE            creator_mailbox.cpp
+SOURCE 			  creator_mailboxelement.cpp 
+SOURCE			  creator_landmark.cpp 
+SOURCE 			  creator_landmarkelement.cpp 
+SOURCE 			  creator_phonebookbase.cpp 
+SOURCE 			  creator_contactelement.cpp 
+SOURCE            creator_contactsetcache.cpp 
+SOURCE			  creator_connectionmethodelement.cpp
+SOURCE			  creator_randomdataparser.cpp
+
+#if defined (__SERIES60_30__) || defined(__SERIES60_31__)
+  SOURCE			  creator_phonebook.cpp
+  SOURCE			  creator_accesspoint.cpp 
+#else
+  SOURCE			  creator_virtualphonebook.cpp
+  SOURCE			  creator_connectionmethod.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
+LIBRARY npdlib.lib
+LIBRARY bafl.lib 
+LIBRARY eikcoctl.lib 
+LIBRARY eikctl.lib
+LIBRARY commdb.lib
+LIBRARY muiu.lib
+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 defined (__SERIES60_30__) || defined(__SERIES60_31__)
+  LIBRARY apengine.lib
+  LIBRARY pbkeng.lib
+#else
+  LIBRARY cmmanager.lib
+  LIBRARY cmmanagerdatabase.lib
+  LIBRARY vpbkeng.lib
+  LIBRARY pbk2presentation.lib		
+#endif
+
+#ifdef __PRESENCE
+  LIBRARY wvsapsettingsstore.lib
+#endif  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/group/creator_icons_aif.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,54 @@
+#
+# 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/group/creator_stub_sis.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,56 @@
+#
+# 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)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator.hrh	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,177 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator.pan	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_accesspoint.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,125 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_app.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,56 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_appui.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* 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__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_browser.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_browserelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,49 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_calendar.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,235 @@
+/*
+* 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__)
+#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__)
+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__)
+    // 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__)
+    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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_calendarbase.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_calendarelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,119 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_connectionmethod.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,154 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_connectionmethodbase.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_connectionmethodelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,98 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_contactelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,186 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_contactsetcache.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* 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__)
+#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__)    
+    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__)    
+    RPointerArray<MVPbkContactLink> iContactLinks;
+#endif
+};
+
+class MContactLinkCache
+{
+public:
+    virtual void AppendL(CCreatorContactSet* aContactSet) = 0;
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)    
+    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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_container.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_document.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_factory.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,42 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_file.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,96 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_fileelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,66 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_imps.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,88 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_impselement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,50 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_landmark.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,104 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_landmarkelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,55 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_log.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,114 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_logelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,48 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_mailbox.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,188 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_mailboxelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,129 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_message.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,226 @@
+/*
+* 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__)
+#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__)
+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__)
+    // 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__)
+    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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_messageelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_model.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,455 @@
+/*
+* 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"
+#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"
+
+#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;
+class CCreatorNotepad;
+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;
+    CCreatorNotepad* iNotepad;
+    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__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_modulebase.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,114 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_note.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_noteelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,40 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_phonebook.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_phonebookbase.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,53 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_randomdatafield.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,44 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_randomdataparser.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,130 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_scriptelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,349 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_scriptelementfactory.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_scriptentry.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* 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__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_scriptparser.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,139 @@
+/*
+* 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_*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_std.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,29 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_traces.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,106 @@
+/*
+* 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__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_virtualphonebook.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,300 @@
+/*
+* 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/inc/creator_wepsecuritysettings.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,142 @@
+/*
+* 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_*/
--- a/creator/inc/engine.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,587 +0,0 @@
-/*
-* 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 <e32hal.h>
-#include <s32file.h>
-#include <s32mem.h>
-#include <w32std.h>
-
-//#include <aknenv.h>
-#include <coeutils.h>
-#include <apparc.h>
-#include <eikenv.h>
-//#include <eikprogi.h>
-#include <bautils.h>
-#include <commdb.h>
-#include <imageconversion.h> //TFrameInfo
-
-#include "creator.hrh"
-#include "creator_std.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 MCreatorModuleBase;
-class CCreatorPhonebookBase;
-class CCreatorModuleBaseParameters;
-//class CCreatorConnectionSettingsBase;
-class CDictionaryFileStore;
-class CImageDecoder;
-class CFbsBitmap;
-class CBitmapScaler;
-class CCommandParser;
-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
-	};
-
-/*
- * Interface for UI dialogs
- */
-class MUIObserver
-    {
-public:
-    /**
-     * Called when some dialog in UI is closed
-     *
-     * @since S60 10.1
-     * @param aPositiveAction ETrue if "Ok", "Yes" or other "positive" button was pressed
-     * @param aUserData number that was passed to UI before dialog was opened
-     * @return None.
-     */
-    virtual void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData) = 0;
-
-    };
-
-/*
- * Interface for CCommandParser
- */
-class MCommandParserObserver
-    {
-public:
-    /**
-     * Called when CCommandParser user has choosen script file
-     *
-     * @since S60 10.1
-     * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
-     * @param aFileName filename chosen by user
-     * @return None.
-     */
-    virtual void ScriptChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC) = 0;
-
-    /**
-     * Called when CCommandParser user has choosen random data file
-     *
-     * @since S60 10.1
-     * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
-     * @param aFileName filename chosen by user
-     * @return None.
-     */
-    virtual void RandomDataFileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC) = 0;
-    };
-
-/**
- * Device memory information
- */
-class TMemoryDetails
-	{
-public:
-	
-	TBuf<16> iFree;
-	TBuf<16> iSize;
-	TChar iDriveLetter;
-
-    TBuf<16> iRamFree;
-    TBuf<16> iRomFree;
-    
-	TBool    iENotAvailable;
-
-	TBuf<16> iRamSize;
-	TBuf<16> iRomSize;
-	};
-// Common constant for undefined integer value:
-const TInt KUndef = KErrNotFound;
-
-class CCreatorEngine : public CActive, public MUIObserver, public MCommandParserObserver
-	{
-enum ECreatorEngineState{
-    ECreatorEngineDeleteAllEntries,
-    ECreatorEngineDeleteAllCreatorEntries,
-};
-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 RPointerArray<TMemoryDetails> GetMemoryDetailsList(){ return iMemoryDetailsList; };
-	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 ExecuteCommand();
-    void StartEnginesL();
-    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: // from MUIObserver
-    /**
-     * Called when some dialog in UI is closed
-     *
-     * @since S60 10.1
-     * @param aPositiveAction ETrue if "Ok", "Yes" or other "positive" button was pressed
-     * @param aUserData number that was passed to UI before dialog was opened
-     * @return ?description
-     */
-    virtual void QueryDialogClosedL(TBool aPositiveAction, TInt aUserData);
-    
-public: // from MCommandParserObserver
-    /**
-     * Called when CCommandParser user has choosen script file
-     *
-     * @since S60 10.1
-     * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
-     * @param aFileName filename chosen by user
-     * @return None.
-     */
-    virtual void ScriptChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC);
-    
-    /**
-     * Called when CCommandParser user has choosen random data file
-     *
-     * @since S60 10.1
-     * @param aSuccess ETrue if "Ok", "Yes" or other "positive" button was pressed
-     * @param aFileName filename chosen by user
-     * @return None.
-     */
-    virtual void RandomDataFileChosenL(TBool aSuccess, const TDesC& aFileName = KNullDesC);
-    
-public:
-    void ExecuteOptionsMenuCommandL(TInt aCommand);
-    void RunScriptL();
-    TInt RunScriptL(const TDesC& aScriptFile);
-    void ShutDownEnginesL();
-    void ExecuteFirstCommandL(const TDesC& aText);
-    
-    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 GetRandomDataL();
-    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();
-	
-	void SortCommands();
-    
-private:
-    // needed by the engine itself
-    RTimer iTimer;
-    CEikonEnv* iEnv;
-    //CCreatorAppUi* iAppUi;
-    TInt iCurrentEntry;
-    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;
-	CCommandParser* iCommandParser;
-
-    // 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;
-	
-	RPointerArray<TMemoryDetails> iMemoryDetailsList;
-	
-	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__
-
--- a/creator/inc/enginewrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,168 +0,0 @@
-/*
-* 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 HbAction;
-
-
-/**
- * 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();
-	
-	/**
-	 * Get memory details list
-	 */
-	QList<MemoryDetails> GetMemoryDetailsList();
-	
-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, MUIObserver* aObserver, TInt aUserData);
-
-	/**
-	* Create time query dialog
-	*/    
-    TBool TimeQueryDialog(TTime* aTime, const TDesC& aPrompt, MUIObserver* aObserver, TInt aUserData);
-
-	/**
-	* Create yes or no query dialog
-	*/    
-    TBool YesNoQueryDialog(const TDesC& aPrompt, MUIObserver* aObserver, int userData);
-	
-	/**
-	* Popup list dialog for selecting item from dialog list
-	*/
-	TBool PopupListDialog(const TDesC& aPrompt, const CDesCArray* aFileNameArray, TInt* aIndex, MUIObserver* aObserver, TInt aUserData); 
-	
-	/**
-	* Directory query dialog
-	*/
-	TBool DirectoryQueryDialog(const TDesC& aPrompt, TDes& aDirectory, MUIObserver* aObserver, TInt aUserData);
-	
-	/**
-	* Create list query single-selection dialog
-	*/
-	TBool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, TInt* aSeletedItem, MUIObserver* aObserver, TInt aUserData);
-
-	/**
-	* Create list query multi-selection dialog
-	*/
-	TBool ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, CArrayFixFlat<TInt>* aSelectedItems, MUIObserver* aObserver, TInt aUserData);
-	
-	
-	/**
-	* 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;
-    
-    MCreatorModuleBase *iModule;
-};
-
-#endif //ENGINEWRAPPER_H
--- a/creator/inc/mainview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-/*
-* 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 		mFree;
-	QString			mSize;
-	QString			mDriveLetter;
-	
-    QString         mRamFree;
-	bool			mENotAvailable;
-	QString         mRamSize;
-};
-
-/**
- * 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;
-	QList<MemoryDetails> mMemoryDetailsList;
-    // signal mapper
-    QSignalMapper *mSm;    
-};
-
-#endif // MAINVIEW_H
--- a/creator/inc/notifications.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
-* 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>
-#include <hbinputdialog.h>
-
-#include "engine.h"
-
-#include <stdexcept>
-
-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);
-	
-    /**
-     * shows global HbGlobalCommonNote type note
-     */
-	static void showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type, HbPopup::DefaultTimeout timeout = HbPopup::ConfirmationNoteTimeout);
-    };
-
-class CreatorDialog
-{
-    Q_DISABLE_COPY(CreatorDialog)
-protected:
-    CreatorDialog(MUIObserver* observer, int userData) throw(std::exception) : mObserver(observer), mUserData(userData)
-        {
-            if(!mObserver)
-                throw std::invalid_argument("module cannot be the null!");
-        };
-protected:
-    virtual void NotifyObserver(TBool aPositiveAction)
-        {
-        TRAPD( err, mObserver->QueryDialogClosedL(aPositiveAction, mUserData) );
-        if(err)
-            {
-            Notifications::error( QString("Symbian Leave: %1 ").arg(err) );
-            }
-        }
-    
-protected:
-    MUIObserver* mObserver;
-    int mUserData;
-};
-
-class CreatorYesNoDialog : public HbMessageBox, public CreatorDialog
-{
-    Q_DISABLE_COPY(CreatorYesNoDialog)
-    Q_OBJECT
-public:
-    static void launch(const QString& text, const QString& label, MUIObserver* observer, int userData) throw( std::exception );
-protected:
-    CreatorYesNoDialog(MUIObserver* observer, int userData);
-protected slots:
-    void DialogClosed(HbAction*);
-};
-
-class CreatorInputDialog : public HbInputDialog, public CreatorDialog
-{
-    Q_DISABLE_COPY(CreatorInputDialog)
-    Q_OBJECT
-public:
-    static void launch(const QString& label, int* value, bool acceptZero,  MUIObserver* observer, int userData) throw( std::exception );
-    static void launch(const QString& label, TDes& value,  MUIObserver* observer, int userData) throw( std::exception );
-protected:
-    CreatorInputDialog(int* value, MUIObserver* observer, int userData);
-    CreatorInputDialog(TDes& value, MUIObserver* observer, int userData);
-protected slots:
-    void DialogClosed(HbAction*);
-private:
-    int *mIntValue;
-    TDes& mStrValue;
-    TBuf<1> mDummy;
-};
-
-class CreatorSelectionDialog : public HbSelectionDialog, public CreatorDialog
-{
-    Q_DISABLE_COPY(CreatorSelectionDialog)
-    Q_OBJECT
-public:
-    static void launch(const QString& label, const QStringList& items, TInt* selectedItem, MUIObserver* observer, int userData) throw( std::exception );
-    static void launch(const QString& label, const QStringList& items, CArrayFixFlat<TInt>* aSelectedItems, MUIObserver* observer, int userData) throw( std::exception );
-protected:
-    CreatorSelectionDialog(TInt* selectedItem, MUIObserver* observer, int userData) throw( std::exception );
-    CreatorSelectionDialog(CArrayFixFlat<TInt>* aSelectedItems, MUIObserver* observer, int userData) throw( std::exception );
-protected slots:
-    void DialogClosed(HbAction*);
-private:
-    TInt* mSelectedItem;
-    CArrayFixFlat<TInt>* mSelectedItems;
-};
-
-class CreatorDateTimeDialog : public HbDialog, public CreatorDialog
-{
-    Q_DISABLE_COPY(CreatorDateTimeDialog)
-    Q_OBJECT
-public:
-    static void launch(const QString& label, TTime* value, MUIObserver* observer, int userData) throw( std::exception );
-protected:
-    CreatorDateTimeDialog(TTime* value, MUIObserver* observer, int userData);
-protected slots:
-    void DialogClosed(HbAction*);
-private:
-    TTime *mValue;
-};
-#endif // NOTIFICATIONS_H_
--- a/creator/rom/creator.iby	Tue Aug 31 15:15:20 2010 +0300
+++ b/creator/rom/creator.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -20,16 +20,13 @@
 #define __CREATOR_IBY__
 
 S60_APP_EXE(Creator)
+S60_APP_AIF_ICONS(Creator)
 S60_APP_RESOURCE(Creator)
-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
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/sis/Creator_S60-30.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+;
+
+
+; 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/sis/Creator_S60-32.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+;
+
+
+; 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/creator/sis/Creator_stub.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -29,9 +29,8 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\creator.exe"
-""-"z:\resource\apps\creator.mif"
+""-"z:\resource\apps\creator_aif.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"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,39 @@
+/*
+* 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);
+    }
+    
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_accesspoint.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,469 @@
+/*
+* 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 );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_app.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,34 @@
+/*
+* 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;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_appui.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,360 @@
+/*
+* 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();
+	    	}
+		}
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_browser.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,592 @@
+/*
+* 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 );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_browserelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,215 @@
+/*
+* 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...
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_calendar.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1601 @@
+/*
+* 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__)
+#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__)
+#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__)
+    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__)
+    
+    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__)
+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
+//----------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_calendarelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,594 @@
+/*
+* 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;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_connectionmethod.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,948 @@
+/*
+* 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 );
+    }
+//----------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_connectionmethodelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,754 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_contactelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,472 @@
+/*
+* 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__)
+#include "creator_virtualphonebook.h"
+#endif
+#include "creator_factory.h"
+#include "creator_contactsetcache.h"
+#include <xml/documentparameters.h>
+
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#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__)
+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__)
+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__ )
+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)
+    { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_contactsetcache.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,229 @@
+/*
+* 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__)
+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__)
+    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__)    
+    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__)    
+    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__)
+
+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;
+};*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_container.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,244 @@
+/*
+* 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);
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_document.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* 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;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_factory.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,65 @@
+/*
+* 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( 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( defined __SERIES60_30__ || defined __SERIES60_31__ )
+    return CCreatorPhonebook::NewL(aEngine);    
+#else
+    return CCreatorVirtualPhonebook::NewL(aEngine);    
+#endif 
+
+}
+
+CCreatorModuleBaseParameters* TCreatorFactory::CreatePhoneBookParametersL()
+	{
+#if( 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__ )
+    return CCreatorAccessPoints::NewL(aEngine);
+#else
+    return CCreatorConnectionSettings::NewL(aEngine);    
+#endif 
+
+}
+
+CCreatorModuleBaseParameters* TCreatorFactory::CreateConnectionSettingsParametersL()
+    {
+#if( defined __SERIES60_30__ || defined __SERIES60_31__ )
+    return new(ELeave) CAccessPointsParameters;
+#else
+    return new(ELeave) CConnectionSettingsParameters;
+#endif 
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_file.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,847 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_fileelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,315 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_imps.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,260 @@
+/*
+* 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:  
+*
+*/
+
+
+#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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_impselement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,146 @@
+/*
+* 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:  
+*
+*/
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_landmark.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,497 @@
+/*
+* 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 );
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_landmarkelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,256 @@
+/*
+* 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);
+    	}
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_log.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,436 @@
+/*
+* 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 );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_logelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,170 @@
+/*
+* 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...
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_mailbox.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,793 @@
+/*
+* 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 ); 
+    }
+//----------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_mailboxelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,495 @@
+/*
+* 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);
+    	}
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_message.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,2225 @@
+/*
+* 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 <MuiuMsvUiServiceUtilities.h>
+
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+#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__)
+    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__)
+    
+    // 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__)
+    
+    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__)
+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;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_messageelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,474 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_model.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,2554 @@
+/*
+* 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__)
+  #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;
+
+	    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);
+    
+    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));
+    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 
+    
+      
+      
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)     
+    // 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;
+    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;
+    
+    
+    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__)	
+	// 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:
+            {
+            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 ( YesNoQueryDialogL( _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 ( YesNoQueryDialogL( _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
+    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 );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_note.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,179 @@
+/*
+* 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 );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_noteelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* 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);
+    	}
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_phonebook.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,514 @@
+/*
+* 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 );
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_phonebookbase.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,119 @@
+/*
+* 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;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_randomdataparser.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,324 @@
+/*
+* 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;
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_scriptelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,721 @@
+/*
+* 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)
+    { }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_scriptelementfactory.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* 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);
+        }
+    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/src/creator_scriptentry.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,728 @@
+/*
+* 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
+    {
+    }
+
+//----------------------------------------------------------------------------
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_scriptparser.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,393 @@
+/*
+* 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;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_virtualphonebook.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1802 @@
+/*
+* 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);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/creator/src/creator_wepsecuritysettings.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,144 @@
+/*
+* 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
+    */
+    }
+
--- a/creator/src/engine.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2617 +0,0 @@
-/*
-* 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 <driveinfo.h>
-
-#include <datacreator.rsg>
-
-#include "mainview.h"
-#include "engine.h"
-#include "enginewrapper.h"
-
-
-#include <cntdb.h>//For Math
-
-#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_traces.h"
-#include "creator_factory.h"
-#include "creator_scriptparser.h"
-#include "creator_file.h"
-#include "creator_cmdscriptrun.h"
-#include "creator_contactsetcache.h"
-
-#include <apparc.h>
-#include <eikappui.h>
-#include <eikapp.h>
-#include <bitmaptransforms.h>
-
-_LIT(KEDriveError, "Not available");
-_LIT(KTempPathDrive, "d");
-_LIT(KTempPath, ":\\Creator\\");
-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);
-    
-	iMemoryDetailsList.Reset();
-    delete iPictureFileArray;
-    delete iSoundFileArray;
-    delete iTempPath;
-    delete iFrameImageData;
-    delete iEncoder;
-    delete iScaler;
-    delete iDecoder;
-    delete iScaledBitmap;
-    delete iBitmap;
-    delete iBitmapData;
-	
-    delete iCmdScriptRun;
-    iCmdScriptRun = NULL;
-    
-    delete iCommandParser;
-    }
-
-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() 
-    {
-
-	TDriveList dl;
-    // variables for memory and disk handling
-    TVolumeInfo vinfo;
-
-    //*************************************************************************
-   
-    //*************************************************************************
-    // get an access to file server
-    RFs& fsSession = CEikonEnv::Static()->FsSession();
-
-    fsSession.DriveList(dl);
-    
-    for(TInt driveNum = EDriveC; driveNum <= EDriveZ ; driveNum ++ )
-    	{
-		if( dl[driveNum] )
-			{
-			TMemoryDetails *memDet = new TMemoryDetails;
-			if(fsSession.Volume(vinfo, driveNum) == KErrNone)
-				{
-				memDet->iFree.Num(TInt64(vinfo.iFree/1024));
-				memDet->iSize.Num(TInt64(vinfo.iSize/1024));
-				}
-			else
-				{
-				memDet->iFree.Num( 0 );
-				memDet->iSize.Num( 0 );
-				}
-			User::LeaveIfError(fsSession.DriveToChar(driveNum,memDet->iDriveLetter));
-			iMemoryDetailsList.AppendL( memDet );
-			}
-    	}
-  
-    // available work memory
-    TMemoryInfoV1Buf memory;
-    UserHal::MemoryInfo(memory);
-    TInt64 freeMemBytes=(TInt64)(memory().iFreeRamInBytes);
-    TInt64 sizeMemBytes=(TInt64)(memory().iTotalRamInBytes);
-    TInt64 sizeWorkMemBytes = sizeMemBytes; 
-    TInt64 sizeRomBytes = (TInt64)(memory().iTotalRomInBytes);
-    iMemoryDetails.iRamFree.Num(TInt64(freeMemBytes/1024));
-    iMemoryDetails.iRamSize.Num(TInt64(sizeWorkMemBytes/1024));
-    iMemoryDetails.iRomSize.Num(TInt64(sizeRomBytes/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();
-		}
-    }
-
-// ---------------------------------------------------------------------------
-void CCreatorEngine::SortCommands()
-	{
-	TKeyArrayFix iBufKey(_FOFF(TCommand, iCommandId),ECmpTInt);
-	iCommandArray->Sort(iBufKey);
-	}
-// ---------------------------------------------------------------------------
-
-// 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;
-
-    // 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));
-    ContactLinkCache::InitializeL();
-/*
-    #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;
-
-    ContactLinkCache::DestroyL();
-    // now delete the command array
-    delete iCommandArray;
-    iCommandArray = NULL;
-	
-	// delete parameter array
-	iParameterArray.ResetAndDestroy();
-	iParameterArray.Close();
-	
-	if(iCommandParser)
-	    {
-        delete iCommandParser;
-	    iCommandParser = NULL;
-	    }
-    
-    
-	// 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::ScriptChosenL( TBool aSuccess, const TDesC& aFileName )
-    {
-    if( aSuccess )
-        {
-        // open the file for reading
-        RFile scriptFile;
-        User::LeaveIfError( scriptFile.Open( iEnv->FsSession(), aFileName, EFileRead ) );
-        CleanupClosePushL(scriptFile);
-    
-        
-        // wait dialog
-        /* TODO
-        CAknGlobalNote* waitDialog = CAknGlobalNote::NewLC();
-        waitDialog->SetSoftkeys( R_AVKON_SOFTKEYS_CANCEL );
-        TInt dialogId = waitDialog->ShowNoteL( EAknGlobalWaitNote, _L("Parsing") );
-        */
-        TInt parseErr( KErrNone );
-        CCreatorScriptParser* scriptParser = CCreatorScriptParser::NewLC(this);
-        scriptParser->ParseL(scriptFile);
-        parseErr = scriptParser->GetError();
-        CleanupStack::PopAndDestroy( scriptParser );
-    
-        CleanupStack::PopAndDestroy( &scriptFile );
-    
-        //waitDialog->CancelNoteL( dialogId );
-        //CleanupStack::PopAndDestroy( waitDialog );
-    
-        if(parseErr != KErrNone)
-            {
-            // show error note
-            _LIT(KErrMsg, "Parser error: %d");
-            TBuf<32> msgBuf;
-            msgBuf.Format(KErrMsg, parseErr);
-            iEngineWrapper->ShowErrorMessage(msgBuf);
-            ShutDownEnginesL();
-            return;
-            }         
-        }
-
-    // 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
-    delete iCommandParser;
-    iCommandParser = NULL;
-    iCommandParser = CCommandParser::NewL(this);
-    TBool ret = EFalse;
-    TRAPD(err, ret = iCommandParser->OpenScriptL( this ) );
-    if( err != KErrNone || ret == EFalse)
-        {
-        ShutDownEnginesL();
-        User::LeaveIfError(err);
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-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::QueryDialogClosedL( TBool aPositiveAction, TInt aUserData )
-    {
-    LOGSTRING("Creator: CCreatorEngine::QueryDialogClosedL");
-    
-    if( aPositiveAction == EFalse )
-        {
-        ShutDownEnginesL();
-        return;
-        }
-
-    switch(aUserData)
-        {
-        case ECreatorEngineDeleteAllEntries:
-            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 );
-            break;
-        case ECreatorEngineDeleteAllCreatorEntries:
-            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 );
-            break;
-        default:
-            //some error
-             ShutDownEnginesL();
-            break;
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-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?"), this, ECreatorEngineDeleteAllEntries) )
-                {
-                // cancelled, free resources
-                ShutDownEnginesL();
-                }
-            }
-        else if ( aCommand == ECmdDeleteAllCreatorEntries )
-            {
-            if ( !iEngineWrapper->YesNoQueryDialog( _L("Delete all entries created with Creator?"), this, ECreatorEngineDeleteAllCreatorEntries ) )
-                {
-                // cancelled, free resources
-                ShutDownEnginesL();
-                }
-            }
-        else if ( !iUsedOptionsMenuModule->AskDataFromUserL( aCommand )  )
-            {
-            // cancelled or error, free resources
-            ShutDownEnginesL();
-            }
-        }
-
-    // ask user data, if query accepted start processing...
-    else if (!iUsedOptionsMenuModule->AskDataFromUserL(aCommand))
-        {
-        // cancelled or error, 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;
-            }
-        }
-     
-    }
-// ---------------------------------------------------------------------------
-void CCreatorEngine::RandomDataFileChosenL( TBool aSuccess, const TDesC& aFileName )
-    {
-    if( aSuccess )
-        {
-        GetRandomDataFromFileL( aFileName );
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-TBool CCreatorEngine::GetRandomDataL()
-	{
-    delete iCommandParser;
-    iCommandParser = NULL;
-    iCommandParser = CCommandParser::NewL( this );
-	return iCommandParser->GetRandomDataFilenameL( this );
-	}
-
-// ---------------------------------------------------------------------------
-
-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 );
-    return 0;
-    }
-
-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 );
-    }
-
-//----------------------------------------------------------------------------
--- a/creator/src/enginewrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,375 +0,0 @@
-/*
-* 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 <hblabel.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;
-    }
-}
-
-// ---------------------------------------------------------------------------
-
-QList<MemoryDetails> EngineWrapper::GetMemoryDetailsList()
-	{
-	RPointerArray<TMemoryDetails> tMemDetList = iEngine->GetMemoryDetailsList();
-	QList<MemoryDetails> memDetList;
-	MemoryDetails memDet;
-		for(int i=0; i<tMemDetList.Count(); i++)
-			{
-			TMemoryDetails* temp = tMemDetList.operator [](i);
-			QString free = QString::fromUtf16(tMemDetList.operator [](i)->iFree.Ptr(), tMemDetList.operator [](i)->iFree.Length());//QString((QChar*) temp->iFree.Ptr(), temp->iFree.Length());
-			QString size = QString::fromUtf16(tMemDetList.operator [](i)->iSize.Ptr(), tMemDetList.operator [](i)->iSize.Length());//QString((QChar*) temp->iSize.Ptr(), temp->iSize.Length());
-			QString driveLetter = QString::fromUtf8((const char*) &tMemDetList.operator [](i)->iDriveLetter, (int) sizeof(char) );//QString((QChar*) &temp->iDriveLetter, (int) sizeof( char ) );
-			memDet.mFree = free; //QString((QChar*)tMemDetList[i]->iFree.Ptr(), tMemDetList[i]->iFree.Length());
-			memDet.mSize = size; //QString((QChar*) tMemDetList[i]->iSize.Ptr(), tMemDetList[i]->iSize.Length());
-			memDet.mDriveLetter = driveLetter;
-			
-			//memDetList[i].mDriveLetter = QString::fromUtf8( (char *) &tMemDetList[i]->iDriveLetter, (int) sizeof( char ) );
-			memDetList.append( memDet );
-			}
-	return memDetList;
-	}
-
-MemoryDetails EngineWrapper::GetMemoryDetails()
-{
-	
-    TMemoryDetails tMemoryDetails = iEngine->GetMemoryDetails();
-    MemoryDetails memoryDetails;
-
-    // Convert TMemoryDetails to MemoryDetails 
-	memoryDetails.mRamFree  = QString((QChar*)tMemoryDetails.iRamFree.Ptr(), tMemoryDetails.iRamFree.Length());
-	memoryDetails.mRamSize  = QString((QChar*)tMemoryDetails.iRamSize.Ptr(), tMemoryDetails.iRamSize.Length());
-
-	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());
-	if(iProgressDialog){
-        delete iProgressDialog;
-        iProgressDialog = NULL;
-	}
-    iProgressDialog = Notifications::showProgressBar(text, aMax);
-	connect(iProgressDialog, SIGNAL(cancelled()), this, SLOT(ProgressDialogCancelled()));
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::IncrementProgressbarValue()
-{
-    if(iProgressDialog)
-        iProgressDialog->setProgressValue(iProgressDialog->progressValue() + 1);
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::CloseProgressbar()
-{
-    if(iProgressDialog){
-        disconnect(iProgressDialog, SIGNAL(cancelled()), this, SLOT(ProgressDialogCancelled()));
-        delete iProgressDialog;
-        iProgressDialog = NULL;
-    }
-}
-
-// ---------------------------------------------------------------------------
-
-TBool EngineWrapper::EntriesQueryDialog(TInt* aNumberOfEntries, const TDesC& aPrompt, TBool aAcceptsZero, MUIObserver* observer, int userData)
-    {
-	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
-	TBool success(EFalse);
-    try{
-        CreatorInputDialog::launch(text, aNumberOfEntries, aAcceptsZero ? true : false, observer, userData);
-        success = ETrue;
-    }
-    catch (std::exception& e)
-        {
-        Notifications::error( QString("exception: ")+e.what() );
-        }
-	return success;
-    }
-	
-// ---------------------------------------------------------------------------	
-
-TBool EngineWrapper::TimeQueryDialog(TTime* aTime, const TDesC& aPrompt, MUIObserver* observer, int userData)
-    {
-    QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
-    TBool success(EFalse);
-    try{
-        CreatorDateTimeDialog::launch(text, aTime, observer, userData); 
-        success = ETrue;
-    }
-    catch (std::exception& e)
-        {
-        Notifications::error( QString("exception: ")+e.what() );
-        }
-    return success;
-    }
-
-TBool EngineWrapper::YesNoQueryDialog(const TDesC& aPrompt, MUIObserver* observer, int userData)
-{
-	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
-	TBool success(EFalse);
-    try{
-        CreatorYesNoDialog::launch(text, "", observer, userData);	
-        success = ETrue;
-    }
-    catch (std::exception& e)
-        {
-        Notifications::error( QString("exception: ")+e.what() );
-        }
-    return success;
-}
- 
-// ---------------------------------------------------------------------------	
-
-bool EngineWrapper::ExecuteOptionsMenuCommand(int commandId)
-{
-	TInt err = KErrNone;
-	if (commandId == ECmdCreateFromFile) {
-		TRAP(err, iEngine->RunScriptL());
-	}
-	else if (commandId == ECmdSelectRandomDataFile) {
-		TBool ret = EFalse;
-		TRAP(err, ret = iEngine->GetRandomDataL());
-		if ( err != KErrNone || ret == EFalse ) {
-			Notifications::error("Error in getting random data.");
-			return false;
-		}		
-	}
-    else {
-		TRAP(err, iEngine->ExecuteOptionsMenuCommandL(commandId));
-	}
-	// error handling
-    if(err != KErrNone) {
-        return false;
-    }
-    else {
-        return true;
-    }
-}
-
-// ---------------------------------------------------------------------------	
-
-TBool EngineWrapper::PopupListDialog(const TDesC& aPrompt, const CDesCArray* aFileNameArray, TInt* aIndex, MUIObserver* aObserver, TInt aUserData) 
-{
-	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()));
-	}
-	TBool success(EFalse);
-    try{
-        CreatorSelectionDialog::launch(text, itemList, aIndex, aObserver, aUserData);
-	    success = ETrue;
-    }
-    catch (std::exception& e)
-        {
-        Notifications::error( QString("exception: ")+e.what() );
-        }
-    return success;
-}
-
-// ---------------------------------------------------------------------------	
-
-TBool EngineWrapper::DirectoryQueryDialog(const TDesC& aPrompt, TDes& aDirectory, MUIObserver* aObserver, TInt aUserData)
-{
-	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
-	TBool success(EFalse);
-    try{
-        CreatorInputDialog::launch(text, aDirectory, aObserver, aUserData);
-        success = ETrue;
-    }
-    catch (std::exception& e)
-        {
-        Notifications::error( QString("exception: ")+e.what() );
-        }
-    return success;
-}
-
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::ProgressDialogCancelled()
-{
-	CloseProgressbar();
-	TRAPD(err, iEngine->ProgressDialogCancelledL());
-	// error handling
-    if(err != KErrNone) {
-        Notifications::error("Error in operation cancel.");
-    }	
-}
-
-// ---------------------------------------------------------------------------
-
-TBool EngineWrapper::ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, TInt* aIndex, MUIObserver* aObserver, TInt aUserData)
-{
-	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;
-		}
-	}
-	TBool success(EFalse);
-    try{
-        CreatorSelectionDialog::launch(text, itemList, aIndex, aObserver, aUserData);
-        success = ETrue;
-    }
-    catch (std::exception& e)
-        {
-        Notifications::error( QString("exception: ")+e.what() );
-        }
-    return success;
-}
-
-TBool EngineWrapper::ListQueryDialog(const TDesC& aPrompt, TListQueryId aId, CArrayFixFlat<TInt>* aSelectedItems, MUIObserver* aObserver, TInt aUserData)
-{
-    TBool success(EFalse);
-	QStringList itemList;
-	QString text((QChar*)aPrompt.Ptr(), aPrompt.Length());
-	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";
-	}
-	else{
-        Notifications::error("Error in resource id.");
-        return EFalse;
-    }
-	
-    try{
-        CreatorSelectionDialog::launch(text, itemList, aSelectedItems, aObserver, aUserData);
-        success = ETrue;
-    }
-    catch (std::exception& e)
-        {
-        Notifications::error( QString("exception: ")+e.what() );
-        }
-    return success;
-}
-
-void EngineWrapper::CloseCreatorApp()
-{
-	MainView::closeApp();
-}
--- a/creator/src/main.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* 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;
-}
-
--- a/creator/src/mainview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,659 +0,0 @@
-/*
-* 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();
-	
-    QList<MemoryDetails> memDet = mEngineWrapper.GetMemoryDetailsList();
-    
-    if (layout != NULL) 
-    	{
-		HbLabel* edit = new HbLabel(this);
-        //HbTextEdit* edit = new HbTextEdit(this);
-        if(edit != NULL) 
-        	{
-        QString text = QString("<BR><BR>Free RAM Memory:<BR> %1 of %2 kB").arg(mMemoryDetails.mRamFree).arg(mMemoryDetails.mRamSize);	
-        //QString text = QString("\n\nFree RAM Memory:\n %1 of %2 kB").arg(mMemoryDetails.mRamFree).arg(mMemoryDetails.mRamSize);
-			for(int i=0 ; i < memDet.count() ; i++ )
-				{
-			text += QString("<BR><BR>Free %1: Memory:<BR> %2 of %3 kB").arg(memDet[i].mDriveLetter).arg(memDet[i].mFree).arg(memDet[i].mSize);//text += QString("\n\nFree %1: Memory:\n %2 of %3 kB").arg(memDet[i].mDriveLetter).arg(memDet[i].mFree).arg(memDet[i].mSize);
-				}
-			edit->setTextWrapping(Hb::TextWordWrap);
-			edit->setHtml(text);
-			//edit->setPlainText(text);
-                	
-            //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();
-}
-
-// ---------------------------------------------------------------------------
--- a/creator/src/notifications.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,305 +0,0 @@
-/*
-* 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 <hbdatetimepicker.h>
-
-#include <QString>
-#include <QDate>
-#include <QRegExp>
-#include <QList>
-
-#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.1.0 - June 18th 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->setAutoClose(false);
-    note->show();
-    return note;
-
-}
-
-// ---------------------------------------------------------------------------
-
-void Notifications::showGlobalNote(const QString& text, HbMessageBox::MessageBoxType type, HbPopup::DefaultTimeout timeout)
-{
-    showMessageBox(type, text, QString("Creator"), timeout);
-}
-
-
-// ---------------------------------------------------------------------------
-
-CreatorYesNoDialog::CreatorYesNoDialog(MUIObserver* observer, int userData) : 
-    HbMessageBox(HbMessageBox::MessageTypeQuestion, NULL),
-    CreatorDialog(observer, userData)
-{
-}
-
-void CreatorYesNoDialog::launch(const QString& text, const QString& label, MUIObserver* observer, int userData) throw(std::exception)
-{
-    CreatorYesNoDialog* dlg = new CreatorYesNoDialog(observer, userData);
-    dlg->setText(text);
-    if(label.length())
-        dlg->setHeadingWidget(new HbLabel(label, dlg));
-    dlg->setAttribute(Qt::WA_DeleteOnClose);
-    dlg->setTimeout(HbPopup::NoTimeout);
-    dlg->open(dlg, SLOT(DialogClosed(HbAction*)));
-}
-
-void CreatorYesNoDialog::DialogClosed(HbAction *action)
-{
-    TBool PositiveAction(EFalse);
-    if(action && (action->softKeyRole()==QAction::PositiveSoftKey || !action->text().compare("yes", Qt::CaseInsensitive))){
-        PositiveAction = ETrue;
-    }
-    NotifyObserver(PositiveAction);
-}
-
-CreatorInputDialog::CreatorInputDialog(int* value, MUIObserver* module, int userData) : 
-    HbInputDialog(NULL),
-    CreatorDialog(module, userData),
-    mIntValue(value), 
-    mStrValue(mDummy)// will not be used
-{
-    if(!value)
-        throw std::invalid_argument("value cannot be the null!");
-}
-
-CreatorInputDialog::CreatorInputDialog(TDes& value, MUIObserver* module, int userData) : 
-    HbInputDialog(NULL),
-    CreatorDialog(module, userData),
-    mIntValue(NULL),
-    mStrValue(value)
-{
-}
-
-void CreatorInputDialog::launch(const QString& label, int* value, bool acceptsZero, MUIObserver* observer, int userData) throw( std::exception )
-{
-    CreatorInputDialog* dlg = new CreatorInputDialog(value, observer, userData);
-    dlg->setPromptText(label);
-    dlg->setInputMode(IntInput);
-    HbValidator *validator = new HbValidator(dlg);
-    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), "");
-    dlg->setValidator(validator);
-    dlg->setValue(QVariant(*value));
-    dlg->lineEdit()->setSelection(0, dlg->value().toString().length());
-    dlg->setAttribute(Qt::WA_DeleteOnClose);
-    dlg->open(dlg, SLOT(DialogClosed(HbAction*)));
-}
-
-void CreatorInputDialog::launch(const QString& label, TDes& value, MUIObserver* observer, int userData) throw( std::exception )
-{
-    CreatorInputDialog* dlg = new CreatorInputDialog(value, observer, userData);
-    dlg->setPromptText(label);
-    dlg->lineEdit()->setMaxLength(value.MaxLength());
-    dlg->setValue(QString::fromUtf16(value.Ptr(), value.Length()));
-    dlg->lineEdit()->setSelection(0, dlg->value().toString().length());
-    dlg->setInputMode(TextInput);
-    dlg->setAttribute(Qt::WA_DeleteOnClose);
-    dlg->open(dlg, SLOT(DialogClosed(HbAction*)));
-}
-
-void CreatorInputDialog::DialogClosed(HbAction *action)
-{
-    TBool PositiveAction(EFalse);
-    if(action && (action->softKeyRole()==QAction::PositiveSoftKey || !action->text().compare("ok", Qt::CaseInsensitive))){
-        bool ok = true;
-        if( inputMode() == IntInput )
-            *mIntValue = value().toInt(&ok);
-        else if( inputMode() == TextInput && mStrValue.MaxLength() >= value().toString().length() )
-            mStrValue.Copy(value().toString().utf16());
-        else
-            ok = false;
-        PositiveAction = ok ? ETrue : EFalse;
-    }
-    NotifyObserver(PositiveAction);
-}
-
-CreatorSelectionDialog::CreatorSelectionDialog(int* selectedItem, MUIObserver* observer, int userData) throw(std::exception) : 
-    HbSelectionDialog(NULL),
-    CreatorDialog(observer, userData),
-    mSelectedItem(selectedItem),
-    mSelectedItems(NULL)
-{
-    if(!mSelectedItem)
-        throw std::invalid_argument("selectedItem cannot be null!");
-}
-
-CreatorSelectionDialog::CreatorSelectionDialog(CArrayFixFlat<TInt>* selectedItems, MUIObserver* observer, int userData) throw(std::exception) : 
-    HbSelectionDialog(NULL),
-    CreatorDialog(observer, userData),
-    mSelectedItem(NULL),
-    mSelectedItems(selectedItems)
-{
-    if(!mSelectedItems)
-        throw std::invalid_argument("selectedItems cannot be null!");
-}
-
-void CreatorSelectionDialog::launch(const QString& label, const QStringList& items, int* selectedItem, MUIObserver* observer, int userData) throw(std::exception)
-{
-    CreatorSelectionDialog* dlg = new CreatorSelectionDialog(selectedItem, observer, userData);
-    if(label.length())
-        dlg->setHeadingWidget(new HbLabel(label, dlg));
-    dlg->setStringItems(items);
-    dlg->setSelectionMode(HbAbstractItemView::SingleSelection); 
-    dlg->setAttribute(Qt::WA_DeleteOnClose);
-    dlg->open(dlg, SLOT(DialogClosed(HbAction*)));
-}
-
-void CreatorSelectionDialog::launch(const QString& label, const QStringList& items, CArrayFixFlat<TInt>* selectedItems, MUIObserver* observer, int userData) throw(std::exception)
-{
-    CreatorSelectionDialog* dlg = new CreatorSelectionDialog(selectedItems, observer, userData);
-    if(label.length())
-        dlg->setHeadingWidget(new HbLabel(label, dlg));
-    dlg->setStringItems(items);
-    dlg->setSelectionMode(HbAbstractItemView::MultiSelection); 
-    dlg->setAttribute(Qt::WA_DeleteOnClose);
-    dlg->open(dlg, SLOT(DialogClosed(HbAction*)));
-}
-
-void CreatorSelectionDialog::DialogClosed(HbAction *action)
-{
-    TBool PositiveAction(EFalse);
-    //CreatorSelectionDialog* dlg = qobject_cast<CreatorSelectionDialog*>(sender());
-    if(!action || (action && action->softKeyRole()==QAction::SelectSoftKey) || (action && !action->text().compare("ok", Qt::CaseInsensitive))){
-        if(selectedItems().count()){
-            try{
-                if( selectionMode() == HbAbstractItemView::SingleSelection && mSelectedItem){
-                    bool ok(false);
-                    *mSelectedItem = selectedItems().at(0).toInt(&ok);
-                    if(!ok)
-                        throw std::invalid_argument("cannot obtain selected item!");
-                }
-                if( selectionMode() == HbAbstractItemView::MultiSelection && mSelectedItems){
-                    QList<QVariant> items = selectedItems();
-                    foreach( QVariant item, items){
-                        QT_TRAP_THROWING( mSelectedItems->AppendL( item.toInt() ) );
-                    }
-                }
-                PositiveAction = ETrue;
-            }
-            catch (std::exception& e){
-                Notifications::error( QString("exception: ")+e.what() );
-            }
-        }
-    }
-    NotifyObserver(PositiveAction);
-}
-
-CreatorDateTimeDialog::CreatorDateTimeDialog(TTime* value, MUIObserver* observer, int userData) : 
-    HbDialog(NULL),
-    CreatorDialog(observer, userData),
-    mValue(value)
-{
-}
-
-void CreatorDateTimeDialog::launch(const QString& label, TTime* value, MUIObserver* observer, int userData) throw( std::exception )
-{
-    CreatorDateTimeDialog* dlg = new CreatorDateTimeDialog(value, observer, userData);
-    if(!value)
-        throw std::invalid_argument("value cannot be the null!");
-    if(label.length())
-        dlg->setHeadingWidget( new HbLabel(label, dlg) );
-    
-    // TTime to QDate
-    TBuf<20> timeString;
-    _LIT(KDateString,"%D%M%Y%/0%1%/1%2%/2%3%/3");
-    TRAP_IGNORE( value->FormatL(timeString, KDateString) );
-    QString temp = QString::fromUtf16(timeString.Ptr(), timeString.Length());
-    temp.replace(QChar('/'), QChar('-'));
-    QDate date = QDate::fromString(temp, "dd-MM-yyyy");
-    HbDateTimePicker* widget = new HbDateTimePicker( date, dlg );
-    dlg->setContentWidget( widget );
-    dlg->addAction(new HbAction("Ok", dlg));
-    dlg->addAction(new HbAction("Cancel", dlg));
-    dlg->setModal(true); // Dialog is modal  
-    dlg->setAttribute(Qt::WA_DeleteOnClose);
-    dlg->setTimeout(HbPopup::NoTimeout);
-    dlg->open(dlg, SLOT(DialogClosed(HbAction*)));
-}
-
-void CreatorDateTimeDialog::DialogClosed(HbAction *action)
-{
-    TBool PositiveAction(EFalse);
-    if(action && (action->softKeyRole()==QAction::PositiveSoftKey || !action->text().compare("ok", Qt::CaseInsensitive))){
-        QString str = qobject_cast<HbDateTimePicker*>(contentWidget())->date().toString(Qt::ISODate);
-        str.remove('-');
-        str += ":000000";// 0h 0m 0s
-        TBuf<30> dateTimeString(str.utf16());
-        mValue->Set(dateTimeString);
-        PositiveAction = ETrue;
-    }
-    NotifyObserver(PositiveAction);
-}
-//End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/data/filebrowser.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1599 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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";
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/data/filebrowser_reg.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+
+#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";    
+    }
--- a/filebrowser/engine/FB.hrh	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,288 +0,0 @@
-/*
-* 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
-    };
-
-enum TListingMode
-    {
-    ENormalEntries = 0,
-    ESearchResults,
-    EOpenFiles,
-    EMsgAttachmentsInbox,
-    EMsgAttachmentsDrafts,
-    EMsgAttachmentsSentItems,
-    EMsgAttachmentsOutbox
-    };
-
-#endif      // FILEBROWSER_HRH
--- a/filebrowser/engine/FBFileOps.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1162 +0,0 @@
-/*
-* 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
-                                {
-                                // ensure that root target folder exists
-                                BaflUtils::EnsurePathExistsL(iFs, iBuf2);
-                                // 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("\\"));
-                    // test path.Left(iBuf2.Length()).Compare(iBuf2) - to prevent never ending recursive copy (in case of copy folder under itself)
-                    if( !(iRecursiveState == EFileOpCopy && !path.Left(iBuf2.Length()).Compare(iBuf2)) )
-                        {
-                        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;
-        
-        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
-            }
-        // a path has a trailing backslash so it needs to be removed before the call
-        err = FileOpAttribs(targetPath.Left(targetPath.Length()-1), aSourceEntry.iEntry.iAtt, 0, 0, 0);
-        }
-
-    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
--- a/filebrowser/engine/FBFileOps.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* 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
-
--- a/filebrowser/engine/FBFileUtils.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4761 +0,0 @@
-/*
-* 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 <e32svr.h>
-#include <eikfutil.h>
-#include <apparc.h>
-#include <apaid.h>
-#include <apaidpartner.h>
-#include <eikenv.h>
-#include <bautils.h>
-#include <gulicon.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 );        
-        iEngine->FileBrowserUI()->ShowProgressDialog(aLabel, 0, CommandArrayCount());
-        isProgressDialog = 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();
-        iEngine->FileBrowserUI()->ShowWaitDialog(aLabel);
-        isWaitDialog = ETrue;
-        }
-    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)
-    if (isWaitDialog)
-        {
-        iEngine->FileBrowserUI()->ProcessEvents();
-        }
-    if (isProgressDialog)
-        {
-        TInt newValue = iCurrentEntry;
-        iEngine->FileBrowserUI()->SetProgressValue(newValue);
-        }
-    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 (isWaitDialog)
-            {
-            iEngine->FileBrowserUI()->CancelWaitDialog();
-            isWaitDialog = EFalse;
-            }
-        if (isProgressDialog)
-            {
-            iEngine->FileBrowserUI()->CancelProgressDialog();
-            isProgressDialog = EFalse;
-            }
-//        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();
-
-        isProgressDialog = EFalse;
-
-        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())
-//        {
-//        // 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));
-
-
-        iEngine->FileBrowserUI()->ShowWaitDialog(_L("Searching"));
-        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();
-        iEngine->FileBrowserUI()->CancelWaitDialog();
-
-//        TInt operations = iFileEntryList->Count();
-
-        iListingMode = ESearchResults;
-        // TODO 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 && iAllowProcessing)
-        {
-        iEngine->FileBrowserUI()->ProcessEvents();
-        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->FileBrowserUI()->ShowWaitDialog(_L("Generating"));
-        
-        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(_L(","));
-            writeBuf.AppendNum(fileEntry.iEntry.iSize);
-            writeBuf.Append(_L(" B"));
-
-//            // date
-//            TTime entryModified = fileEntry.iEntry.iModified;
-//            // convert from universal time
-//            if ( iTz.ConvertToLocalTime( entryModified ) == KErrNone )
-//                {
-//                entryModified = fileEntry.iEntry.iModified; // use universal time
-//                }
-//
-//            _LIT(KDateFormat,               "%D%M%Y%/0%1%/1%2%/2%3%/3");
-//            TBuf<32> dateBuf;
-//            entryModified.FormatL(dateBuf, KDateFormat);
-//            writeBuf.Append(dateBuf);
-//
-//            writeBuf.Append(_L(" "));
-//            // time
-//            _LIT(KTimeFormat, "%-B%:0%J%:1%T%:2%S%:3%+B");
-//            TBuf<32> timeBuf;
-//            entryModified.FormatL(timeBuf, KTimeFormat);
-//            writeBuf.Append(timeBuf);
-//
-            writeBuf.Append(KFileNewLine);
-            file.Write(writeBuf);
-            }
-        
-        iEngine->FileBrowserUI()->CancelWaitDialog();
-        
-        CleanupStack::PopAndDestroy(); //file
-        iFindFileEntryList->Reset();
-        
-        _LIT(KMessage, "File list written to %S");
-        TFileName noteMsg;
-        noteMsg.Format(KMessage, &allFilesPath);
-
-        iEngine->FileBrowserUI()->ShowConfirmationNote(noteMsg, EFalse); // 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 && iAllowProcessing)
-        {
-        iEngine->FileBrowserUI()->ProcessEvents();
-        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
--- a/filebrowser/engine/FBFileUtils.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,405 +0,0 @@
-/*
-* 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 <msvapi.h>
-#include <tz.h>
-#include "FB.hrh"
-
-_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 CDocumentHandler;
-class CEikProgressInfo;
-class CFBFileOpClient;
-class CEikProgressInfo;
-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 MMsvSessionObserver
-	{
-private:
-    enum TState // active object states
-    	{
-    	EIdle = 0,              // do nothing
-    	};
-
-    enum TClipBoardMode
-    	{
-    	EClipBoardModeCut = 0,
-    	EClipBoardModeCopy
-    	};
-
-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 MMsvSessionObserver
-    void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
-
-public:  //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 TListingMode ListingMode() { return iListingMode; }
-    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; };    
-    inline void SetAllowProcessing(TBool aAllowProcessing) { iAllowProcessing = aAllowProcessing; }
-	
-private:
-    TState                          iState;
-    CEngine*                        iEngine;
-    CFileBrowserFileOps*            iFileOps;
-
-    TBool                           isWaitDialog;
-    TBool                           isProgressDialog;
-
-    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;
-
-    RFile                           iMsgStoreWalkFile;
-    TInt                            iPrevFolderIndex;
-    TFileName                       iPrevFolderName;
-    RTz                             iTz;
-    TSearchResults                  iFileSearchResults;
-    CDesCArray*                     iTextArray;
-    TBool                           iAllowProcessing;
-    };
-
-
-// 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/engine/FBStd.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* 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
-
--- a/filebrowser/engine/FBTraces.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +0,0 @@
-/*
-* 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
--- a/filebrowser/engine/engine.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,427 +0,0 @@
-/*
-* 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>
-
-// 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);
-    }
-
-// ---------------------------------------------------------------------------
-
-void CEngine::DeActivateEngineL()
-    {
-    }
-	
-// ---------------------------------------------------------------------------
-
-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();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-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
--- a/filebrowser/engine/engine.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,217 +0,0 @@
-/*
-* 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 "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 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 ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum ) = 0;
-
-    /**
-     * Cancel progress dialog
-     * @return None.
-     */
-    virtual void CancelProgressDialog() = 0;
-
-    /**
-      * Set progress dialog value
-      * @param aValue A vaule to be shown at top of the progress dialog.
-      */
-    virtual void SetProgressValue(TInt aValue) = 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;
-
-    /**
-     * Cancel wait dialog
-     * @return None.
-     */
-    virtual void CancelWaitDialog() = 0;
-
-    /**
-     * Processes all pending events to allow wait/progresa dialog to update itself
-     * @return None.
-     */
-    virtual void ProcessEvents() = 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 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);
-    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; }
-
-    void OpenWithApparcL(TFileName aFileName);
-    void OpenWithDocHandlerL(TFileName aFileName, TBool aEmbed);
-//    TInt QueryCurrentItemIndex();
-    TSearchAttributes GetSearchAttributes();
-    void ChangeAttributes(TSearchAttributes attributes);
-    TSearchResults SearchResults();
-    CFileEntryList* FoundFiles();	
-    void SearchL();
-
-private:
-    MFileBrowserUI                  *iFileBrowserUI;
-    CFileBrowserScreenCapture       *iScreenCapture;
-    CFileBrowserFileUtils           *iFileUtils;
-    CEikonEnv*                      iEnv;
-    TFileBrowserSettings            iSettings;
-    RApaLsSession                   iLs;
-    TBool                           iIsHashKeySelectionInUse; 
-    };
-   
-
-#endif // __ENGINE_H__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/envpatcher/EnvPatcher.pl	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,544 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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;    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/envpatcher/ReadMe.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,46 @@
+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/filebrowser/filebrowser.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#
-# 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/filebrowser/fileopclient/inc/FBFileOpClient.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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	Tue Aug 31 15:15:20 2010 +0300
+++ b/filebrowser/group/ReleaseNotes_FileBrowser.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -1,7 +1,7 @@
 ===============================================================================
 
-RELEASE NOTES - FILEBROWSER v5.1.0
-RELEASED 18th June 2010
+RELEASE NOTES - FILEBROWSER v4.5.2
+RELEASED 10th December 2009
 
 SUPPORTS S60 3.0+
 
@@ -37,11 +37,10 @@
 
 ===============================================================================
 
-What's New in v5.1.0
+What's New in v4.5.2
 ====================
-- Error fixes
-- File filtering
-- Usability improvements
+- Fix: UI layout problems fixed
+- Fix: Filebrowser crashes with too long filenames
 
 ===============================================================================
 
@@ -111,21 +110,6 @@
 Version History:
 ================
 
-Version 5.0.1 - 21th May 2010
-====================
-- Error fixes
-- All files to text file with file sizes
-- Usability improvements
-
-Version 5.0.0 - 23th April 2010
------------------------------
-- Orbit UI
-
-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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/group/bld.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -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 <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
--- a/filebrowser/group/bld_generic.inf	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/group/filebrowser.mmp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,116 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/group/filebrowser_extraicons.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+#
+
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/group/filebrowser_icons_aif.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+#
+
+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
--- a/filebrowser/group/group.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#
-# 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\""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/helpertools/snapshot_compare_dirs.pl	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,202 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FB.hrh	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBApp.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBAppUi.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBDocument.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBFileDlgs.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,164 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBFileEditor.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBFileListContainer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBFileListView.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBFileOps.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBFileUtils.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBModel.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBSettingViewDlg.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBStd.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/inc/FBToolbar.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/inc/FBTraces.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/filebrowser/rom/filebrowser.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -16,28 +16,25 @@
 */
 
 
-#ifndef __ORBITFILEBROWSER_IBY__
-#define __ORBITFILEBROWSER_IBY__
+#ifndef __FILEBROWSER_IBY__
+#define __FILEBROWSER_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)
-
-//#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
+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
 
 #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 // __ORBITFILEBROWSER_IBY__
+#endif // __FILEBROWSER_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/sis/FileBrowser_S60-30.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+
+
+; 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/sis/FileBrowser_S60-50.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+
+
+; 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/filebrowser/sis/FileBrowser_stub.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -29,7 +29,7 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\FileBrowser.exe"
-""-"z:\Resource\Apps\FileBrowser.mif"
+""-"z:\Resource\Apps\FileBrowser_aif.mif"
 ""-"z:\Resource\Apps\FileBrowser.rsc"
 ""-"z:\private\10003a3f\import\apps\FileBrowser_reg.rsc"
 ""-"z:\private\102828D6\backup_registration.xml"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBApp.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBAppUi.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+// 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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBDocument.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBFileDlgs.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1115 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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);
+    DrawDeferred();
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBFileEditor.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1300 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBFileListContainer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1133 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBFileListView.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,763 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBFileOps.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1162 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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("\\"));
+                    // test path.Left(iBuf2.Length()).Compare(iBuf2) - to prevent never ending recursive copy (in case of copy folder under itself)
+                    if( iRecursiveState == EFileOpCopy && path.Left(iBuf2.Length()).Compare(iBuf2) )
+                        {
+                        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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBFileUtils.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,5147 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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(EDisplayModeFullScreen);
+        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(EDisplayModeFullScreen);
+    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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBModel.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,376 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBSettingViewDlg.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,463 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/filebrowser/src/FBToolbar.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,369 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
+
--- a/filebrowser/ui/inc/driveentry.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* 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
--- a/filebrowser/ui/inc/editorview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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>
-
-class HbTextEdit;
-class HbAction;
-
-class EditorView : public HbView
-{
-    Q_OBJECT
-
-public:
-    EditorView();
-    ~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();
-
-    // 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
--- a/filebrowser/ui/inc/enginewrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
-* 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 HbProgressDialog;
-
-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 : public QObject, public MFileBrowserUI
-{
-    Q_OBJECT
-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);
-
-    void ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum);
-    void CancelProgressDialog();
-    void SetProgressValue(TInt aValue);
-
-    void ShowWaitDialog(const TDesC& aText);
-    void CancelWaitDialog();
-    void ProcessEvents();
-
-    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();
-    inline TListingMode listingMode() { return mEngine->FileUtils()->ListingMode(); }
-//    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 toolsWriteAllFiles();
-
-    void showFileCheckSums(const QModelIndex &aIndex, TFileBrowserCmdFileChecksums checksumType);
-
-private slots:
-        void progressDialogCancelled();
-        void waitDialogCancelled();
-
-private:
-    // FB engine
-    CEngine *mEngine;
-    // List of found files results for Ui
-    QStringList mFilesFound;
-    FileBrowserSettings mSettings;
-    HbProgressDialog *mProgressDialog;
-    HbProgressDialog *mWaitDialog;
-    };
-
-#endif //ENGINEWRAPPER_H
--- a/filebrowser/ui/inc/fbdrivelistviewitem.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* 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 FBDRIVELISTVIEWITEMS_H
-#define FBDRIVELISTVIEWITEMS_H
-
-#include <HbListViewItem>
-
-#include <QGraphicsWidget>
-#include <QtGlobal>
-
-class HbAbstractViewItem;
-class HbLabel;
-class HbCheckBox;
-class HbWidget;
-
-class QGraphicsLinearLayout;
-class QModelIndex;
-class QGraphicsItem;
-
-class FbDriveListViewItem : public HbListViewItem
-{
-    Q_OBJECT
-
-public:
-    FbDriveListViewItem( QGraphicsItem *parent = 0 );
-    ~FbDriveListViewItem();
-
-    virtual bool canSetModelIndex(const QModelIndex &index) const;
-    virtual HbAbstractViewItem *createItem();
-    virtual void updateChildItems();
-
-private slots:
-    void setCheckedState( int state );
-
-private:
-    virtual void polish(HbStyleParameters& params);
-
-private:
-    void init();
-
-    QGraphicsLinearLayout *hLayout;
-
-    HbLabel *mDiskNameLabel;
-    HbLabel *mSizeLabel;
-    HbLabel *mFreeLabel;
-    //HbCheckBox *mCheckBox;
-    HbLabel *mIconLabel;
-};
-
-#endif // FBDRIVELISTVIEWITEMS_H
--- a/filebrowser/ui/inc/fbdrivemodel.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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 FBDRIVEMODELH_H_
-#define FBDRIVEMODELH_H_
-
-#include "driveentry.h"
-
-#include <QAbstractListModel>
-#include <QVariant>
-
-// Forward declarations
-class EngineWrapper;
-class QModelIndex;
-class QFileIconProvider;
-class QObject;
-
-class FbDriveModel : public QAbstractListModel
-{
-    Q_OBJECT
-
-public:
-    explicit FbDriveModel(EngineWrapper *engineWrapper, QObject *parent = 0);
-    virtual ~FbDriveModel();
-
-    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;
-
-    DriveEntry driveEntry(const QModelIndex &index) const;
-    QString driveLetter( const QModelIndex &index ) const;
-    QString mediaTypeString(const QModelIndex &index) const;
-
-private:
-    EngineWrapper *mEngineWrapper;
-    QFileIconProvider *mFileIconProvider;
-};
-
-
-
-#endif /* FBDRIVEMODELH_H_ */
--- a/filebrowser/ui/inc/fbdriveview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-/*
-* 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 FBDRIVEVIEWH_H_
-#define FBDRIVEVIEWH_H_
-
-#include "menuaction.h"
-#include "enginewrapper.h"
-
-#include <HbView>
-#include <HbApplication>
-
-#include <QModelIndexList>
-
-// Forward declarations
-class QFileInfo;
-class QSignalMapper;
-class QItemSelection;
-class QString;
-class QGraphicsLinearLayout;
-
-class HbListView;
-class HbListWidget;
-class HbToolBar;
-class HbLabel;
-class HbDialog;
-class HbAbstractViewItem;
-class HbMenu;
-class HbSearchPanel;
-
-class EditorView;
-class SearchView;
-class SettingsView;
-class EngineWrapper;
-class FbDriveModel;
-class FileBrowserSortFilterProxyModel;
-
-class FbDriveView : public HbView
-{
-    Q_OBJECT
-
-public:
-    explicit FbDriveView();
-    virtual ~FbDriveView();
-    void init(EngineWrapper *engineWrapper);
-
-public slots:
-    void refreshList();
-
-private:
-    void openListDialog(const QStringList &items, const QString &titleText, QObject *receiver, const char *member);
-
-    void openPropertyDialog(const QStringList &propertyList, const QString &title);
-
-    QModelIndex currentItemIndex();
-    void storeSelectedItemsOrCurrentItem();
-
-    // Menu related methods
-    void createMenu();
-    void createFileMenu();
-    void createEditMenu();
-    void createViewMenu();
-    void createToolsMenu();
-
-    void createSettingsMenuItem();
-    void createAboutMenuItem();
-    void createExitMenuItem();
-
-    void createContextMenu();
-    void createFileContextMenu();
-    void createEditContextMenu();
-    void createViewContextMenu();
-    void createDiskAdminContextMenu();
-
-private slots:
-    // menu action slots
-    // file menu
-    void fileOpenDrive();
-    void fileSearch();
-
-    void fileProperties();
-
-    void fileSetAttributes();
-
-    // edit menu
-    void editSnapShotToE();
-
-    // view menu
-    void viewRefresh();
-
-    // disk admin menu
-    void diskAdminSetDrivePassword();
-    void diskAdminSetDrivePasswordNew(HbAction *);
-    void doDiskAdminSetDrivePassword(HbAction *);
-
-    void diskAdminUnlockDrive();
-    void doDiskAdminUnlockDrive(HbAction *);
-
-    void diskAdminClearDrivePassword();
-    void doDiskAdminClearDrivePassword(HbAction *);
-
-    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 *);
-
-    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 *);
-
-    void toolsErrorSimulatePanic();
-    void doToolsErrorSimulatePanicCode(HbAction *);
-    void doToolsErrorSimulatePanic(HbAction *);
-
-    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 about();
-    
-signals:
-    void aboutToShowFileView();
-    void aboutToShowSettingsView();
-    void aboutToShowEditorView(const QString &, bool);
-    void aboutToShowSearchView(const QString &);
-    void aboutToSimulateLeave(int);
-
-private slots:
-    void updateOptionMenu();
-    void updateContextMenu();
-    void selectionChanged(const QItemSelection &, const QItemSelection &);
-    void activated(const QModelIndex& index);
-
-    void onLongPressed(HbAbstractViewItem *, QPointF);
-
-private:
-    EngineWrapper *mEngineWrapper;
-
-    HbListView *mListView;
-    HbLabel *mNaviPane;
-
-    QGraphicsLinearLayout *mMainLayout;
-
-    // file info contains all needed information of selected file from file model
-    QModelIndexList mClipboardIndexes;
-    QModelIndexList mSelectionIndexes;
-
-    FbDriveModel *mFbDriveModel;
-    OptionMenuActions mOptionMenuActions;
-    ContextMenuActions mContextMenuActions;
-    HbMenu *mContextMenu;
-
-    // flags
-    bool mLocationChanged;
-    // flag for removing source file after copied to target file
-    bool mRemoveFileAfterCopied;
-    bool mClipBoardInUse;
-    bool mFolderContentChanged;
-    QModelIndex mCurrentIndex;
-
-    // temporarily storage
-    QString mOldPassword;
-    QString mPanicCategory;
-    QString mAbsoluteFilePath;
-    OverwriteOptions mOverwriteOptions;
-    QModelIndex mModelIndex;
-    QString mNewFileName;
-    bool mProceed;
-    bool mEraseMBR;
-};
-
-
-
-#endif /* FBDRIVEVIEWH_H_ */
--- a/filebrowser/ui/inc/fbfilelistviewitem.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* 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 FBFILELISTVIEWITEM_H
-#define FBFILELISTVIEWITEM_H
-
-#include <HbListViewItem>
-
-#include <QGraphicsWidget>
-#include <QtGlobal>
-
-class HbAbstractViewItem;
-class HbLabel;
-class HbCheckBox;
-class HbWidget;
-
-class QGraphicsLinearLayout;
-class QModelIndex;
-class QGraphicsItem;
-
-class FbFileListViewItem : public HbListViewItem
-{
-    Q_OBJECT
-
-public:
-    FbFileListViewItem( QGraphicsItem *parent = 0 );
-    ~FbFileListViewItem();
-
-    virtual bool canSetModelIndex(const QModelIndex &) const;
-    virtual HbAbstractViewItem *createItem();
-    virtual void updateChildItems();
-
-private slots:
-    void setCheckedState(int state);
-
-private:
-    virtual void polish(HbStyleParameters &);
-
-private:
-    void init();
-
-    QGraphicsLinearLayout *hLayout;
-
-    HbLabel *mDiskNameLabel;
-    HbLabel *mSizeLabel;
-    HbLabel *mFreeLabel;
-    //HbCheckBox *mCheckBox;
-    HbLabel *mIconLabel;
-};
-
-#endif // FBFILELISTVIEWITEM_H
--- a/filebrowser/ui/inc/fbfilemodel.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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 FBFILEMODELH_H_
-#define FBFILEMODELH_H_
-
-#include <QAbstractListModel>
-
-// Forward declarations
-class EngineWrapper;
-class QModelIndex;
-class QFileIconProvider;
-
-class FbFileModel : public QAbstractListModel
-{
-    Q_OBJECT
-
-public:
-    explicit FbFileModel(EngineWrapper *engineWrapper, QObject *parent = 0);
-    virtual ~FbFileModel();
-
-    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 /* FBFILEMODELH_H_ */
--- a/filebrowser/ui/inc/fbfileview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,248 +0,0 @@
-/*
-* 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 FBFILEVIEWH_H_
-#define FBFILEVIEWH_H_
-
-#include "menuaction.h"
-#include "enginewrapper.h"
-
-#include <HbView>
-#include <HbApplication>
-
-#include <QModelIndexList>
-
-// Forward declarations
-class QFileInfo;
-class QSignalMapper;
-class QItemSelection;
-class QString;
-class QGraphicsLinearLayout;
-
-class HbListView;
-class HbListWidget;
-class HbToolBar;
-class HbLabel;
-class HbDialog;
-class HbAbstractViewItem;
-class HbMenu;
-class HbSearchPanel;
-
-class EditorView;
-class SearchView;
-class SettingsView;
-class EngineWrapper;
-class FbFileModel;
-class FileBrowserSortFilterProxyModel;
-
-class FbFileView : public HbView
-{
-    Q_OBJECT
-
-public:
-    explicit FbFileView();
-    virtual ~FbFileView();
-    void init(EngineWrapper *engineWrapper);
-
-public slots:
-    void refreshList();
-
-private:
-    void fileOverwriteDialog();
-    void openListDialog(const QStringList &items, const QString &titleText, QObject *receiver, const char *member);
-
-    void openPropertyDialog(const QStringList &propertyList, const QString &title);
-
-    QModelIndex currentItemIndex();
-    void storeSelectedItemsOrCurrentItem();
-
-    // Menu related methods
-    void createMenu();
-    void createFileMenu();
-    void createEditMenu();
-    void createViewMenu();
-    void createToolsMenu();
-
-    void createSelectionMenuItem();
-    void createSettingsMenuItem();
-    void createAboutMenuItem();
-    void createExitMenuItem();
-
-    void createContextMenu();
-    void createFileContextMenu();
-    void createEditContextMenu();
-    void createViewContextMenu();
-    void createToolBar();
-
-private slots:
-    // menu action slots
-    // file menu
-    void fileBackMoveUp();
-    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 filterCriteriaChanged(const QString &);
-    void clearFilterCriteria();
-    void viewRefresh();
-
-    // tools menu
-    void toolsAllAppsToTextFile();
-    void toolsAllFilesToTextFile();
-//    void toolsAvkonIconCacheEnable();
-//    void toolsAvkonIconCacheDisable();
-
-    void toolsDisableExtendedErrors();
-    void toolsDumpMsgStoreWalk();
-    void toolsEditDataTypes();
-    void toolsEnableExtendedErrors();
-
-    void toolsErrorSimulateLeave();
-    void doToolsErrorSimulateLeave(HbAction *);
-
-    void toolsErrorSimulatePanic();
-    void doToolsErrorSimulatePanicCode(HbAction *);
-    void doToolsErrorSimulatePanic(HbAction *);
-
-    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 aboutToShowDriveView();
-    void aboutToShowSettingsView();
-    void aboutToShowEditorView(const QString &, bool);
-    void aboutToShowSearchView(const QString &);
-    void aboutToSimulateLeave(int);
-
-private slots:
-    void updateOptionMenu();
-    void updateContextMenu();
-    void selectionChanged(const QItemSelection &, const QItemSelection &);
-    void activated(const QModelIndex& index);
-    void activateSelectionMode();
-    void deActivateSelectionMode();
-    void onLongPressed(HbAbstractViewItem *, QPointF);
-
-    void fileOpen(HbAction *);
-    void fileOverwrite(HbAction *);
-    void fileOverwritePostfix(HbAction *);
-
-private:
-    EngineWrapper *mEngineWrapper;
-
-    HbListView *mListView;
-    HbToolBar *mToolBar;
-    HbLabel *mNaviPane;
-    HbSearchPanel *mSearchPanel;
-
-    QGraphicsLinearLayout *mMainLayout;
-
-    // file info contains all needed information of selected file from file model
-    QModelIndexList mClipboardIndexes;
-    QModelIndexList mSelectionIndexes;
-
-    FbFileModel *mFbFileModel;
-    FileBrowserSortFilterProxyModel *mSortFilterProxyModel;
-    OptionMenuActions mOptionMenuActions;
-    ContextMenuActions mContextMenuActions;
-    HbMenu *mContextMenu;
-    HbAction *mToolbarBackAction;
-
-    // flags
-    bool mItemHighlighted;
-    bool mLocationChanged;
-    // flag for removing source file after copied to target file
-    bool mRemoveFileAfterCopied;
-    bool mClipBoardInUse;
-    bool mFolderContentChanged;
-    QModelIndex mCurrentIndex;
-
-    // temporarily storage
-    QString mOldPassword;
-    QString mPanicCategory;
-    QString mAbsoluteFilePath;
-    OverwriteOptions mOverwriteOptions;
-    QModelIndex mModelIndex;
-    QString mNewFileName;
-    bool mProceed;
-    bool mEraseMBR;
-};
-
-
-
-#endif /* FBFILEVIEWH_H_ */
--- a/filebrowser/ui/inc/fbmainwindow.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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 FBMAINWINDOW_H_
-#define FBMAINWINDOW_H_
-
-#include <hbmainwindow.h>
-
-class HbApplication;
-class HbView;
-
-class EngineWrapper;
-class FbDriveView;
-class FbFileView;
-class SettingsView;
-class EditorView;
-class SearchView;
-
-class FbMainWindow : public HbMainWindow
-{
-    Q_OBJECT
-
-public:
-    explicit FbMainWindow(QWidget *parent = 0);
-    virtual ~FbMainWindow();
-    
-    void init();
-
-private slots:
-    void openPreviousBrowserView();
-    void openFileBrowserView(bool);
-    void openDriveView();
-    void openFileView();
-    void openSettingsView();
-    void openEditorView(const QString &, bool);
-    void openSearchView(const QString &);
-    
-private:
-    EngineWrapper *mEngineWrapper;
-    FbDriveView *mDriveView;
-    FbFileView *mFileView;
-    SettingsView *mSettingsView;
-    EditorView *mEditorView;
-    SearchView *mSearchView;
-    HbView *mPreviousView;
-};
-
-#endif /* FBMAINWINDOW_H_ */
--- a/filebrowser/ui/inc/filebrowsersettings.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* 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_ */
--- a/filebrowser/ui/inc/filebrowsersortfilterproxymodel.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/*
-* 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 FILEBROWSERSORTFILTERPROXYMODEL_H
-#define FILEBROWSERSORTFILTERPROXYMODEL_H
-
-#include <QString>
-#include <QSortFilterProxyModel>
-
-class FileBrowserSortFilterProxyModel : public QSortFilterProxyModel
-{
-    Q_OBJECT
-
-public:
-    FileBrowserSortFilterProxyModel(QObject *parent = 0);
-
-    QString filterCriteria() const { return mFilterCriteria; }
-    void setFilterCriteria(const QString &criteria);
-
-protected:
-    bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
-
-private:
-    QString mFilterCriteria;
-};
-
-#endif // FILEBROWSERSORTFILTERPROXYMODEL_H
--- a/filebrowser/ui/inc/fileentry.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* 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
--- a/filebrowser/ui/inc/menuaction.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,407 +0,0 @@
-/*
-* 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
-
-class HbMenu;
-class HbAction;
-
-class OptionMenuActions
-{
-public:
-    OptionMenuActions() :
-            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),
-            mToolsLocalConnectivityMenu(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)
-    {
-
-    }
-
-    ~OptionMenuActions() { }
-public:
-    //File menu operations
-    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;
-};
-
-
-class ContextMenuActions
-{
-public:
-    ContextMenuActions() :
-            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)
-    {
-
-    }
-
-    ~ContextMenuActions() { }
-public:
-    //File menu operations
-    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;
-};
-
-
-#endif // MENUACTION_H
--- a/filebrowser/ui/inc/notifications.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* 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 HbProgressDialog;
-
-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);
-};
-
-#endif // NOTIFICATIONS_H_
--- a/filebrowser/ui/inc/searchview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* 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>
-
-#include <QDateTime>
-
-class QStringList;
-
-class EngineWrapper;
-class HbDataForm;
-class HbDataFormModelItem;
-class HbProgressDialog;
-
-/**
-  * 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:
-    explicit SearchView(EngineWrapper &engineWrapper);
-    ~SearchView();
-    void open(const QString &path);
-
-signals:
-    void finished(bool ok);
-
-private slots:
-    void accept();
-    void reject();
-
-private:
-    void initDataForm();
-    void createToolbar();
-    void loadAttributes();
-    void readFormItems();
-
-    void startFileSearch();
-    void fileSearchResults();
-
-private:
-    /* 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;
-
-    HbProgressDialog *mProgressDialog;
-};
-
-#endif // SEARCHVIEW_H
--- a/filebrowser/ui/inc/settingsview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* 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 EngineWrapper;
-class FileBrowserSettings;
-
-class SettingsView : public HbView
-{
-    Q_OBJECT
-
-public:
-    SettingsView(EngineWrapper &engineWrapper);
-    virtual ~SettingsView();
-
-    void initDataForm();
-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 createToolbar();
-    void constructMenu();
-    void loadSettings(const FileBrowserSettings &settings);
-    void saveSettings(FileBrowserSettings &settings);
-
-private:
-    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
--- a/filebrowser/ui/src/driveentry.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
-* 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;
-}
-
-// ---------------------------------------------------------------------------
--- a/filebrowser/ui/src/editorview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-/*
-* 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 <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() :
-    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);
-}
-
--- a/filebrowser/ui/src/enginewrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,808 +0,0 @@
-/*
-* 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 "fbfileview.h"
-#include "searchview.h"
-#include "filebrowsersettings.h"
-#include "settingsview.h"
-
-#include <HbProgressDialog>
-
-#include <QString>
-#include <QFileInfo>
-#include <QModelIndex>
-
-// ---------------------------------------------------------------------------
-
-EngineWrapper::EngineWrapper()
-    : mEngine(0),
-    mFilesFound(),
-    mSettings(0),
-    mProgressDialog(0),
-    mWaitDialog(0)
-{
-}
-
-// ---------------------------------------------------------------------------
-
-EngineWrapper::~EngineWrapper()
-{
-    if(mEngine != NULL) {
-        TRAP_IGNORE(mEngine->DeActivateEngineL());
-        delete mEngine;
-    } 
-    if (mProgressDialog)
-        delete mProgressDialog;
-
-    if (mWaitDialog)
-        delete mWaitDialog;
-}
-
-// ---------------------------------------------------------------------------
-
-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::toolsWriteAllFiles()
-{
-    mEngine->FileUtils()->WriteAllFilesL();
-}
-
-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 qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
-    Notifications::showErrorNote(qText, 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 qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
-    Notifications::showConfirmationNote(qText, aNoTimeout);
-}
-
-void EngineWrapper::ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum )
-{
-    const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
-    if (!mProgressDialog) {
-        mProgressDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
-        QObject::connect(mProgressDialog, SIGNAL(cancelled()), this, SLOT(progressDialogCancelled()));
-    }
-
-    mProgressDialog->setText(qText);
-    mProgressDialog->setMinimum(aMinimum);
-    mProgressDialog->setMaximum(aMaximum);
-    mEngine->FileUtils()->SetAllowProcessing(true);
-    mProgressDialog->show();
-}
-
-void EngineWrapper::CancelProgressDialog()
-{
-    if (mProgressDialog) {
-        QObject::disconnect(mProgressDialog, SIGNAL(cancelled()), this, SLOT(progressDialogCancelled()));
-        mProgressDialog->cancel();
-        QObject::connect(mProgressDialog, SIGNAL(cancelled()), this, SLOT(progressDialogCancelled()));
-    }
-}
-
-void EngineWrapper::SetProgressValue(TInt aValue)
-{
-    if (mProgressDialog)
-        mProgressDialog->setProgressValue(aValue);
-}
-
-void EngineWrapper::progressDialogCancelled()
-{
-    mEngine->FileUtils()->DialogDismissedL();
-}
-
-void EngineWrapper::ShowWaitDialog(const TDesC& aDescText)
-{
-    const QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
-    if (!mWaitDialog) {
-        mWaitDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
-        QObject::connect(mWaitDialog, SIGNAL(cancelled()), this, SLOT(waitDialogCancelled()));
-    }
-
-    mWaitDialog->setText(qText);
-    mEngine->FileUtils()->SetAllowProcessing(true);
-    //mWaitDialog->setAttribute(Qt::WA_DeleteOnClose);
-    mWaitDialog->show();
-}
-
-void EngineWrapper::CancelWaitDialog()
-{
-    if (mWaitDialog)
-        mWaitDialog->cancel();
-}
-
-void EngineWrapper::waitDialogCancelled()
-{
-    mEngine->FileUtils()->SetAllowProcessing(false);
-}
-
-void EngineWrapper::ProcessEvents()
-{
-    qApp->processEvents();
-}
-
-TBool EngineWrapper::ShowConfirmationQuery(const TDesC& aDescText)
-{
-    QString qText = QString::fromUtf16(aDescText.Ptr(), aDescText.Length());
-    return Notifications::showConfirmationQuery(qText);
-}
-
-// ---------------------------------------------------------------------------
--- a/filebrowser/ui/src/fbdrivelistviewitem.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
-* 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 "fbdrivelistviewitem.h"
-#include "driveentry.h"
-#include "fbdrivemodel.h"
-
-#include <hblabel.h>
-#include <hbcheckbox.h>
-#include <hbabstractitemview.h>
-
-#include <QString>
-#include <QStringList>
-#include <QFileIconProvider>
-#include <QGraphicsLinearLayout>
-#include <QRectF>
-#include <QPainter>
-
-FbDriveListViewItem::FbDriveListViewItem(QGraphicsItem *parent) :
-    HbListViewItem(parent),
-    hLayout(0),
-    mDiskNameLabel(0),
-    mSizeLabel(0),
-    mFreeLabel(0),
-    mIconLabel(0)
-{
-}
-
-FbDriveListViewItem::~FbDriveListViewItem()
-{
-}
-
-void FbDriveListViewItem::polish(HbStyleParameters& params)
-{
-    Q_UNUSED(params);
-}
-
-bool FbDriveListViewItem::canSetModelIndex(const QModelIndex &index) const
-{
-    Q_UNUSED(index);
-    return true;
-}
-
-
-HbAbstractViewItem *FbDriveListViewItem::createItem()
-{
-    return new FbDriveListViewItem(*this);
-}
-
-void FbDriveListViewItem::updateChildItems()
-{
-    if(!hLayout) {
-        init();
-    }
-
-    // Qt::DisplayRole
-//    QVariant displayRole = modelIndex().data(Qt::DisplayRole);
-//    QString diskName("default");
-    QStringList stringList;
-//    if (displayRole.isValid()) {
-//        if (displayRole.canConvert<QString>()) {                // EFileViewModeSimple
-//            stringList.append(displayRole.toString());
-//        } else if (displayRole.canConvert<QStringList>()) {     // EFileViewModeExtended
-//            stringList = displayRole.toStringList();
-//        }
-//        if (stringList.count() > 0)
-//            diskName = stringList[0]; //modelIndex().data( Qt::UserRole ).toString();
-//
-//        mDiskNameLabel->setPlainText(diskName/*displayString*/);
-//    }
-//    if (stringList.count() > 1)
-//        mSizeLabel->setPlainText( stringList[1] );
-
-
-    // Get the Drive Entry
-    const FbDriveModel* driveModel= qobject_cast<const FbDriveModel *>(modelIndex().model());
-    DriveEntry driveEntry = driveModel->driveEntry(modelIndex());
-
-    const QString SimpleDriveEntry("%1: <%2>");
-
-    QString diskName = SimpleDriveEntry.arg(driveEntry.driveLetter()).arg(driveEntry.mediaTypeString());
-    mDiskNameLabel->setPlainText(diskName);
-
-    const QString ExtendedDriveEntry("%1/%2 kB");
-    QString diskSize = ExtendedDriveEntry.arg(QString::number(driveEntry.volumeInfoFree()/1024))
-                                         .arg(QString::number(driveEntry.volumeInfoSize()/1024));
-    mSizeLabel->setPlainText( diskSize );
-
-    //mFreeLabel->setPlainText( stringList[2] );
-
-    //    mCheckBox->setCheckState( checkState() );
-
-    // Qt::DecorationRole
-    // QTBUG-11033 No Icon provided for QFileIconProvider::Desktop, Network, Drive on Symbian
-    QVariant decorationRole = modelIndex().data(Qt::DecorationRole);
-    if (decorationRole.isValid()) {
-        QIcon icon = qvariant_cast<QIcon>(decorationRole);
-    if( icon.isNull() ) {
-        QFileIconProvider fileIconProvider;
-        icon = fileIconProvider.icon(QFileIconProvider::File);
-    }
-    mIconLabel->setIcon(HbIcon(icon));
-    }
-}
-
-void FbDriveListViewItem::setCheckedState(int state)
-{
-    HbAbstractViewItem::setCheckState(static_cast<Qt::CheckState>(state));
-}
-
-void FbDriveListViewItem::init()
-{
-    hLayout = new QGraphicsLinearLayout();
-    hLayout->setContentsMargins(0, 0, 0, 0);
-
-    hLayout->setOrientation( Qt::Horizontal );
-    hLayout->addItem(layout());
-
-    mIconLabel = new HbLabel();
-    hLayout->addItem( mIconLabel );
-    hLayout->setAlignment( mIconLabel, Qt::AlignTop );
-    hLayout->setStretchFactor( mIconLabel, 0 );
-
-    QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout();
-    //vLayout->setContentsMargins(0, 0, 0, 0);
-    vLayout->setOrientation( Qt::Vertical );
-
-    mDiskNameLabel = new HbLabel();
-    HbFontSpec fontSpecPrimary(HbFontSpec::Primary);
-    //fontSpecPrimary.setTextHeight(18.0);
-    mDiskNameLabel->setFontSpec( fontSpecPrimary );
-    vLayout->addItem( mDiskNameLabel );
-    vLayout->setAlignment( mDiskNameLabel, Qt::AlignLeft );
-
-    mSizeLabel = new HbLabel();
-    HbFontSpec fontSpecSecondary(HbFontSpec::Secondary);
-    //fontSpecSecondary.setTextHeight(18.0);
-    mSizeLabel->setFontSpec(fontSpecSecondary);
-    vLayout->addItem( mSizeLabel );
-    vLayout->setAlignment(mSizeLabel, Qt::AlignLeft);
-
-//    mFreeLabel = new HbLabel();
-//    mFreeLabel->setFontSpec( HbFontSpec( HbFontSpec::Secondary ) );
-//    vLayout->addItem( mFreeLabel );
-//    vLayout->setAlignment( mFreeLabel, Qt::AlignLeft );
-
-    HbWidget *labelsWidget = new HbWidget();
-    labelsWidget->setLayout(vLayout);
-
-    hLayout->setAlignment( labelsWidget, Qt::AlignLeft );
-
-    hLayout->addItem( labelsWidget );
-    hLayout->setStretchFactor( labelsWidget, 1 );
-
-    //this->setMaximumHeight( mDiskNameLabel->preferredHeight() );
-    //setMaximumHeight( mIconLabel->preferredHeight() );
-
-    setLayout( hLayout );
-}
--- a/filebrowser/ui/src/fbdrivemodel.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
-* 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 "fbdrivemodel.h"
-#include "enginewrapper.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.
-  */
-FbDriveModel::FbDriveModel(EngineWrapper *engineWrapper, QObject *parent) :
-    QAbstractListModel(parent),
-    mEngineWrapper(engineWrapper),
-    mFileIconProvider(0)
-{
-    mFileIconProvider = new QFileIconProvider();
-}
-
-/**
-  Destroys this file browser custom system model.
-  */
-FbDriveModel::~FbDriveModel()
-{  
-    if (mFileIconProvider) {
-        delete mFileIconProvider;
-    }
-}
-
-/**
-  \reimp
-  */
-int FbDriveModel::rowCount(const QModelIndex &parent) const
-{
-    Q_UNUSED(parent);
-    return mEngineWrapper->itemCount();
-}
-
-/**
-  \reimp
-  */
-QVariant FbDriveModel::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;
-            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));
-
-            }
-            return listItem;
-        }
-    case Qt::DecorationRole: {
-            if (mEngineWrapper) {
-                QIcon icon;
-                //TODO Drive ico has to be provided, for some reason it is not visible
-                icon = mFileIconProvider->icon(QFileIconProvider::Drive);
-                return QVariant(icon);
-            }
-        }
-    }
-    return QVariant();
-}
-
-/**
-  \reimp
-  */
-QVariant FbDriveModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
-    Q_UNUSED(section);
-    Q_UNUSED(orientation);
-    Q_UNUSED(role);
-
-    // TODO, implement or remove
-    return QVariant();
-}
-
-
-DriveEntry FbDriveModel::driveEntry(const QModelIndex &index) const
-{
-    return mEngineWrapper->getDriveEntry(index);
-}
-
-QString FbDriveModel::driveLetter(const QModelIndex &index) const
-{
-    QString diskLetter;
-    if (index.row() >= 0 && index.row() < mEngineWrapper->itemCount()) {
-        DriveEntry driveEntry(mEngineWrapper->getDriveEntry(index));
-        diskLetter = driveEntry.driveLetter();
-    }
-    return diskLetter;
-}
-
-QString FbDriveModel::mediaTypeString(const QModelIndex &index) const
-{
-    QString mediaTypeString;
-    if (index.row() >= 0 && index.row() < mEngineWrapper->itemCount()) {
-        DriveEntry driveEntry(mEngineWrapper->getDriveEntry(index));
-        mediaTypeString = driveEntry.mediaTypeString();
-    }
-    return mediaTypeString;
-}
-
-// ---------------------------------------------------------------------------
--- a/filebrowser/ui/src/fbdriveview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1308 +0,0 @@
-/*
-* 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 "fbdriveview.h"
-#include "settingsview.h"
-#include "editorview.h"
-#include "searchview.h"
-#include "enginewrapper.h"
-#include "notifications.h"
-
-#include "fbdrivemodel.h"
-#include "filebrowsersortfilterproxymodel.h"
-#include "fbdrivelistviewitem.h"
-
-#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 <QString>
-#include <QGraphicsLinearLayout>
-#include <QItemSelection>
-#include <QDebug>
-//TODO check if needed to do this way
-#include <FB.hrh>
-
-// ---------------------------------------------------------------------------
-
-FbDriveView::FbDriveView() :
-    mEngineWrapper(0),
-    mListView(0),
-    mNaviPane(0),
-    mMainLayout(0),
-    mFbDriveModel(0),
-    mOptionMenuActions(),
-    mContextMenuActions(),
-    mContextMenu(0),
-    mLocationChanged(false),
-    mRemoveFileAfterCopied(false),
-//    mClipBoardInUse(false),
-    mFolderContentChanged(false),
-    mCurrentIndex(),
-    mOldPassword(),
-    mPanicCategory(),
-    mAbsoluteFilePath(),
-    mOverwriteOptions(),
-    mModelIndex(),
-    mNewFileName(),
-    mProceed(false),
-    mEraseMBR(false)
-{
-    setTitle("File Browser");
-
-    createMenu();
-    createContextMenu();
-}
-
-// ---------------------------------------------------------------------------	
-
-void FbDriveView::init(EngineWrapper *engineWrapper)
-{
-    mEngineWrapper = engineWrapper;
-
-    mListView = new HbListView(this);
-    mListView->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
-
-    mListView->setItemPrototype(new FbDriveListViewItem(mListView));
-
-    mFbDriveModel = new FbDriveModel(mEngineWrapper);
-    if (!mListView->model()) {
-        mEngineWrapper->refreshView();
-        mListView->setModel(mFbDriveModel);
-    }
-
-    //mListView->setRootIndex(mFileSystemModel->index(startPath));
-    //mListView->setRootIndex(model->index());
-
-//    mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
-
-    connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex)));
-    connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)),
-            this, SLOT(onLongPressed(HbAbstractViewItem*, QPointF)));
-
-    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 naviPane into layout:
-    mMainLayout = new QGraphicsLinearLayout(Qt::Vertical);
-    mMainLayout->addItem(mNaviPane);
-    mMainLayout->addItem(mListView);
-    setLayout(mMainLayout);
-}
-
-// ---------------------------------------------------------------------------
-
-FbDriveView::~FbDriveView()
-{  
-//    if (mEngineWrapper) {
-//        delete mEngineWrapper;
-//    }
-    if (mContextMenu) {
-        mContextMenu->deleteLater();
-    }
-
-    delete mFbDriveModel;
-    delete mListView;
-}
-
-/**
-  Initial setup for options menu.
-  Dynamic menu update during the runtime is performed by updateOptionMenu() which
-  to menu's aboutToShow() signal.
-  */
-void FbDriveView::createMenu()
-{
-    createFileMenu();
-    createEditMenu();
-    createViewMenu();
-    createToolsMenu();
-
-    createSettingsMenuItem();
-    createAboutMenuItem();
-    createExitMenuItem();
-
-    // menu dynamic update
-    connect(menu(), SIGNAL(aboutToShow()), this, SLOT(updateOptionMenu()));
-}
-
-/**
-  Initial setup for File submenu
-  */
-void FbDriveView::createFileMenu()
-{
-    mOptionMenuActions.mFileMenu = menu()->addMenu("File");
-
-//    mOptionMenuActions.mFileOpenDrive = mOptionMenuActions.mFileMenu->addAction("Open drive", this, SLOT(fileOpenDrive()));
-    mOptionMenuActions.mFileSearch = mOptionMenuActions.mFileMenu->addAction("Search...", this, SLOT(fileSearch()));
-    //mOptionMenuActions.mFileSearch->setVisible(false);
-
-    //mOptionMenuActions.mFileNewMenu = mOptionMenuActions.mFileMenu->addMenu("New");
-
-    mOptionMenuActions.mFileSetAttributes = mOptionMenuActions.mFileMenu->addAction("Set attributes...", this, SLOT(fileSetAttributes()));
-    mOptionMenuActions.mFileSetAttributes->setVisible(false);
-}
-
-/**
-  Initial setup for Edit submenu
-  */
-void FbDriveView::createEditMenu()
-{
-    mOptionMenuActions.mEditMenu = menu()->addMenu("Edit");
-
-    mOptionMenuActions.mEditSnapShotToE = mOptionMenuActions.mEditMenu->addAction("Snap shot to E:", this, SLOT(editSnapShotToE()));
-    mOptionMenuActions.mEditSnapShotToE->setVisible(false);
-}
-
-/**
-  Initial setup for View submenu
-  */
-void FbDriveView::createViewMenu()
-{
-    mOptionMenuActions.mViewMenu = menu()->addMenu("View");
-    //mOptionMenuActions.mViewMenu->menuAction()->setVisible(false);
-
-    //mOptionMenuActions.mViewFilterEntries = mOptionMenuActions.mViewMenu->addAction("Filter entries", this, SLOT(viewFilterEntries()));
-    mOptionMenuActions.mViewRefresh = mOptionMenuActions.mViewMenu->addAction("Refresh", this, SLOT(viewRefresh()));
-}
-
-/**
-  Initial setup for Tools submenu
-  */
-void FbDriveView::createToolsMenu()
-{
-    mOptionMenuActions.mToolsMenu = menu()->addMenu("Tools");
-
-    mOptionMenuActions.mToolsAllAppsToTextFile = mOptionMenuActions.mToolsMenu->addAction("All apps to a text file", this, SLOT(toolsAllAppsToTextFile()));
-    mOptionMenuActions.mToolsAllAppsToTextFile->setVisible(false);
-    mOptionMenuActions.mToolsAllFilesToTextFile = mOptionMenuActions.mToolsMenu->addAction("All files to a text file", this, SLOT(toolsAllFilesToTextFile()));
-    //mOptionMenuActions.mToolsAllFilesToTextFile->setVisible(false);
-
-//    mOptionMenuActions.mToolsAvkonIconCacheMenu = mOptionMenuActions.mToolsMenu->addMenu("Avkon icon cache");
-//    mOptionMenuActions.mToolsAvkonIconCacheMenu->menuAction()->setVisible(false);
-//    mOptionMenuActions.mToolsAvkonIconCacheEnable = mOptionMenuActions.mToolsAvkonIconCacheMenu->addAction("Enable", this, SLOT(toolsAvkonIconCacheEnable()));
-//    mOptionMenuActions.mToolsAvkonIconCacheDisable = mOptionMenuActions.mToolsAvkonIconCacheMenu->addAction("Clear and disable", this, SLOT(toolsAvkonIconCacheDisable()));
-
-    mOptionMenuActions.mToolsDisableExtendedErrors = mOptionMenuActions.mToolsMenu->addAction("Disable extended errors", this, SLOT(toolsDisableExtendedErrors()));
-    mOptionMenuActions.mToolsDumpMsgStoreWalk = mOptionMenuActions.mToolsMenu->addAction("Dump msg. store walk", this, SLOT(toolsDumpMsgStoreWalk()));
-    mOptionMenuActions.mToolsDumpMsgStoreWalk->setVisible(false);
-    mOptionMenuActions.mToolsEditDataTypes = mOptionMenuActions.mToolsMenu->addAction("Edit data types", this, SLOT(toolsEditDataTypes()));
-    mOptionMenuActions.mToolsEditDataTypes->setVisible(false);
-    mOptionMenuActions.mToolsEnableExtendedErrors = mOptionMenuActions.mToolsMenu->addAction("Enable extended errors", this, SLOT(toolsEnableExtendedErrors()));
-
-    mOptionMenuActions.mToolsErrorSimulateMenu = mOptionMenuActions.mToolsMenu->addMenu("Error simulate");
-    mOptionMenuActions.mToolsErrorSimulateLeave = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Leave", this, SLOT(toolsErrorSimulateLeave()));
-    mOptionMenuActions.mToolsErrorSimulatePanic = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Panic", this, SLOT(toolsErrorSimulatePanic()));
-    mOptionMenuActions.mToolsErrorSimulatePanic->setVisible(false);
-    mOptionMenuActions.mToolsErrorSimulateException = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Exception", this, SLOT(toolsErrorSimulateException()));
-
-//    mOptionMenuActions.mLocalConnectivityMenu = mOptionMenuActions.mToolsMenu->addMenu("Local connectivity");
-//    mOptionMenuActions.mToolsLocalConnectivityActivateInfrared = mOptionMenuActions.mLocalConnectivityMenu->addAction("Activate infrared", this, SLOT(toolsLocalConnectivityActivateInfrared()));
-//    mOptionMenuActions.mToolsLocalConnectivityLaunchBTUI = mOptionMenuActions.mLocalConnectivityMenu->addAction("Launch BT UI", this, SLOT(toolsLocalConnectivityLaunchBTUI()));
-//    mOptionMenuActions.mToolsLocalConnectivityLaunchUSBUI = mOptionMenuActions.mLocalConnectivityMenu->addAction("Launch USB UI", this, SLOT(toolsLocalConnectivityLaunchUSBUI()));
-
-    mOptionMenuActions.mToolsMessageAttachmentsMenu = mOptionMenuActions.mToolsMenu->addMenu("Message attachments");
-    mOptionMenuActions.mToolsMessageAttachmentsMenu->menuAction()->setVisible(false);
-    mOptionMenuActions.mToolsMessageInbox = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Inbox", this, SLOT(toolsMessageInbox()));
-    mOptionMenuActions.mToolsMessageDrafts = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Drafts", this, SLOT(toolsMessageDrafts()));
-    mOptionMenuActions.mToolsMessageSentItems = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Sent items", this, SLOT(toolsMessageSentItems()));
-    mOptionMenuActions.mToolsMessageOutbox = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Outbox", this, SLOT(toolsMessageOutbox()));
-
-    mOptionMenuActions.mToolsMemoryInfo = mOptionMenuActions.mToolsMenu->addAction("Memory info", this, SLOT(toolsMemoryInfo()));
-    mOptionMenuActions.mToolsMemoryInfo->setVisible(false);
-
-    mOptionMenuActions.mToolsSecureBackupMenu = mOptionMenuActions.mToolsMenu->addMenu("Secure backup");
-    mOptionMenuActions.mToolsSecureBackupMenu->menuAction()->setVisible(false);
-    mOptionMenuActions.mToolsSecureBackStart = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Start backup", this, SLOT(toolsSecureBackStart()));
-    mOptionMenuActions.mToolsSecureBackRestore = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Start restore", this, SLOT(toolsSecureBackRestore()));
-    mOptionMenuActions.mToolsSecureBackStop = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Stop", this, SLOT(toolsSecureBackStop()));
-
-    mOptionMenuActions.mToolsSetDebugMask = mOptionMenuActions.mToolsMenu->addAction("Set debug mask", this, SLOT(toolsSetDebugMaskQuestion()));
-    mOptionMenuActions.mToolsShowOpenFilesHere = mOptionMenuActions.mToolsMenu->addAction("Show open files here", this, SLOT(toolsShowOpenFilesHere()));
-    mOptionMenuActions.mToolsShowOpenFilesHere->setVisible(false);
-}
-
-/**
-  Creates Setting menu item in option menu
-  */
-void FbDriveView::createSettingsMenuItem()
-{
-    mOptionMenuActions.mSetting = menu()->addAction("Settings...");
-    connect(mOptionMenuActions.mSetting, SIGNAL(triggered()), this, SIGNAL(aboutToShowSettingsView()));
-}
-
-
-/**
-  Creates About menu item in option menu
-  */
-void FbDriveView::createAboutMenuItem()
-{
-    // about note
-    mOptionMenuActions.mAbout = menu()->addAction("About");
-    connect(mOptionMenuActions.mAbout, SIGNAL(triggered()), this, SLOT(about()));
-}
-
-/**
-  Creates Exit menu item in option menu
-  */
-void FbDriveView::createExitMenuItem()
-{
-    // application exit
-    mOptionMenuActions.mExit = menu()->addAction("Exit");
-    connect(mOptionMenuActions.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 FbDriveView::updateOptionMenu()
-{
-    bool isFileItemListEmpty = mFbDriveModel->rowCount() == 0;
-//    bool isDriveListViewActive = true; //mEngineWrapper->isDriveListViewActive();
-    bool isNormalModeActive = true;       //iModel->FileUtils()->IsNormalModeActive();
-//    bool isCurrentDriveReadOnly = mEngineWrapper->isCurrentDriveReadOnly();   //iModel->FileUtils()->IsCurrentDriveReadOnly();
-//    bool isCurrentItemDirectory = mEngineWrapper->getFileEntry(currentItemIndex()).isDir();
-    // bool currentSelected = true;    //iContainer->ListBox()->View()->ItemIsSelected(iContainer->ListBox()->View()->CurrentItemIndex());
-//    bool isAllSelected = mListView->selectionModel()->selection().count() == mFbDriveModel->rowCount();
-    //bool isNoneSelected = mListView->selectionModel()->selection().count() != 0;
-//    bool hasSelectedItems = mListView->selectionModel()->selection().count() != 0;
-    //bool isSelectionMode = mOptionMenuActions.mSelection && mOptionMenuActions.mSelection->isChecked();
-    bool isClipBoardEmpty = !mEngineWrapper->isClipBoardListInUse();
-    bool showSnapShot = false;           //iModel->FileUtils()->DriveSnapShotPossible();
-
-    bool showEditMenu(true);
-    if (!showSnapShot || isFileItemListEmpty && isClipBoardEmpty)
-        showEditMenu = false;
-    else
-        showEditMenu = true;
-
-    mOptionMenuActions.mEditMenu->menuAction()->setVisible(showEditMenu);
-
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileOpen, isFileItemListEmpty || isDriveListViewActive || isCurrentItemDirectory);
-//    mOptionMenuActions.mFileOpenDrive->setVisible( !(isFileItemListEmpty || !isDriveListViewActive));
-
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileView, isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory || isDriveListViewActive);
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileEdit, isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory || isDriveListViewActive);
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileSendTo, isFileItemListEmpty || driveListActive || isCurrentItemDirectory);
-
-    // TODO mOptionMenuActions.mFileCompress->setVisible(!(isCurrentDriveReadOnly || isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory || isDriveListViewActive));
-    // TODO mOptionMenuActions.mFileDecompress->setVisible(!(isCurrentDriveReadOnly || isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory || isDriveListViewActive));
-
-    // TODO mOptionMenuActions.mEditSnapShotToE->setVisible(isDriveListViewActive);
-
-    // TODO mOptionMenuActions.mViewSort->setVisible(!(!isNormalModeActive || isDriveListViewActive || isFileItemListEmpty));
-    // TODO mOptionMenuActions.mViewOrder->setVisible(!(!isNormalModeActive || isDriveListViewActive || isFileItemListEmpty));
-    mOptionMenuActions.mViewRefresh->setVisible(isNormalModeActive);
-    //mOptionMenuActions.mViewFilterEntries->setVisible(!isFileItemListEmpty);
-
-    // 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();
-    mOptionMenuActions.mToolsDisableExtendedErrors->setVisible(noExtendedErrorsAllowed);
-    mOptionMenuActions.mToolsEnableExtendedErrors->setVisible(!noExtendedErrorsAllowed);
-
-//    bool infraRedAllowed = mEngineWrapper->FileExists(KIRAppPath);
-//    bool bluetoothAllowed = mEngineWrapper->FileExists(KBTAppPath);
-//    bool usbAllowed = mEngineWrapper->FileExists(KUSBAppPath);
-//
-//    bool noLocalCon = !infraRedAllowed && !bluetoothAllowed && !usbAllowed;
-//    mOptionMenuActions.mToolsLocalConnectivityMenu->menuAction()->setVisible(!noLocalCon);
-//
-//    mOptionMenuActions.mToolsLocalConnectivityActivateInfrared->setVisible(infraRedAllowed);
-//    mOptionMenuActions.mToolsLocalConnectivityLaunchBTUI->setVisible(bluetoothAllowed);
-//    mOptionMenuActions.mToolsLocalConnectivityLaunchUSBUI->setVisible(usbAllowed);
-}
-
-void FbDriveView::createContextMenu()
-{
-    mContextMenu = new HbMenu();
-    connect(mContextMenu, SIGNAL(aboutToShow()), this, SLOT(updateContextMenu()));
-
-    createFileContextMenu();
-    createEditContextMenu();
-    createViewContextMenu();
-    createDiskAdminContextMenu();
-}
-
-
-void FbDriveView::createFileContextMenu()
-{
-    //mContextMenuActions.mFileMenu = mContextMenu->addMenu("File");
-
-    //mContextMenuActions.mFileOpenDrive = mContextMenuActions.mFileMenu->addAction("Open drive (->)", this, SLOT(fileOpenDrive()));
-//    mContextMenuActions.mFileSearch = mContextMenuActions.mFileMenu->addAction("Search...", this, SLOT(fileSearch()));
-    //mContextMenuActions.mFileSearch->setVisible(false);
-
-    //mContextMenuActions.mFileProperties = mContextMenuActions.mFileMenu->addAction("Properties", this, SLOT(fileProperties()));
-    mContextMenuActions.mFileProperties = mContextMenu->addAction("Properties", this, SLOT(fileProperties()));
-    mContextMenuActions.mFileSearch = mContextMenu->addAction("Search...", this, SLOT(fileSearch()));
-
-//    mContextMenuActions.mFileSetAttributes = mContextMenuActions.mFileMenu->addAction("Set attributes...", this, SLOT(fileSetAttributes()));
-//    mContextMenuActions.mFileSetAttributes->setVisible(false);
-}
-
-void FbDriveView::createEditContextMenu()
-{
-//    mContextMenuActions.mEditMenu = mContextMenu->addMenu("Edit");
-
-    //mContextMenuActions.mEditSnapShotToE = mContextMenuActions.mEditMenu->addAction("Snap shot to E:", this, SLOT(editSnapShotToE()));
-//    mContextMenuActions.mEditSnapShotToE->setVisible(false);
-//    mContextMenuActions.mEditCut = mContextMenuActions.mEditMenu->addAction("Cut", this, SLOT(editCut()));
-//    mContextMenuActions.mEditCopy = mContextMenuActions.mEditMenu->addAction("Copy", this, SLOT(editCopy()));
-//    mContextMenuActions.mEditPaste = mContextMenuActions.mEditMenu->addAction("Paste", this, SLOT(editPaste()));
-//    mContextMenuActions.mEditCopyToFolder = mContextMenuActions.mEditMenu->addAction("Copy to folder...", this, SLOT(editCopyToFolder()));
-//    mContextMenuActions.mEditMoveToFolder = mContextMenuActions.mEditMenu->addAction("Move to folder...", this, SLOT(editMoveToFolder()));
-}
-
-void FbDriveView::createViewContextMenu()
-{
-
-}
-
-/**
-  Initial setup for Disk Admin submenu
-  */
-void FbDriveView::createDiskAdminContextMenu()
-{
-    mContextMenuActions.mDiskAdminMenu = mContextMenu->addMenu("Disk admin");
-    //mContextMenuActions.mDiskAdminMenu->menuAction()->setVisible(false);
-
-    mContextMenuActions.mDiskAdminSetDrivePassword = mContextMenuActions.mDiskAdminMenu->addAction("Set drive password", this, SLOT(diskAdminSetDrivePassword()));
-    mContextMenuActions.mDiskAdminUnlockDrive = mContextMenuActions.mDiskAdminMenu->addAction("Unlock drive", this, SLOT(diskAdminUnlockDrive()));
-    mContextMenuActions.mDiskAdminClearDrivePassword = mContextMenuActions.mDiskAdminMenu->addAction("Clear drive password", this, SLOT(diskAdminClearDrivePassword()));
-    mContextMenuActions.mDiskAdminEraseDrivePassword = mContextMenuActions.mDiskAdminMenu->addAction("Erase drive password", this, SLOT(diskAdminEraseDrivePassword()));
-
-    mContextMenuActions.mDiskAdminFormatDrive = mContextMenuActions.mDiskAdminMenu->addAction("Format drive", this, SLOT(diskAdminFormatDrive()));
-    mContextMenuActions.mDiskAdminFormatDrive->setVisible(false);
-    mContextMenuActions.mDiskAdminQuickFormatDrive = mContextMenuActions.mDiskAdminMenu->addAction("Quick format drive", this, SLOT(diskAdminQuickFormatDrive()));
-    mContextMenuActions.mDiskAdminQuickFormatDrive->setVisible(false);
-
-    mContextMenuActions.mDiskAdminCheckDisk = mContextMenuActions.mDiskAdminMenu->addAction("Check disk", this, SLOT(diskAdminCheckDisk()));
-    mContextMenuActions.mDiskAdminScanDrive = mContextMenuActions.mDiskAdminMenu->addAction("Scan drive", this, SLOT(diskAdminScanDrive()));
-    mContextMenuActions.mDiskAdminSetDriveName = mContextMenuActions.mDiskAdminMenu->addAction("Set drive name", this, SLOT(diskAdminSetDriveName()));
-    mContextMenuActions.mDiskAdminSetDriveVolumeLabel = mContextMenuActions.mDiskAdminMenu->addAction("Set drive volume label", this, SLOT(diskAdminSetDriveVolumeLabel()));
-    mContextMenuActions.mDiskAdminEjectDrive = mContextMenuActions.mDiskAdminMenu->addAction("Eject drive", this, SLOT(diskAdminEjectDrive()));
-    mContextMenuActions.mDiskAdminDismountDrive = mContextMenuActions.mDiskAdminMenu->addAction("Dismount drive", this, SLOT(diskAdminDismountDrive()));
-    mContextMenuActions.mDiskAdminEraseMBR = mContextMenuActions.mDiskAdminMenu->addAction("Erase MBR", this, SLOT(diskAdminEraseMBR()));
-    mContextMenuActions.mDiskAdminPartitionDrive = mContextMenuActions.mDiskAdminMenu->addAction("Partition drive", this, SLOT(diskAdminPartitionDrive()));
-}
-
-void FbDriveView::updateContextMenu()
-{
-    bool isFileItemListEmpty = mFbDriveModel->rowCount() == 0;
-    mContextMenuActions.mFileProperties->setVisible(!isFileItemListEmpty);
-}
-
-// ---------------------------------------------------------------------------
-
-void FbDriveView::onLongPressed(HbAbstractViewItem *listViewItem, QPointF coords)
-{
-    mCurrentIndex = listViewItem->modelIndex();
-
-    mContextMenu->setPreferredPos(coords);
-    mContextMenu->show();
-}
-
-/**
-  Refresh FileBrowser view
-  */
-void FbDriveView::refreshList()
-{
-    mEngineWrapper->refreshView();
-    mListView->reset();
-
-    TListingMode listingMode = mEngineWrapper->listingMode();
-    if (listingMode == ENormalEntries)
-        mNaviPane->setPlainText(QString(mEngineWrapper->currentPath()));
-    else if (listingMode == ESearchResults)
-        mNaviPane->setPlainText(QString(tr("Search results")));
-    else if (listingMode == EOpenFiles)
-        mNaviPane->setPlainText(QString(tr("Open files")));
-    else if (listingMode == EMsgAttachmentsInbox)
-        mNaviPane->setPlainText(QString(tr("Attachments in Inbox")));
-    else if (listingMode == EMsgAttachmentsDrafts)
-        mNaviPane->setPlainText(QString(tr("Attachments in Drafts")));
-    else if (listingMode == EMsgAttachmentsSentItems)
-        mNaviPane->setPlainText(QString(tr("Attachments in Sent Items")));
-    else if (listingMode == EMsgAttachmentsOutbox)
-        mNaviPane->setPlainText(QString(tr("Attachments in Outbox")));
-}
-
-// ---------------------------------------------------------------------------
-/**
-  Show a list dialog
-  \param List aList of item to select item from.
-  \param Title text titleText of a dialog heading widget
-  \return None
-  */
-void FbDriveView::openListDialog(const QStringList& items, const QString &titleText, 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);
-
-    HbLabel *title = new HbLabel(dlg);
-    title->setPlainText(titleText);
-    dlg->setHeadingWidget(title);
-
-    // Launch popup and handle the user response:
-    dlg->open(receiver, member);
-}
-
-// ---------------------------------------------------------------------------
-
-void FbDriveView::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();
-}
-
-void FbDriveView::storeSelectedItemsOrCurrentItem()
-{
-    QItemSelectionModel *selectionIndexes = mListView->selectionModel();
-
-    // by default use selected items
-    if (selectionIndexes) {
-        if (selectionIndexes->hasSelection()) {
-            mSelectionIndexes = mListView->selectionModel()->selectedIndexes();
-        } else { // or if none selected, use the current item index
-            mSelectionIndexes.clear();
-            mSelectionIndexes.append(mCurrentIndex);
-//            QModelIndex currentIndex = currentItemIndex();
-//            if (mFbDriveModel->rowCount(currentItemIndex) > currentItemIndex && currentItemIndex >= 0)
-//            {
-//                modelIndexList.append(currentIndex);
-//            }
-        }
-    }
-//    mClipBoardInUse = true;
-}
-
-// ---------------------------------------------------------------------------
-
-QModelIndex FbDriveView::currentItemIndex()
-{
-    return mCurrentIndex;//mListView->selectionModel()->currentIndex();
-}
-
-// ---------------------------------------------------------------------------
-// operations in File Menu
-// ---------------------------------------------------------------------------
-
-void FbDriveView::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(mCurrentIndex);
-        mListView->setRootIndex(mCurrentIndex);
-        refreshList();
-//    } else {
-//        Notifications::showErrorNote("not selected item!");
-//    }
-}
-
-void FbDriveView::fileSearch()
-{
-    QString searchPath;
-    HbAction *contextrMenuAction = static_cast<HbAction *>(sender());
-    if (contextrMenuAction
-        && contextrMenuAction->text().compare(QString("Search..."), Qt::CaseInsensitive) == 0
-        && contextrMenuAction == mContextMenuActions.mFileSearch) {
-        DriveEntry driveEntry(mEngineWrapper->getDriveEntry(currentItemIndex()));
-        searchPath = driveEntry.driveLetter() + QString(":\\");
-    } else {
-        searchPath = mEngineWrapper->currentPath();
-    }
-    emit aboutToShowSearchView(searchPath);
-}
-
-/**
-  Show file properties
-  */
-void FbDriveView::fileProperties()
-{
-    QModelIndex currentIndex = currentItemIndex();
-    QStringList propertyList;
-    QString titleText;
-    mEngineWrapper->properties(currentIndex, propertyList, titleText);
-    openPropertyDialog(propertyList, titleText);
-}
-
-void FbDriveView::fileSetAttributes()
-{
-
-}
-
-// edit menu
-void FbDriveView::editSnapShotToE()
-{
-
-}
-
-// ---------------------------------------------------------------------------
-// view menu
-// ---------------------------------------------------------------------------
-
-/**
-  Refresh view
-  */
-void FbDriveView::viewRefresh()
-{
-    refreshList();
-}
-
-// ---------------------------------------------------------------------------
-// disk admin menu
-// ---------------------------------------------------------------------------
-
-/**
-  Open old password for the selected drive dialog.
-  */
-void FbDriveView::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());
-    } else {
-        QString heading = QString("New password");
-        HbInputDialog::getText(heading, this, SLOT(doDiskAdminSetDrivePassword(HbAction*)), mOldPassword, scene());
-    }
-}
-
-/**
-   Open new password for the selected drive dialog.
-  */
-void FbDriveView::diskAdminSetDrivePasswordNew(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        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 FbDriveView::doDiskAdminSetDrivePassword(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString newPassword = dlg->value().toString();
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminSetDrivePassword(currentIndex, mOldPassword, newPassword);
-        refreshList();
-        mOldPassword = QString();
-        newPassword = QString();
-    }
-}
-
-/**
-  Open Unlock the selected drive dialog.
-  */
-void FbDriveView::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 FbDriveView::doDiskAdminUnlockDrive(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString oldPassword = dlg->value().toString();
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminUnlockDrive(currentIndex, oldPassword);
-        refreshList();
-    }
-}
-
-/**
-  Open clear password of the selected drive dialog.
-  */
-void FbDriveView::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 FbDriveView::doDiskAdminClearDrivePassword(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString oldPassword = dlg->value().toString();
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminClearDrivePassword(currentIndex, oldPassword);
-        refreshList();
-    }
-}
-
-
-/**
-  Question for erase password of the selected drive
-  */
-void FbDriveView::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 FbDriveView::doDiskAdminEraseDrivePassword(HbAction* action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminEraseDrivePassword(currentIndex);
-        refreshList();
-    }
-}
-
-/**
-  Performs format on the selected drive
-  */
-void FbDriveView::diskAdminFormatDrive()
-{
-    HbMessageBox::question(QString("Are you sure? All data will be lost!"), this, SLOT(doDiskAdminFormatDrive(HbAction*)));
-}
-
-/**
-  Performs format on the selected drive
-  */
-void FbDriveView::doDiskAdminFormatDrive(HbAction* action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminFormatDrive(currentIndex, false);
-    }
-}
-
-/**
-  Performs quick format on the selected drive
-  */
-void FbDriveView::diskAdminQuickFormatDrive()
-{
-    HbMessageBox::question(QString("Are you sure? All data will be lost!"), this, SLOT(doDiskAdminQuickFormatDrive(HbAction*)));
-}
-
-/**
-  Performs quick format on the selected drive
-  */
-void FbDriveView::doDiskAdminQuickFormatDrive(HbAction* action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminFormatDrive(currentIndex, true);
-    }
-}
-
-/**
-    Checks the disk integrity on the selected drive
-  */
-void FbDriveView::diskAdminCheckDisk()
-{
-    QModelIndex currentIndex = currentItemIndex();
-    mEngineWrapper->DiskAdminCheckDisk(currentIndex);
-}
-
-/**
-  Checks the selected drive for errors and corrects them
-  */
-void FbDriveView::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 FbDriveView::doDiskAdminScanDrive(HbAction* action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminScanDrive(currentIndex);
-        refreshList();
-    }
-}
-
-/**
-  Open drive name dialog
-  */
-void FbDriveView::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 FbDriveView::doDiskAdminSetDriveName(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString driveName = dlg->value().toString();
-
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminSetDriveName(currentIndex, driveName);
-
-        refreshList();
-    }
-}
-
-/**
-  Open drive volume label dialog
-  */
-void FbDriveView::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 FbDriveView::doDiskAdminSetDriveVolumeLabel(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString volumeLabel = dlg->value().toString();
-
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminSetDriveVolumeLabel(currentIndex, volumeLabel);
-
-        refreshList();
-    }
-}
-
-/**
-  Eject the selected drive
-  */
-void FbDriveView::diskAdminEjectDrive()
-{
-    QModelIndex currentIndex = currentItemIndex();
-    mEngineWrapper->DiskAdminEjectDrive(currentIndex);
-    refreshList();
-}
-
-/**
-  Dismount the selected drive
-  */
-void FbDriveView::diskAdminDismountDrive()
-{
-    HbMessageBox::question(QString("Are you sure you know what are you doing?"), this, SLOT(doDiskAdminDismountDrive(HbAction*)));
-}
-
-void FbDriveView::doDiskAdminDismountDrive(HbAction* action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminDismountDrive(currentIndex);
-        refreshList();
-    }
-}
-
-/**
-  Erase Master Boot Record of the selected drive
-  */
-void FbDriveView::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 FbDriveView::doDiskAdminEraseMBR(HbAction* action)
-{
-    // TODO What to do with FB LITE macros?
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        HbMessageBox::question(QString("Are you really sure you know what are you doing ?!?"), this, SLOT(doDiskAdminReallyEraseMBR(HbAction*)));
-    }
-}
-
-void FbDriveView::doDiskAdminReallyEraseMBR(HbAction* action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        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 FbDriveView::doDiskAdminNotRemovableReallyEraseMBR(HbAction* action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEngineWrapper->DiskAdminEraseMBR(currentIndex);
-        refreshList();
-    }
-
-}
-
-/**
-  Partition the selected drive
-  */
-void FbDriveView::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 FbDriveView::diskAdminPartitionDriveProceed(HbAction *action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        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 FbDriveView::diskAdminPartitionDriveReallyProceed(HbAction *action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        QModelIndex currentIndex = currentItemIndex();
-        mEraseMBR = false;
-        // warn if the selected drive is not detected as removable
-        mProceed = false;
-        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 FbDriveView::diskAdminPartitionDriveIsNotRemovable(HbAction *action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        mProceed = true;
-    } else {
-        mProceed = false;
-    }
-}
-
-/**
-  Store result of user query about erase MBR
-  */
-void FbDriveView::diskAdminPartitionDriveEraseMbr(HbAction *action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        mEraseMBR = true;
-    }
-}
-
-/**
-  Partition the selected drive
-  */
-void FbDriveView::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 FbDriveView::toolsAllAppsToTextFile()
-{
-
-}
-
-/**
-  Write all files to text file
-  */
-void FbDriveView::toolsAllFilesToTextFile()
-{
-    mEngineWrapper->toolsWriteAllFiles();
-}
-
-//void FbDriveView::toolsAvkonIconCacheEnable()
-//{
-//
-//}
-//void FbDriveView::toolsAvkonIconCacheDisable()
-//{
-//
-//}
-
-/**
-  Disable extended errors
-  */
-void FbDriveView::toolsDisableExtendedErrors()
-{
-    mEngineWrapper->ToolsSetErrRd(false);
-}
-
-void FbDriveView::toolsDumpMsgStoreWalk()
-{
-
-}
-void FbDriveView::toolsEditDataTypes()
-{
-
-}
-
-/**
-  Enable extended errors
-  */
-void FbDriveView::toolsEnableExtendedErrors()
-{
-    mEngineWrapper->ToolsSetErrRd(true);
-}
-
-/**
-  Open simulate leave dialog
-  */
-void FbDriveView::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 FbDriveView::doToolsErrorSimulateLeave(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        bool ok;
-        int leaveCode = dlg->value().toString().toInt(&ok);
-        if (leaveCode != 0 || ok) {
-            mEngineWrapper->ToolsErrorSimulateLeave(leaveCode);
-        }
-    }
-}
-
-/**
-  Open simulate panic dialog.
-  */
-void FbDriveView::toolsErrorSimulatePanic()
-{
-    mPanicCategory = QString ("Test Category");
-    QString heading = QString("Panic category");
-    HbInputDialog::getText(heading, this, SLOT(doToolsErrorSimulatePanicCode(HbAction*)), mPanicCategory, scene());
-}
-
-/**
-  Simulate panic.
-  */
-void FbDriveView::doToolsErrorSimulatePanicCode(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        mPanicCategory = dlg->value().toString();
-        int panicCode(555);
-        QString heading = QString("Panic code");
-        HbInputDialog::getInteger(heading, this, SLOT(doToolsErrorSimulatePanic(HbAction*)), panicCode, scene());
-    }
-}
-
-/**
-  Simulate panic.
-  */
-void FbDriveView::doToolsErrorSimulatePanic(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        bool ok;
-        int panicCode = dlg->value().toInt(&ok);
-        if (panicCode != 0 || ok) {
-            mEngineWrapper->ToolsErrorSimulatePanic(mPanicCategory, panicCode);
-        }
-    }
-}
-
-/**
-  Open simulate exception dialog.
-  */
-void FbDriveView::toolsErrorSimulateException()
-{
-    int exceptionCode = 0;
-    QString heading = QString("Exception code");
-    HbInputDialog::getInteger(heading, this, SLOT(doToolsErrorSimulateException(HbAction*)), exceptionCode, scene());
-}
-
-/**
-  Simulate exception.
-  */
-void FbDriveView::doToolsErrorSimulateException(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        bool ok;
-        int exceptionCode = dlg->value().toInt(&ok);
-        if (exceptionCode != 0 || ok) {
-            mEngineWrapper->ToolsErrorSimulateException(exceptionCode);
-        }
-    }
-}
-
-//    void FbDriveView::toolsLocalConnectivityActivateInfrared()
-//{
-//
-//}
-//    void FbDriveView::toolsLocalConnectivityLaunchBTUI()
-//{
-//
-//}
-//    void FbDriveView::toolsLocalConnectivityLaunchUSBUI()
-//{
-//
-//}
-void FbDriveView::toolsMessageInbox()
-{
-
-}
-void FbDriveView::toolsMessageDrafts()
-{
-
-}
-void FbDriveView::toolsMessageSentItems()
-{
-
-}
-void FbDriveView::toolsMessageOutbox()
-{
-
-}
-void FbDriveView::toolsMemoryInfo()
-{
-
-}
-void FbDriveView::toolsSecureBackStart()
-{
-
-}
-void FbDriveView::toolsSecureBackRestore()
-{
-
-}
-void FbDriveView::toolsSecureBackStop()
-{
-
-}
-
-/**
-  Open debug mask dialog
-  */
-void FbDriveView::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 FbDriveView::toolsSetDebugMask(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        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 FbDriveView::toolsShowOpenFilesHere()
-{
-
-}
-
-// ---------------------------------------------------------------------------
-// main menu items
-// ---------------------------------------------------------------------------
-
-/**
-  Show about note
-  */
-void FbDriveView::about()
-{
-    Notifications::showAboutNote();
-}
-
-// ---------------------------------------------------------------------------
-// End of operations
-// ---------------------------------------------------------------------------
-
-// ---------------------------------------------------------------------------
-
-/**
-  Item is selected from list when selection mode is activated from menu
-  */
-void FbDriveView::selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/)
-{
-    //QItemSelectionModel *selectionModel = mListView->selectionModel();
-}
-
-/**
-  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 FbDriveView::activated(const QModelIndex& index)
-{
-    if (mFbDriveModel) {
-//        if (mEngineWrapper->isDriveListViewActive()) {
-            mEngineWrapper->moveDownToDirectory(index);
-            //emit aboutToShowFileView(QString(mEngineWrapper->currentPath()));
-            emit aboutToShowFileView();
-            //refreshList();
-//        }
-    }
-}
-
-// ---------------------------------------------------------------------------
--- a/filebrowser/ui/src/fbfilelistviewitem.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
-* 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 "fbfilelistviewitem.h"
-
-#include <QString>
-#include <QStringList>
-#include <QGraphicsLinearLayout>
-#include <QRectF>
-#include <QPainter>
-
-#include <hblabel.h>
-#include <hbcheckbox.h>
-#include <hbabstractitemview.h>
-
-FbFileListViewItem::FbFileListViewItem(QGraphicsItem *parent) :
-    HbListViewItem(parent),
-    hLayout(0),
-    mDiskNameLabel(0),
-    mSizeLabel(0),
-    mFreeLabel(0),
-    mIconLabel(0)
-{
-}
-
-FbFileListViewItem::~FbFileListViewItem()
-{
-}
-
-void FbFileListViewItem::polish(HbStyleParameters &params)
-{
-    Q_UNUSED(params);
-}
-
-bool FbFileListViewItem::canSetModelIndex(const QModelIndex &index) const
-{
-    Q_UNUSED(index);
-    return true;
-}
-
-
-HbAbstractViewItem *FbFileListViewItem::createItem()
-{
-    return new FbFileListViewItem(*this);
-}
-
-void FbFileListViewItem::updateChildItems()
-{
-    if(!hLayout) {
-        init();
-    }
-
-    // Qt::DisplayRole
-    QVariant displayRole = modelIndex().data(Qt::DisplayRole);
-    QString diskName("default");
-    QStringList stringList;
-    if (displayRole.isValid()) {
-        if (displayRole.canConvert<QString>()) {                // EFileViewModeSimple
-            stringList.append(displayRole.toString());
-        } else if (displayRole.canConvert<QStringList>()) {     // EFileViewModeExtended
-            stringList = displayRole.toStringList();
-        }
-        if (stringList.count() > 0)
-            diskName = stringList[0]; //modelIndex().data( Qt::UserRole ).toString();
-
-        mDiskNameLabel->setPlainText(diskName/*displayString*/);
-    }
-
-//    mSizeLabel->setPlainText( hbTrId ( "Size: " ) /*+ FmUtils::formatStorageSize( driverInfo.size() )*/ );
-//    mFreeLabel->setPlainText( hbTrId ( "Free: " ) /*+ FmUtils::formatStorageSize( driverInfo.freeSize() )*/ );
-    if (stringList.count() > 1)
-        mSizeLabel->setPlainText( stringList[1] );
-
-    //mStorageSizeDiagram->setFreeSizePercentage();
-    //mFreeLabel->setPlainText( stringList[2] );
-
-    //    mCheckBox->setCheckState( checkState() );
-
-    // Qt::DecorationRole
-    QVariant decorationRole = modelIndex().data(Qt::DecorationRole);
-    if (decorationRole.isValid()) {
-        QIcon icon = qvariant_cast<QIcon>(decorationRole);
-//    if( icon.isNull() ) {
-//        QFileIconProvider fileIconProvider;
-//        icon = fileIconProvider.icon(QFileIconProvider::Drive);
-//    }
-    mIconLabel->setIcon(HbIcon(icon));
-    }
-}
-
-void FbFileListViewItem::setCheckedState(int state)
-{
-    HbAbstractViewItem::setCheckState(static_cast<Qt::CheckState>(state));
-}
-
-void FbFileListViewItem::init()
-{
-    hLayout = new QGraphicsLinearLayout();
-
-    hLayout->setOrientation( Qt::Horizontal );
-    hLayout->addItem(layout());
-
-    mIconLabel = new HbLabel();
-    hLayout->addItem( mIconLabel );
-    hLayout->setAlignment( mIconLabel, Qt::AlignTop );
-    hLayout->setStretchFactor( mIconLabel, 0 );
-
-//    mStorageSizeDiagram = new FbDriveStorageSizeDiagram(this);
-//    hLayout->addItem( mStorageSizeDiagram );
-//    hLayout->setAlignment( mIconLabel, Qt::AlignTop );
-//    hLayout->setStretchFactor( mStorageSizeDiagram, 0 );
-
-    QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout();
-    vLayout->setOrientation( Qt::Vertical );
-
-    mDiskNameLabel = new HbLabel();
-    //HbFontSpec fontSpecPrimary(HbFontSpec::Primary);
-    //fontSpecPrimary.setTextHeight(18.0);
-    //mDiskNameLabel->setFontSpec( fontSpecPrimary );
-    vLayout->addItem( mDiskNameLabel );
-    vLayout->setAlignment( mDiskNameLabel, Qt::AlignLeft );
-
-    mSizeLabel = new HbLabel();
-    //HbFontSpec fontSpecSecondary(HbFontSpec::Secondary);
-    //fontSpecSecondary.setTextHeight(18.0);
-    //mSizeLabel->setFontSpec(fontSpecSecondary);
-    vLayout->addItem( mSizeLabel );
-    vLayout->setAlignment(mSizeLabel, Qt::AlignLeft);
-
-//    mFreeLabel = new HbLabel();
-//    mFreeLabel->setFontSpec( HbFontSpec( HbFontSpec::Secondary ) );
-//    vLayout->addItem( mFreeLabel );
-//    vLayout->setAlignment( mFreeLabel, Qt::AlignLeft );
-
-    HbWidget *labelsWidget = new HbWidget();
-    labelsWidget->setLayout(vLayout);
-
-    hLayout->setAlignment( labelsWidget, Qt::AlignLeft );
-
-    hLayout->addItem( labelsWidget );
-    hLayout->setStretchFactor( labelsWidget, 1 );
-
-//    this->setMaximumHeight(80);
-
-    setLayout( hLayout );
-}
--- a/filebrowser/ui/src/fbfilemodel.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* 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 "fbfilemodel.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.
-  */
-FbFileModel::FbFileModel(EngineWrapper *engineWrapper, QObject *parent) :
-    QAbstractListModel(parent),
-    mEngineWrapper(engineWrapper),
-    mFileIconProvider(0)
-{
-    mFileIconProvider = new QFileIconProvider();
-}
-
-/**
-  Destroys this file browser custom system model.
-  */
-FbFileModel::~FbFileModel()
-{  
-    if (mFileIconProvider) {
-        delete mFileIconProvider;
-    }
-}
-
-/**
-  \reimp
-  */
-int FbFileModel::rowCount(const QModelIndex &parent) const
-{
-    Q_UNUSED(parent);
-    return mEngineWrapper->itemCount();
-}
-
-/**
-  \reimp
-  */
-QVariant FbFileModel::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 FbFileModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
-    Q_UNUSED(section)
-    Q_UNUSED(orientation)
-    Q_UNUSED(role)
-
-    // TODO, implement or remove
-    return QVariant();
-}
-
-// ---------------------------------------------------------------------------
--- a/filebrowser/ui/src/fbfileview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1535 +0,0 @@
-/*
-* 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 "fbfileview.h"
-#include "settingsview.h"
-#include "editorview.h"
-#include "searchview.h"
-#include "enginewrapper.h"
-#include "notifications.h"
-
-#include "fbfilemodel.h"
-#include "filebrowsersortfilterproxymodel.h"
-//#include "fbfilelistviewitem.h"
-
-#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 <HbToolBarExtension>
-#include <HbSearchPanel>
-
-#include <QString>
-#include <QGraphicsLinearLayout>
-#include <QItemSelection>
-#include <QDebug>
-//TODO check if needed to do this way
-#include <FB.hrh>
-
-// ---------------------------------------------------------------------------
-
-FbFileView::FbFileView() :
-    mEngineWrapper(0),
-    mListView(0),
-    mToolBar(0),
-    mNaviPane(0),
-    mSearchPanel(0),
-    mMainLayout(0),
-    mFbFileModel(0),
-    mSortFilterProxyModel(0),
-    mOptionMenuActions(),
-    mContextMenuActions(),
-    mContextMenu(0),
-    mToolbarBackAction(0),
-    mItemHighlighted(false),
-    mLocationChanged(false),
-    mRemoveFileAfterCopied(false),
-//    mClipBoardInUse(false),
-    mFolderContentChanged(false),
-    mCurrentIndex(),
-    mOldPassword(),
-    mPanicCategory(),
-    mAbsoluteFilePath(),
-    mOverwriteOptions(),
-    mModelIndex(),
-    mNewFileName(),
-    mProceed(false),
-    mEraseMBR(false)
-{
-    setTitle("File Browser");
-
-    createMenu();
-    createContextMenu();
-    createToolBar();
-}
-
-// ---------------------------------------------------------------------------	
-
-void FbFileView::init(EngineWrapper *engineWrapper)
-{
-    mEngineWrapper = engineWrapper;
-
-    mListView = new HbListView(this);
-    mListView->listItemPrototype()->setStretchingStyle(HbListViewItem::StretchLandscape);
-
-//    mListView->setItemPrototype(new FbDiskListViewItem(mListView));
-
-    mFbFileModel = new FbFileModel(mEngineWrapper);
-    if (!mListView->model()) {
-
-        mEngineWrapper->refreshView();
-
-        mSortFilterProxyModel = new FileBrowserSortFilterProxyModel(this);
-        mSortFilterProxyModel->setSourceModel(mFbFileModel);
-        mSortFilterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
-        mSearchPanel->setPlaceholderText(QString("Type filter criteria"));
-
-        mListView->setModel(mSortFilterProxyModel);
-    }
-
-    //mListView->setRootIndex(mFileSystemModel->index(startPath));
-    //mListView->setRootIndex(model->index());
-
-    //setItemVisible(Hb::ToolBarItem, !mEngineWrapper->isDriveListViewActive());
-//    mListView->setScrollingStyle(HbScrollArea::PanWithFollowOn);
-
-    connect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex)));
-    connect(mListView, SIGNAL(longPressed(HbAbstractViewItem*,QPointF)),
-            this, SLOT(onLongPressed(HbAbstractViewItem*, QPointF)));
-
-    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);
-    setLayout(mMainLayout);
-}
-
-// ---------------------------------------------------------------------------
-
-FbFileView::~FbFileView()
-{  
-//    if (mEngineWrapper) {
-//        delete mEngineWrapper;
-//    }
-    if (mContextMenu) {
-        mContextMenu->deleteLater();
-    }
-
-    delete mSortFilterProxyModel;
-    delete mFbFileModel;
-    delete mListView;
-    delete mToolBar;
-}
-
-/**
-  Initial setup for options menu.
-  Dynamic menu update during the runtime is performed by updateOptionMenu() which
-  to menu's aboutToShow() signal.
-  */
-void FbFileView::createMenu()
-{
-    createFileMenu();
-    createEditMenu();
-    createViewMenu();
-    createToolsMenu();
-
-    createSelectionMenuItem();
-    createSettingsMenuItem();
-    createAboutMenuItem();
-    createExitMenuItem();
-
-    // menu dynamic update
-    connect(menu(), SIGNAL(aboutToShow()), this, SLOT(updateOptionMenu()));
-}
-
-/**
-  Initial setup for File submenu
-  */
-void FbFileView::createFileMenu()
-{
-    mOptionMenuActions.mFileMenu = menu()->addMenu("File");
-
-    mOptionMenuActions.mFileBackMoveUp = mOptionMenuActions.mFileMenu->addAction("Back/Move up", this, SLOT(fileBackMoveUp()));
-    mOptionMenuActions.mFileSearch = mOptionMenuActions.mFileMenu->addAction("Search...", this, SLOT(fileSearch()));
-    //mOptionMenuActions.mFileSearch->setVisible(false);
-
-    mOptionMenuActions.mFileNewMenu = mOptionMenuActions.mFileMenu->addMenu("New");
-    mOptionMenuActions.mFileNewFile = mOptionMenuActions.mFileNewMenu->addAction("File", this, SLOT(fileNewFile()));
-    mOptionMenuActions.mFileNewDirectory = mOptionMenuActions.mFileNewMenu->addAction("Directory", this, SLOT(fileNewDirectory()));
-
-    mOptionMenuActions.mFileDelete = mOptionMenuActions.mFileMenu->addAction("Delete", this, SLOT(fileDelete()));
-    mOptionMenuActions.mFileRename = mOptionMenuActions.mFileMenu->addAction("Rename", this, SLOT(fileRename()));
-    mOptionMenuActions.mFileTouch = mOptionMenuActions.mFileMenu->addAction("Touch", this, SLOT(fileTouch()));
-
-//    mOptionMenuActions.mFileChecksumsMenu = mOptionMenuActions.mFileMenu->addMenu("Checksums");
-//    mOptionMenuActions.mFileChecksumsMD5 = mOptionMenuActions.mFileChecksumsMenu->addAction("MD5", this, SLOT(fileChecksumsMD5()));
-//    mOptionMenuActions.mFileChecksumsMD2 = mOptionMenuActions.mFileChecksumsMenu->addAction("MD2", this, SLOT(fileChecksumsMD2()));
-//    mOptionMenuActions.mFileChecksumsSHA1 = mOptionMenuActions.mFileChecksumsMenu->addAction("SHA-1", this, SLOT(fileChecksumsSHA1()));
-
-    mOptionMenuActions.mFileSetAttributes = mOptionMenuActions.mFileMenu->addAction("Set attributes...", this, SLOT(fileSetAttributes()));
-    mOptionMenuActions.mFileSetAttributes->setVisible(false);
-}
-
-/**
-  Initial setup for Edit submenu
-  */
-void FbFileView::createEditMenu()
-{
-    mOptionMenuActions.mEditMenu = menu()->addMenu("Edit");
-
-    mOptionMenuActions.mEditSnapShotToE = mOptionMenuActions.mEditMenu->addAction("Snap shot to E:", this, SLOT(editSnapShotToE()));
-    mOptionMenuActions.mEditSnapShotToE->setVisible(false);
-    mOptionMenuActions.mEditCut = mOptionMenuActions.mEditMenu->addAction("Cut", this, SLOT(editCut()));
-    mOptionMenuActions.mEditCopy = mOptionMenuActions.mEditMenu->addAction("Copy", this, SLOT(editCopy()));
-    mOptionMenuActions.mEditPaste = mOptionMenuActions.mEditMenu->addAction("Paste", this, SLOT(editPaste()));
-
-    mOptionMenuActions.mEditCopyToFolder = mOptionMenuActions.mEditMenu->addAction("Copy to folder...", this, SLOT(editCopyToFolder()));
-    mOptionMenuActions.mEditMoveToFolder = mOptionMenuActions.mEditMenu->addAction("Move to folder...", this, SLOT(editMoveToFolder()));
-
-    mOptionMenuActions.mEditSelect = mOptionMenuActions.mEditMenu->addAction("Select", this, SLOT(editSelect()));
-    mOptionMenuActions.mEditUnselect = mOptionMenuActions.mEditMenu->addAction("Unselect", this, SLOT(editUnselect()));
-    mOptionMenuActions.mEditSelectAll = mOptionMenuActions.mEditMenu->addAction("Select all", this, SLOT(editSelectAll()));
-    mOptionMenuActions.mEditUnselectAll = mOptionMenuActions.mEditMenu->addAction("Unselect all", this, SLOT(editUnselectAll()));
-}
-
-/**
-  Initial setup for View submenu
-  */
-void FbFileView::createViewMenu()
-{
-    mOptionMenuActions.mViewMenu = menu()->addMenu("View");
-    //mOptionMenuActions.mViewMenu->menuAction()->setVisible(false);
-
-    mOptionMenuActions.mViewFilterEntries = mOptionMenuActions.mViewMenu->addAction("Filter entries", this, SLOT(viewFilterEntries()));
-    mOptionMenuActions.mViewRefresh = mOptionMenuActions.mViewMenu->addAction("Refresh", this, SLOT(viewRefresh()));
-}
-
-/**
-  Initial setup for Tools submenu
-  */
-void FbFileView::createToolsMenu()
-{
-    mOptionMenuActions.mToolsMenu = menu()->addMenu("Tools");
-
-    mOptionMenuActions.mToolsAllAppsToTextFile = mOptionMenuActions.mToolsMenu->addAction("All apps to a text file", this, SLOT(toolsAllAppsToTextFile()));
-    mOptionMenuActions.mToolsAllAppsToTextFile->setVisible(false);
-    mOptionMenuActions.mToolsAllFilesToTextFile = mOptionMenuActions.mToolsMenu->addAction("All files to a text file", this, SLOT(toolsAllFilesToTextFile()));
-    //mOptionMenuActions.mToolsAllFilesToTextFile->setVisible(false);
-
-//    mOptionMenuActions.mToolsAvkonIconCacheMenu = mOptionMenuActions.mToolsMenu->addMenu("Avkon icon cache");
-//    mOptionMenuActions.mToolsAvkonIconCacheMenu->menuAction()->setVisible(false);
-//    mOptionMenuActions.mToolsAvkonIconCacheEnable = mOptionMenuActions.mToolsAvkonIconCacheMenu->addAction("Enable", this, SLOT(toolsAvkonIconCacheEnable()));
-//    mOptionMenuActions.mToolsAvkonIconCacheDisable = mOptionMenuActions.mToolsAvkonIconCacheMenu->addAction("Clear and disable", this, SLOT(toolsAvkonIconCacheDisable()));
-
-    mOptionMenuActions.mToolsDisableExtendedErrors = mOptionMenuActions.mToolsMenu->addAction("Disable extended errors", this, SLOT(toolsDisableExtendedErrors()));
-    mOptionMenuActions.mToolsDumpMsgStoreWalk = mOptionMenuActions.mToolsMenu->addAction("Dump msg. store walk", this, SLOT(toolsDumpMsgStoreWalk()));
-    mOptionMenuActions.mToolsDumpMsgStoreWalk->setVisible(false);
-    mOptionMenuActions.mToolsEditDataTypes = mOptionMenuActions.mToolsMenu->addAction("Edit data types", this, SLOT(toolsEditDataTypes()));
-    mOptionMenuActions.mToolsEditDataTypes->setVisible(false);
-    mOptionMenuActions.mToolsEnableExtendedErrors = mOptionMenuActions.mToolsMenu->addAction("Enable extended errors", this, SLOT(toolsEnableExtendedErrors()));
-
-    mOptionMenuActions.mToolsErrorSimulateMenu = mOptionMenuActions.mToolsMenu->addMenu("Error simulate");
-    mOptionMenuActions.mToolsErrorSimulateLeave = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Leave", this, SLOT(toolsErrorSimulateLeave()));
-    mOptionMenuActions.mToolsErrorSimulatePanic = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Panic", this, SLOT(toolsErrorSimulatePanic()));
-    mOptionMenuActions.mToolsErrorSimulatePanic->setVisible(false);
-    mOptionMenuActions.mToolsErrorSimulateException = mOptionMenuActions.mToolsErrorSimulateMenu->addAction("Exception", this, SLOT(toolsErrorSimulateException()));
-
-//    mOptionMenuActions.mLocalConnectivityMenu = mOptionMenuActions.mToolsMenu->addMenu("Local connectivity");
-//    mOptionMenuActions.mToolsLocalConnectivityActivateInfrared = mOptionMenuActions.mLocalConnectivityMenu->addAction("Activate infrared", this, SLOT(toolsLocalConnectivityActivateInfrared()));
-//    mOptionMenuActions.mToolsLocalConnectivityLaunchBTUI = mOptionMenuActions.mLocalConnectivityMenu->addAction("Launch BT UI", this, SLOT(toolsLocalConnectivityLaunchBTUI()));
-//    mOptionMenuActions.mToolsLocalConnectivityLaunchUSBUI = mOptionMenuActions.mLocalConnectivityMenu->addAction("Launch USB UI", this, SLOT(toolsLocalConnectivityLaunchUSBUI()));
-
-    mOptionMenuActions.mToolsMessageAttachmentsMenu = mOptionMenuActions.mToolsMenu->addMenu("Message attachments");
-    mOptionMenuActions.mToolsMessageAttachmentsMenu->menuAction()->setVisible(false);
-    mOptionMenuActions.mToolsMessageInbox = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Inbox", this, SLOT(toolsMessageInbox()));
-    mOptionMenuActions.mToolsMessageDrafts = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Drafts", this, SLOT(toolsMessageDrafts()));
-    mOptionMenuActions.mToolsMessageSentItems = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Sent items", this, SLOT(toolsMessageSentItems()));
-    mOptionMenuActions.mToolsMessageOutbox = mOptionMenuActions.mToolsMessageAttachmentsMenu->addAction("Outbox", this, SLOT(toolsMessageOutbox()));
-
-    mOptionMenuActions.mToolsMemoryInfo = mOptionMenuActions.mToolsMenu->addAction("Memory info", this, SLOT(toolsMemoryInfo()));
-    mOptionMenuActions.mToolsMemoryInfo->setVisible(false);
-
-    mOptionMenuActions.mToolsSecureBackupMenu = mOptionMenuActions.mToolsMenu->addMenu("Secure backup");
-    mOptionMenuActions.mToolsSecureBackupMenu->menuAction()->setVisible(false);
-    mOptionMenuActions.mToolsSecureBackStart = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Start backup", this, SLOT(toolsSecureBackStart()));
-    mOptionMenuActions.mToolsSecureBackRestore = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Start restore", this, SLOT(toolsSecureBackRestore()));
-    mOptionMenuActions.mToolsSecureBackStop = mOptionMenuActions.mToolsSecureBackupMenu->addAction("Stop", this, SLOT(toolsSecureBackStop()));
-
-    mOptionMenuActions.mToolsSetDebugMask = mOptionMenuActions.mToolsMenu->addAction("Set debug mask", this, SLOT(toolsSetDebugMaskQuestion()));
-    mOptionMenuActions.mToolsShowOpenFilesHere = mOptionMenuActions.mToolsMenu->addAction("Show open files here", this, SLOT(toolsShowOpenFilesHere()));
-    mOptionMenuActions.mToolsShowOpenFilesHere->setVisible(false);
-}
-
-/**
-  Creates Selection mode menu item in option menu
-  */
-void FbFileView::createSelectionMenuItem()
-{
-    if (!mOptionMenuActions.mSelection) {
-        mOptionMenuActions.mSelection = menu()->addAction("Selection mode");
-        mOptionMenuActions.mSelection->setToolTip("Selection mode");
-        mOptionMenuActions.mSelection->setCheckable(true);
-        connect(mOptionMenuActions.mSelection, SIGNAL(triggered()), this, SLOT(selectionModeChanged()));
-    }
-}
-
-/**
-  Creates Setting menu item in option menu
-  */
-void FbFileView::createSettingsMenuItem()
-{
-    mOptionMenuActions.mSetting = menu()->addAction("Settings...");
-    connect(mOptionMenuActions.mSetting, SIGNAL(triggered()), this, SIGNAL(aboutToShowSettingsView()));
-}
-
-
-/**
-  Creates About menu item in option menu
-  */
-void FbFileView::createAboutMenuItem()
-{
-    // about note
-    mOptionMenuActions.mAbout = menu()->addAction("About");
-    connect(mOptionMenuActions.mAbout, SIGNAL(triggered()), this, SLOT(about()));
-}
-
-/**
-  Creates Exit menu item in option menu
-  */
-void FbFileView::createExitMenuItem()
-{
-    // application exit
-    mOptionMenuActions.mExit = menu()->addAction("Exit");
-    connect(mOptionMenuActions.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 FbFileView::updateOptionMenu()
-{
-    bool isFileItemListEmpty = mFbFileModel->rowCount() == 0;
-    bool isNormalModeActive = true;       //iModel->FileUtils()->IsNormalModeActive();
-    bool isCurrentDriveReadOnly = mEngineWrapper->isCurrentDriveReadOnly();   //iModel->FileUtils()->IsCurrentDriveReadOnly();
-    bool isCurrentItemDirectory = mEngineWrapper->getFileEntry(currentItemIndex()).isDir();
-    // bool currentSelected = true;    //iContainer->ListBox()->View()->ItemIsSelected(iContainer->ListBox()->View()->CurrentItemIndex());
-    bool isAllSelected = mListView->selectionModel()->selection().count() == mFbFileModel->rowCount();
-    //bool isNoneSelected = mListView->selectionModel()->selection().count() != 0;
-    bool hasSelectedItems = mListView->selectionModel()->selection().count() != 0;
-    bool isSelectionMode = mOptionMenuActions.mSelection && mOptionMenuActions.mSelection->isChecked();
-    bool isClipBoardEmpty = !mEngineWrapper->isClipBoardListInUse();
-    //bool showSnapShot = false;           //iModel->FileUtils()->DriveSnapShotPossible();
-
-    bool showEditMenu(true);
-    if (isFileItemListEmpty && isClipBoardEmpty)
-        showEditMenu = false;
-    else
-        showEditMenu = true;
-
-    mOptionMenuActions.mEditMenu->menuAction()->setVisible(showEditMenu);
-
-    //mOptionMenuActions.mFileBackMoveUp->setVisible( !isDriveListViewActive);
-
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileView, isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory);
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileEdit, isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory);
-    //aMenuPane->SetItemDimmed(EFileBrowserCmdFileSendTo, isFileItemListEmpty || driveListActive || isCurrentItemDirectory);
-
-    mOptionMenuActions.mFileNewMenu->menuAction()->setVisible(!isCurrentDriveReadOnly);
-    mOptionMenuActions.mFileDelete->setVisible(!isFileItemListEmpty && !isCurrentDriveReadOnly && hasSelectedItems/*isSelectionMode*/);
-    mOptionMenuActions.mFileRename->setVisible(!isFileItemListEmpty && !isCurrentDriveReadOnly && hasSelectedItems/*&& isSelectionMode*/);
-    mOptionMenuActions.mFileTouch->setVisible(!isFileItemListEmpty && !isCurrentDriveReadOnly && hasSelectedItems);
-
-    // TODO mOptionMenuActions.mFileChecksumsMenu->setVisible(!(isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory));
-    // TODO mOptionMenuActions.mFileSetAttributes->setVisible(!(isFileItemListEmpty || isCurrentDriveReadOnly));
-    // TODO mOptionMenuActions.mFileCompress->setVisible(!(isCurrentDriveReadOnly || isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory));
-    // TODO mOptionMenuActions.mFileDecompress->setVisible(!(isCurrentDriveReadOnly || isFileItemListEmpty || !hasSelectedItems || isCurrentItemDirectory));
-
-    mOptionMenuActions.mEditCut->setVisible(!isFileItemListEmpty && !isCurrentDriveReadOnly && isSelectionMode);
-    mOptionMenuActions.mEditCopy->setVisible(!isFileItemListEmpty && isSelectionMode);
-    mOptionMenuActions.mEditPaste->setVisible(!(isClipBoardEmpty || isCurrentDriveReadOnly));
-    mOptionMenuActions.mEditCopyToFolder->setVisible(!isFileItemListEmpty);
-    mOptionMenuActions.mEditMoveToFolder->setVisible(!(isCurrentDriveReadOnly || isFileItemListEmpty));
-
-    mOptionMenuActions.mEditSelect->setVisible(false/*!currentSelected && !isFileItemListEmpty*/);
-    mOptionMenuActions.mEditUnselect->setVisible(false/*currentSelected && !isFileItemListEmpty*/);
-    mOptionMenuActions.mEditSelectAll->setVisible(isSelectionMode && !isAllSelected && !isFileItemListEmpty);
-    mOptionMenuActions.mEditUnselectAll->setVisible(hasSelectedItems && !isFileItemListEmpty);
-
-    // TODO mOptionMenuActions.mViewSort->setVisible(!(!isNormalModeActive || isFileItemListEmpty));
-    // TODO mOptionMenuActions.mViewOrder->setVisible(!(!isNormalModeActive  || isFileItemListEmpty));
-    mOptionMenuActions.mViewRefresh->setVisible(isNormalModeActive);
-    mOptionMenuActions.mViewFilterEntries->setVisible(!isFileItemListEmpty);
-
-    // 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();
-    mOptionMenuActions.mToolsDisableExtendedErrors->setVisible(noExtendedErrorsAllowed);
-    mOptionMenuActions.mToolsEnableExtendedErrors->setVisible(!noExtendedErrorsAllowed);
-
-//    bool infraRedAllowed = mEngineWrapper->FileExists(KIRAppPath);
-//    bool bluetoothAllowed = mEngineWrapper->FileExists(KBTAppPath);
-//    bool usbAllowed = mEngineWrapper->FileExists(KUSBAppPath);
-//
-//    bool noLocalCon = !infraRedAllowed && !bluetoothAllowed && !usbAllowed;
-//    mOptionMenuActions.mToolsLocalConnectivityMenu->menuAction()->setVisible(!noLocalCon);
-//
-//    mOptionMenuActions.mToolsLocalConnectivityActivateInfrared->setVisible(infraRedAllowed);
-//    mOptionMenuActions.mToolsLocalConnectivityLaunchBTUI->setVisible(bluetoothAllowed);
-//    mOptionMenuActions.mToolsLocalConnectivityLaunchUSBUI->setVisible(usbAllowed);
-}
-
-void FbFileView::createContextMenu()
-{
-    mContextMenu = new HbMenu();
-    connect(mContextMenu, SIGNAL(aboutToShow()), this, SLOT(updateContextMenu()));
-
-    createFileContextMenu();
-    createEditContextMenu();
-    createViewContextMenu();
-}
-
-
-void FbFileView::createFileContextMenu()
-{
-    mContextMenuActions.mFileMenu = mContextMenu->addMenu("File");
-
-    //mContextMenuActions.mFileBackMoveUp = mContextMenuActions.mFileMenu->addAction("Back/Move up (<-)", this, SLOT(fileBackMoveUp()));
-    mContextMenuActions.mFileOpenDirectory = mContextMenuActions.mFileMenu->addAction("Open directory (->)", this, SLOT(fileOpenDirectory()));
-//    mContextMenuActions.mFileSearch = mContextMenuActions.mFileMenu->addAction("Search...", this, SLOT(fileSearch()));
-    //mContextMenuActions.mFileSearch->setVisible(false);
-
-    mContextMenuActions.mFileDelete = mContextMenuActions.mFileMenu->addAction("Delete", this, SLOT(fileDelete()));
-    mContextMenuActions.mFileRename = mContextMenuActions.mFileMenu->addAction("Rename", this, SLOT(fileRename()));
-    mContextMenuActions.mFileTouch = mContextMenuActions.mFileMenu->addAction("Touch", this, SLOT(fileTouch()));
-    mContextMenuActions.mFileProperties = mContextMenuActions.mFileMenu->addAction("Properties", this, SLOT(fileProperties()));
-
-    mContextMenuActions.mFileChecksumsMenu = mContextMenuActions.mFileMenu->addMenu("Checksums");
-    mContextMenuActions.mFileChecksumsMD5 = mContextMenuActions.mFileChecksumsMenu->addAction("MD5", this, SLOT(fileChecksumsMD5()));
-    mContextMenuActions.mFileChecksumsMD2 = mContextMenuActions.mFileChecksumsMenu->addAction("MD2", this, SLOT(fileChecksumsMD2()));
-    mContextMenuActions.mFileChecksumsSHA1 = mContextMenuActions.mFileChecksumsMenu->addAction("SHA-1", this, SLOT(fileChecksumsSHA1()));
-
-//    mContextMenuActions.mFileSetAttributes = mContextMenuActions.mFileMenu->addAction("Set attributes...", this, SLOT(fileSetAttributes()));
-//    mContextMenuActions.mFileSetAttributes->setVisible(false);
-}
-
-void FbFileView::createEditContextMenu()
-{
-    mContextMenuActions.mEditMenu = mContextMenu->addMenu("Edit");
-
-    //mContextMenuActions.mEditSnapShotToE = mContextMenuActions.mEditMenu->addAction("Snap shot to E:", this, SLOT(editSnapShotToE()));
-//    mContextMenuActions.mEditSnapShotToE->setVisible(false);
-    mContextMenuActions.mEditCut = mContextMenuActions.mEditMenu->addAction("Cut", this, SLOT(editCut()));
-    mContextMenuActions.mEditCopy = mContextMenuActions.mEditMenu->addAction("Copy", this, SLOT(editCopy()));
-    mContextMenuActions.mEditPaste = mContextMenuActions.mEditMenu->addAction("Paste", this, SLOT(editPaste()));
-
-    mContextMenuActions.mEditCopyToFolder = mContextMenuActions.mEditMenu->addAction("Copy to folder...", this, SLOT(editCopyToFolder()));
-    mContextMenuActions.mEditMoveToFolder = mContextMenuActions.mEditMenu->addAction("Move to folder...", this, SLOT(editMoveToFolder()));
-}
-
-void FbFileView::createViewContextMenu()
-{
-
-}
-
-void FbFileView::updateContextMenu()
-{
-    bool isFileItemListEmpty = mFbFileModel->rowCount() == 0;
-    bool isDriveListViewActive = mEngineWrapper->isDriveListViewActive();
-//    bool isNormalModeActive = true;       //iModel->FileUtils()->IsNormalModeActive();
-    bool isCurrentDriveReadOnly = mEngineWrapper->isCurrentDriveReadOnly();
-    bool isCurrentItemDirectory = mEngineWrapper->getFileEntry(currentItemIndex()).isDir();
-    bool hasSelectedItems = mListView->selectionModel()->selection().count() != 0;
-    bool isSelectionMode = mOptionMenuActions.mSelection && mOptionMenuActions.mSelection->isChecked();
-    bool isClipBoardEmpty = !mEngineWrapper->isClipBoardListInUse();
-
-    // File submenu
-    //mContextMenuActions.mFileBackMoveUp->setVisible( !isDriveListViewActive);
-    mContextMenuActions.mFileOpenDirectory->setVisible( !isFileItemListEmpty && !isDriveListViewActive && isCurrentItemDirectory);
-
-    mContextMenuActions.mFileDelete->setVisible(!isFileItemListEmpty && !isDriveListViewActive && !isCurrentDriveReadOnly);
-    mContextMenuActions.mFileRename->setVisible(!isFileItemListEmpty && !isDriveListViewActive && !isCurrentDriveReadOnly);
-    mContextMenuActions.mFileTouch->setVisible(!isFileItemListEmpty && !isDriveListViewActive && !isCurrentDriveReadOnly);
-    mContextMenuActions.mFileProperties->setVisible(!isFileItemListEmpty && !isSelectionMode);
-
-    mContextMenuActions.mFileChecksumsMenu->menuAction()->setVisible(!(isFileItemListEmpty || isSelectionMode /*|| !hasSelectedItems*/ || isCurrentItemDirectory || isDriveListViewActive));
-    // Edit submenu
-    mContextMenuActions.mEditMenu->menuAction()->setVisible(!isDriveListViewActive);
-    mContextMenuActions.mEditCut->setVisible(!(isDriveListViewActive || isCurrentDriveReadOnly || isFileItemListEmpty));
-    mContextMenuActions.mEditCopy->setVisible(!(isDriveListViewActive || isFileItemListEmpty));
-    mContextMenuActions.mEditPaste->setVisible(!isDriveListViewActive && !isClipBoardEmpty && !isCurrentDriveReadOnly);
-    mContextMenuActions.mEditCopyToFolder->setVisible(!(isDriveListViewActive || isFileItemListEmpty));
-    mContextMenuActions.mEditMoveToFolder->setVisible(!(isDriveListViewActive || isCurrentDriveReadOnly || isFileItemListEmpty));
-}
-
-// ---------------------------------------------------------------------------
-
-void FbFileView::onLongPressed(HbAbstractViewItem *listViewItem, QPointF coords)
-{
-    QModelIndex proxyIndex = listViewItem->modelIndex();
-    //map to source model
-    mCurrentIndex = mSortFilterProxyModel->mapToSource(proxyIndex);
-
-    mContextMenu->setPreferredPos(coords);
-    mContextMenu->show();
-}
-
-/**
-  Create a file browser tool bar
-  */
-void FbFileView::createToolBar()
-{
-    mToolBar = toolBar();
-
-    mToolbarBackAction = new HbAction(mToolBar);
-    mToolbarBackAction->setToolTip("Back");
-    mToolbarBackAction->setIcon(HbIcon(QString(":/qgn_indi_tb_filebrowser_folder_parent.svg")));
-    connect(mToolbarBackAction, SIGNAL(triggered()), this, SLOT(fileBackMoveUp()));
-    mToolBar->addAction(mToolbarBackAction);
-
-    // Find button and its extension
-    HbToolBarExtension* filterExtension = new HbToolBarExtension();
-    // Set search panel widget
-    mSearchPanel = new HbSearchPanel(filterExtension);
-    mSearchPanel->setMinimumWidth( 360 ); // TODO should be based on layout, screen width
-    connect(mSearchPanel, SIGNAL(criteriaChanged(const QString &)), this, SLOT(filterCriteriaChanged(const QString &)));
-    connect(mSearchPanel, SIGNAL(exitClicked()), filterExtension, SLOT(close()));
-    connect(mSearchPanel, SIGNAL(exitClicked()), this, SLOT(clearFilterCriteria()));
-    filterExtension->setContentWidget(mSearchPanel);
-
-    HbAction* mToolbarFilterAction = mToolBar->addExtension(filterExtension);
-//    mToolbarFilterAction->setText("Filter");
-    mToolbarFilterAction->setToolTip("Filter");
-    mToolbarFilterAction->setIcon(HbIcon(QString(":/qgn_indi_tb_filebrowser_find.svg")));
-    //connect(mToolbarFilterAction, SIGNAL(triggered()), this, SLOT(viewFilterEntries()));
-
-    if (mOptionMenuActions.mSelection) {
-        //mOptionMenuActions.mSelection->setIcon(HbIcon(QString(":/qgn_indi_tb_filebrowser_selection_active.svg")));
-        mToolBar->addAction(mOptionMenuActions.mSelection);
-    }
-
-//    // TODO Paste to be added
-//    if (mOptionMenuActions.mEditPaste) {
-//        //mOptionMenuActions.mEditPaste->setIcon(HbIcon(QString(":/qgn_indi_tb_filebrowser_selection_active.svg")));
-//        mToolBar->addAction(mOptionMenuActions.mEditPaste);
-//    }
-}
-
-/**
-  Refresh FileBrowser view
-  */
-void FbFileView::refreshList()
-{
-    editUnselectAll();
-    mEngineWrapper->refreshView();
-    mSearchPanel->setCriteria(QString(""));
-    mListView->model()->revert();
-    mListView->reset();
-
-    if (mListView->model() && mListView->model()->rowCount() > 0) {
-        QModelIndex firstIndex = mListView->model()->index(0, 0);
-        mListView->scrollTo(firstIndex);
-    }
-
-    TListingMode listingMode = mEngineWrapper->listingMode();
-    if (listingMode == ENormalEntries)
-        mNaviPane->setPlainText(QString(mEngineWrapper->currentPath()));
-    else if (listingMode == ESearchResults)
-        mNaviPane->setPlainText(QString(tr("Search results")));
-    else if (listingMode == EOpenFiles)
-        mNaviPane->setPlainText(QString(tr("Open files")));
-    else if (listingMode == EMsgAttachmentsInbox)
-        mNaviPane->setPlainText(QString(tr("Attachments in Inbox")));
-    else if (listingMode == EMsgAttachmentsDrafts)
-        mNaviPane->setPlainText(QString(tr("Attachments in Drafts")));
-    else if (listingMode == EMsgAttachmentsSentItems)
-        mNaviPane->setPlainText(QString(tr("Attachments in Sent Items")));
-    else if (listingMode == EMsgAttachmentsOutbox)
-        mNaviPane->setPlainText(QString(tr("Attachments in Outbox")));
-}
-
-// ---------------------------------------------------------------------------	
-
-void FbFileView::fileOpen(HbAction *action)
-{
-//    Q_UNUSED(action);
-    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
-    if(!action && dlg && dlg->selectedItems().count()){
-        int selectionIndex = dlg->selectedItems().at(0).toInt();
-
-        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 FbFileView::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 FbFileView::fileOverwrite(HbAction *action)
-{
-    HbSelectionDialog *dlg = static_cast<HbSelectionDialog*>(sender());
-    if(!action && dlg && dlg->selectedItems().count()) {
-        mOverwriteOptions.queryIndex = dlg->selectedItems().at(0).toInt();
-        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 FbFileView::fileOverwritePostfix(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        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 titleText of a dialog heading widget
-  \return None
-  */
-void FbFileView::openListDialog(const QStringList& items, const QString &titleText, 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);
-
-    HbLabel *title = new HbLabel(dlg);
-    title->setPlainText(titleText);
-    dlg->setHeadingWidget(title);
-
-    // Launch popup and handle the user response:
-    dlg->open(receiver, member);
-}
-
-// ---------------------------------------------------------------------------
-
-void FbFileView::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();
-}
-
-/**
-  Stores selection or current index mapped to source model
-  */
-void FbFileView::storeSelectedItemsOrCurrentItem()
-{
-    QItemSelectionModel *selectionIndexes = mListView->selectionModel();
-
-    // by default use selected items
-    if (selectionIndexes) {
-        if (selectionIndexes->hasSelection()) {
-            QItemSelection proxyItemSelection = mListView->selectionModel()->selection();
-            QItemSelection itemSelection = mSortFilterProxyModel->mapSelectionToSource(proxyItemSelection);
-            mSelectionIndexes = itemSelection.indexes();
-        } else { // or if none selected, use the current item index
-            mSelectionIndexes.clear();
-            QModelIndex currentIndex = currentItemIndex();  //alreade mapped to source model
-            mSelectionIndexes.append(currentIndex);
-        }
-    }
-}
-
-// ---------------------------------------------------------------------------
-
-QModelIndex FbFileView::currentItemIndex()
-{
-    return mCurrentIndex;
-}
-
-// ---------------------------------------------------------------------------
-// operations in File Menu
-// ---------------------------------------------------------------------------
-
-/**
-  Move back/up in folder browsing history
-  */
-void FbFileView::fileBackMoveUp()
-{
-    mLocationChanged = true;
-    mEngineWrapper->moveUpOneLevel();
-    //mListView->setRootIndex(currentItemIndex());
-    refreshList();
-    if (mEngineWrapper->isDriveListViewActive()) {
-        emit aboutToShowDriveView();
-    }
-}
-
-void FbFileView::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(currentItemIndex());
-//        mListView->setRootIndex(currentItemIndex());
-        refreshList();
-//    } else {
-//        Notifications::showErrorNote("not selected item!");
-//    }
-}
-
-void FbFileView::fileSearch()
-{
-    QString searchPath;
-//    if (mEngineWrapper->currentPath() != mInitDirPath.path()) {
-//        searchPath = mDirectory;
-//        searchPath.replace("/", "\\");
-//        searchPath+="\\";
-//    }
-    searchPath = mEngineWrapper->currentPath();
-//    mSearch->open(searchPath);
-    emit aboutToShowSearchView(searchPath);
-}
-
-/**
-  Open new file dialog
-  */
-void FbFileView::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 FbFileView::doFileNewFile(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString newFileName = dlg->value().toString();
-        mEngineWrapper->createNewFile(newFileName);
-        refreshList();
-    }
-}
-
-/**
-  Open new directory dialog
-  */
-void FbFileView::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 FbFileView::doFileNewDirectory(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString newDirectoryName = dlg->value().toString();
-        mEngineWrapper->createNewDirectory(newDirectoryName);
-        refreshList();
-    }
-}
-
-/**
-  Question for Delete actually selected files
-  */
-void FbFileView::fileDelete()
-{
-    storeSelectedItemsOrCurrentItem();
-    const QString messageFormat = "Delete %1 entries?";
-    QString message = messageFormat.arg(mSelectionIndexes.count());
-    HbMessageBox::question(message, this, SLOT(doFileDelete(HbAction*)));
-}
-
-/**
-  Delete actually selected files
-  */
-void FbFileView::doFileDelete(HbAction* action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        //storeSelectedItemsOrCurrentItem();
-        mEngineWrapper->deleteItems(mSelectionIndexes);
-        refreshList();
-    }
-}
-
-/**
-  Open rename dialog for actually selected files
-  */
-void FbFileView::fileRename()
-{
-    storeSelectedItemsOrCurrentItem();
-    mEngineWrapper->setCurrentSelection(mSelectionIndexes);
-
-    for (int i(0), ie(mSelectionIndexes.count()); i < ie; ++i ) {
-        mProceed = (i == ie-1); // if the last item
-        mModelIndex = mSelectionIndexes.at(i);
-        FileEntry entry = mEngineWrapper->getFileEntry(mModelIndex);
-
-        QString heading = QString("Enter new name");
-        HbInputDialog::getText(heading, this, SLOT(doFileRename(HbAction*)), entry.name(), scene());
-    }
-}
-
-/**
-  Rename actually selected files
-  */
-void FbFileView::doFileRename(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        mNewFileName = dlg->value().toString();
-
-        if (mEngineWrapper->targetExists(mModelIndex, mNewFileName)) {
-            const QString messageTemplate = QString("%1 already exists, overwrite?");
-            QString message = messageTemplate.arg(mNewFileName);
-            HbMessageBox::question(message, this, SLOT(doFileRenameFileExist(HbAction *)));
-        } else {
-            mEngineWrapper->rename(mModelIndex, mNewFileName);
-            if (mProceed) {
-                mEngineWrapper->startExecutingCommands(QString("Renaming"));
-                refreshList();
-            }
-        }
-    }
-}
-
-/**
-  Rename actually selected files
-  */
-void FbFileView::doFileRenameFileExist(HbAction *action)
-{
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        mEngineWrapper->rename(mModelIndex, mNewFileName);
-        if (mProceed) {
-            mEngineWrapper->startExecutingCommands(QString("Renaming"));
-            refreshList();
-        }
-    }
-}
-
-/**
-  Touch actually selected files
-  */
-void FbFileView::fileTouch()
-{
-    storeSelectedItemsOrCurrentItem();
-    mEngineWrapper->setCurrentSelection(mSelectionIndexes);
-
-    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 FbFileView::doFileTouch(HbAction* action)
-{
-    bool recurse = false;
-    if (action && action->text().compare(QString("Yes"), Qt::CaseInsensitive) == 0) {
-        recurse = true;
-        }
-    mEngineWrapper->touch(recurse);
-    refreshList();
-}
-
-void FbFileView::fileChecksumsMD5()
-{
-    fileChecksums(EFileChecksumsMD5);
-}
-
-void FbFileView::fileChecksumsMD2()
-{
-    fileChecksums(EFileChecksumsMD2);
-}
-
-void FbFileView::fileChecksumsSHA1()
-{
-    fileChecksums(EFileChecksumsSHA1);
-}
-
-void FbFileView::fileChecksums(TFileBrowserCmdFileChecksums checksumType)
-{
-    mEngineWrapper->showFileCheckSums(currentItemIndex(), checksumType);
-}
-
-/**
-  Show file properties
-  */
-void FbFileView::fileProperties()
-{
-    QModelIndex currentIndex = currentItemIndex();
-    QStringList propertyList;
-    QString titleText;
-    mEngineWrapper->properties(currentIndex, propertyList, titleText);
-    openPropertyDialog(propertyList, titleText);
-}
-
-void FbFileView::fileSetAttributes()
-{
-
-}
-
-// edit menu
-void FbFileView::editSnapShotToE()
-{
-
-}
-
-/**
-  Set selected files into clipboard.
-  Selected item will be removed after paste operation.
-  */
-void FbFileView::editCut()
-{
-    storeSelectedItemsOrCurrentItem();
-
-    // Store indices to clipboard
-    mClipboardIndexes.clear();
-    for (int i = 0; i < mSelectionIndexes.size(); ++i) {
-        mClipboardIndexes.append(mSelectionIndexes.at(i));
-    }
-
-    mEngineWrapper->clipboardCut(mClipboardIndexes);
-
-    int operations = mClipboardIndexes.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 FbFileView::editCopy()
-{
-    storeSelectedItemsOrCurrentItem();
-
-    // Store indices to clipboard
-    mClipboardIndexes.clear();
-    for (int i = 0; i < mSelectionIndexes.size(); ++i) {
-        mClipboardIndexes.append(mSelectionIndexes.at(i));
-    }
-
-    mEngineWrapper->clipboardCopy(mClipboardIndexes);
-
-    int operations = mClipboardIndexes.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 FbFileView::editPaste()
-{
-    bool someEntryExists(false);
-
-    // TODO Set entry items here
-
-    someEntryExists = mEngineWrapper->isDestinationEntriesExists(mClipboardIndexes, mEngineWrapper->currentPath());
-    if (someEntryExists) {
-        fileOverwriteDialog();
-    }
-    
-    mEngineWrapper->clipboardPaste(mOverwriteOptions);
-}
-
-/**
-  Open copy to folder new filename dialog
-  */
-void FbFileView::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 FbFileView::doEditCopyToFolder(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString targetDir = dlg->value().toString();
-        bool someEntryExists(false);
-
-        // TODO Set entry items here
-        storeSelectedItemsOrCurrentItem();
-        mEngineWrapper->setCurrentSelection(mSelectionIndexes);
-
-        someEntryExists = mEngineWrapper->isDestinationEntriesExists(mSelectionIndexes, targetDir);
-        if (someEntryExists) {
-            fileOverwriteDialog();
-        }
-        mEngineWrapper->copyToFolder(targetDir, mOverwriteOptions, false);
-        refreshList();
-    }
-}
-
-/**
-  Open move to folder new filename dialog.
-  */
-void FbFileView::editMoveToFolder()
-{
-    QString heading = QString("Enter new name");
-    HbInputDialog::getText(heading, this, SLOT(doEditMoveToFolder(HbAction*)), mEngineWrapper->currentPath(), scene());
-}
-
-/**
-  Moves current file selection to a queried directory.
-  */
-void FbFileView::doEditMoveToFolder(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        QString targetDir = dlg->value().toString();
-        bool someEntryExists(false);
-
-        // TODO Set entry items here
-        storeSelectedItemsOrCurrentItem();
-        mEngineWrapper->setCurrentSelection(mSelectionIndexes);
-
-        someEntryExists = mEngineWrapper->isDestinationEntriesExists(mSelectionIndexes, targetDir);
-        if (someEntryExists) {
-            fileOverwriteDialog();
-        }
-        mEngineWrapper->copyToFolder(targetDir, mOverwriteOptions, true);
-        refreshList();
-    }
-}
-
-/**
-  Select current file
-  */
-void FbFileView::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 FbFileView::editUnselect()
-{
-    QItemSelectionModel *selectionModel = mListView->selectionModel();
-    if (selectionModel) {
-        selectionModel->select(selectionModel->currentIndex(), QItemSelectionModel::Deselect);
-//        itemHighlighted(selectionModel->currentIndex());
-    }
-}
-
-/**
-  Select all files
-  */
-void FbFileView::editSelectAll()
-{
-    QItemSelectionModel *selectionModel = mListView->selectionModel();
-    if (selectionModel) {
-
-        //if (mFileBrowserModel->rowCount() > 0) {
-        if (mListView->model() && mListView->model()->rowCount() > 0) {
-            QModelIndex firstIndex = mListView->model()->index(0, 0);
-            QModelIndex lastIndex = mListView->model()->index( (mListView->model()->rowCount() - 1), 0);
-
-            QItemSelection itemSelection(firstIndex, lastIndex);
-            selectionModel->select(itemSelection, QItemSelectionModel::SelectCurrent);
-        }
-    }
-}
-
-/**
-  Unselect all files
-  */
-void FbFileView::editUnselectAll()
-{
-    QItemSelectionModel *selectionModel = mListView->selectionModel();
-    if (selectionModel) {
-        selectionModel->clearSelection();
-    }
-}
-
-// ---------------------------------------------------------------------------
-// view menu
-// ---------------------------------------------------------------------------
-void FbFileView::viewFilterEntries()
-{
-    if (mToolBar && mToolBar->actions().count() > 1 && mToolBar->actions().at(1)) {
-        HbAction* tbeFilterAction = qobject_cast<HbAction*>(mToolBar->actions().at(1));
-        if (tbeFilterAction && tbeFilterAction->toolBarExtension()) {
-            HbToolBarExtension *tbeFilter = tbeFilterAction->toolBarExtension();
-            tbeFilter->open();
-        }
-    }
-}
-
-/**
-  Set filter criteria to proxy model
-  */
-void FbFileView::filterCriteriaChanged(const QString &criteria)
-{
-    mSortFilterProxyModel->setFilterCriteria(criteria);
-}
-
-/**
-  Set filter criteria to proxy model
-  */
-void FbFileView::clearFilterCriteria()
-{
-    mSearchPanel->setCriteria(QString(""));
-}
-
-/**
-  Refresh view
-  */
-void FbFileView::viewRefresh()
-{
-    refreshList();
-}
-
-// ---------------------------------------------------------------------------
-// tools menu
-// ---------------------------------------------------------------------------
-void FbFileView::toolsAllAppsToTextFile()
-{
-
-}
-
-/**
-  Write all files to text file
-  */
-void FbFileView::toolsAllFilesToTextFile()
-{
-    mEngineWrapper->toolsWriteAllFiles();
-}
-
-//void FbFileView::toolsAvkonIconCacheEnable()
-//{
-//
-//}
-//void FbFileView::toolsAvkonIconCacheDisable()
-//{
-//
-//}
-
-/**
-  Disable extended errors
-  */
-void FbFileView::toolsDisableExtendedErrors()
-{
-    mEngineWrapper->ToolsSetErrRd(false);
-}
-
-void FbFileView::toolsDumpMsgStoreWalk()
-{
-
-}
-void FbFileView::toolsEditDataTypes()
-{
-
-}
-
-/**
-  Enable extended errors
-  */
-void FbFileView::toolsEnableExtendedErrors()
-{
-    mEngineWrapper->ToolsSetErrRd(true);
-}
-
-/**
-  Open simulate leave dialog
-  */
-void FbFileView::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 FbFileView::doToolsErrorSimulateLeave(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        bool ok;
-        int leaveCode = dlg->value().toString().toInt(&ok);
-        if (leaveCode != 0 || ok) {
-            mEngineWrapper->ToolsErrorSimulateLeave(leaveCode);
-        }
-    }
-}
-
-/**
-  Open simulate panic dialog.
-  */
-void FbFileView::toolsErrorSimulatePanic()
-{
-    mPanicCategory = QString ("Test Category");
-    QString heading = QString("Panic category");
-    HbInputDialog::getText(heading, this, SLOT(doToolsErrorSimulatePanicCode(HbAction*)), mPanicCategory, scene());
-}
-
-/**
-  Simulate panic.
-  */
-void FbFileView::doToolsErrorSimulatePanicCode(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        mPanicCategory = dlg->value().toString();
-        int panicCode(555);
-        QString heading = QString("Panic code");
-        HbInputDialog::getInteger(heading, this, SLOT(doToolsErrorSimulatePanic(HbAction*)), panicCode, scene());
-    }
-}
-
-/**
-  Simulate panic.
-  */
-void FbFileView::doToolsErrorSimulatePanic(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        bool ok;
-        int panicCode = dlg->value().toInt(&ok);
-        if (panicCode != 0 || ok) {
-            mEngineWrapper->ToolsErrorSimulatePanic(mPanicCategory, panicCode);
-        }
-    }
-}
-
-/**
-  Open simulate exception dialog.
-  */
-void FbFileView::toolsErrorSimulateException()
-{
-    int exceptionCode = 0;
-    QString heading = QString("Exception code");
-    HbInputDialog::getInteger(heading, this, SLOT(doToolsErrorSimulateException(HbAction*)), exceptionCode, scene());
-}
-
-/**
-  Simulate exception.
-  */
-void FbFileView::doToolsErrorSimulateException(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        bool ok;
-        int exceptionCode = dlg->value().toInt(&ok);
-        if (exceptionCode != 0 || ok) {
-            mEngineWrapper->ToolsErrorSimulateException(exceptionCode);
-        }
-    }
-}
-
-//    void FbFileView::toolsLocalConnectivityActivateInfrared()
-//{
-//
-//}
-//    void FbFileView::toolsLocalConnectivityLaunchBTUI()
-//{
-//
-//}
-//    void FbFileView::toolsLocalConnectivityLaunchUSBUI()
-//{
-//
-//}
-void FbFileView::toolsMessageInbox()
-{
-
-}
-void FbFileView::toolsMessageDrafts()
-{
-
-}
-void FbFileView::toolsMessageSentItems()
-{
-
-}
-void FbFileView::toolsMessageOutbox()
-{
-
-}
-void FbFileView::toolsMemoryInfo()
-{
-
-}
-void FbFileView::toolsSecureBackStart()
-{
-
-}
-void FbFileView::toolsSecureBackRestore()
-{
-
-}
-void FbFileView::toolsSecureBackStop()
-{
-
-}
-
-/**
-  Open debug mask dialog
-  */
-void FbFileView::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 FbFileView::toolsSetDebugMask(HbAction *action)
-{
-    HbInputDialog *dlg = static_cast<HbInputDialog*>(sender());
-    if (dlg && action && action->text().compare(QString("Ok"), Qt::CaseInsensitive) == 0) {
-        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 FbFileView::toolsShowOpenFilesHere()
-{
-
-}
-
-// ---------------------------------------------------------------------------
-// main menu items
-// ---------------------------------------------------------------------------
-void FbFileView::selectionModeChanged()
-{
-    if (mOptionMenuActions.mSelection->isChecked()) {
-         activateSelectionMode();
-     } else {
-         deActivateSelectionMode();
-     }
-}
-
-/**
-  Show about note
-  */
-void FbFileView::about()
-{
-    Notifications::showAboutNote();
-}
-
-// ---------------------------------------------------------------------------
-// End of operations
-// ---------------------------------------------------------------------------
-
-// ---------------------------------------------------------------------------
-
-/**
-  Item is selected from list when selection mode is activated from menu
-  */
-void FbFileView::selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/)
-{
-    //QItemSelectionModel *selectionModel = mListView->selectionModel();
-    //itemHighlighted(selectionModel->currentIndex());
-}
-
-/**
-  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 FbFileView::activated(const QModelIndex& index)
-{
-    if (mFbFileModel) {
-        //map to source model
-        QModelIndex activatedIndex = mSortFilterProxyModel->mapToSource(index);
-
-        if (mEngineWrapper->getFileEntry(activatedIndex).isDir()) {
-            // populate new content of changed navigation view.
-            // mLocationChanged = true;
-            // mDirectory = filePath;
-            mEngineWrapper->moveDownToDirectory(activatedIndex);
-            refreshList();
-        } else {  // file item
-            // mSelectedFilePath = filePath;
-            FileEntry fileEntry = mEngineWrapper->getFileEntry(activatedIndex);
-            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 FbFileView::activateSelectionMode()
-{
-    QString path;
-    disconnect(mListView, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex)));
-    mListView->setSelectionMode(HbListView::MultiSelection);
-
-//    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 FbFileView::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;
-}
-
-// ---------------------------------------------------------------------------
--- a/filebrowser/ui/src/fbmainwindow.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* 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 "fbmainwindow.h"
-#include "enginewrapper.h"
-#include "fbfileview.h"
-#include "fbdriveview.h"
-#include "settingsview.h"
-#include "editorview.h"
-#include "searchview.h"
-
-FbMainWindow::FbMainWindow(QWidget *parent)
-    : HbMainWindow(parent),
-    mEngineWrapper(0),
-    mDriveView(0),
-    mFileView(0),
-    mSettingsView(0),
-    mEditorView(0),
-    mSearchView(0),
-    mPreviousView(0)
-{
-}
-
-FbMainWindow::~FbMainWindow ()
-{
-    if (mEngineWrapper) {
-        delete mEngineWrapper;
-    }
-}
-
-void FbMainWindow::init()
-{
-    // Create Engine Wrapper and initialize it
-    mEngineWrapper = new EngineWrapper();
-    int error = mEngineWrapper->init();
-    Q_ASSERT_X(error == 1, "FileBrowser", "Engine initialization failed");
-
-    // Create drive view
-    mDriveView = new FbDriveView();
-    connect(mDriveView, SIGNAL(aboutToShowSettingsView()), this, SLOT(openSettingsView()));
-    connect(mDriveView, SIGNAL(aboutToShowFileView()), this, SLOT(openFileView()));
-    mDriveView->init(mEngineWrapper);
-    addView(mDriveView);
-
-    // Create file view
-    mFileView = new FbFileView();
-    connect(mFileView, SIGNAL(aboutToShowSettingsView()), this, SLOT(openSettingsView()));
-    connect(mFileView, SIGNAL(aboutToShowDriveView()), this, SLOT(openDriveView()));
-    mFileView->init(mEngineWrapper);
-    addView(mFileView);
-
-    // Create settings view
-    mSettingsView = new SettingsView(*mEngineWrapper);
-    connect(mSettingsView, SIGNAL(finished(bool)), this, SLOT(openPreviousBrowserView()));
-    addView(mSettingsView);
-
-    // Create editor view
-    mEditorView = new EditorView();
-    connect(mFileView, SIGNAL(aboutToShowEditorView(const QString &, bool)), this, SLOT(openEditorView(const QString &, bool)));
-    connect(mEditorView, SIGNAL(finished(bool)), this, SLOT(openFileView()));
-    addView(mEditorView);
-
-    // Create Search view
-    mSearchView = new SearchView(*mEngineWrapper);
-    connect(mDriveView, SIGNAL(aboutToShowSearchView(QString)), this, SLOT(openSearchView(QString)));
-    connect(mFileView, SIGNAL(aboutToShowSearchView(QString)), this, SLOT(openSearchView(QString)));
-    connect(mSearchView, SIGNAL(finished(bool)), this, SLOT(openFileBrowserView(bool)));
-    addView(mSearchView);
-
-    // Show ApplicationView at startup
-    setCurrentView(mDriveView);
-    mPreviousView = mDriveView;
-
-    // Show HbMainWindow
-    show();
-}
-
-
-void FbMainWindow::openPreviousBrowserView()
-{
-    mDriveView->refreshList();
-    mFileView->refreshList();
-    setCurrentView(mPreviousView);
-}
-
-void FbMainWindow::openFileBrowserView(bool accepted)
-{
-    mDriveView->refreshList();
-    mFileView->refreshList();
-    if (accepted) {
-        setCurrentView(mFileView);
-    } else {
-        setCurrentView(mPreviousView);
-    }
-}
-
-void FbMainWindow::openDriveView()
-{
-    mDriveView->refreshList();
-    setCurrentView(mDriveView);
-    mPreviousView = mDriveView;
-}
-
-void FbMainWindow::openFileView()
-{
-    mDriveView->refreshList();
-//    mFileView->setCurrentpath(path);
-    mFileView->refreshList();
-    setCurrentView(mFileView);
-    mPreviousView = mFileView;
-}
-
-void FbMainWindow::openSettingsView()
-{
-    mSettingsView->initDataForm();
-    setCurrentView(mSettingsView);
-}
-
-void FbMainWindow::openEditorView(const QString &fileName, bool flagReadOnly)
-{
-    mEditorView->open(fileName, flagReadOnly);
-    setCurrentView(mEditorView);
-}
-
-void FbMainWindow::openSearchView(const QString &path)
-{
-    mSearchView->open(path);
-    setCurrentView(mSearchView);
-}
--- a/filebrowser/ui/src/filebrowsersortfilterproxymodel.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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 "filebrowsersortfilterproxymodel.h"
-
-#include <QString>
-#include <QStringList>
-
-FileBrowserSortFilterProxyModel::FileBrowserSortFilterProxyModel(QObject *parent)
-    : QSortFilterProxyModel(parent)
-{
-}
-
-bool FileBrowserSortFilterProxyModel::filterAcceptsRow(int sourceRow,
-                                                       const QModelIndex &sourceParent) const
-{
-    QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
-
-    QVariant displayRole = index.data(Qt::DisplayRole);
-    QStringList stringList;
-    if (displayRole.isValid()) {
-        if (displayRole.canConvert<QString>()) {
-            stringList.append(displayRole.toString());
-        } else if (displayRole.canConvert<QStringList>()) {
-            stringList = displayRole.toStringList();
-        }
-        QString itemName = stringList.at(0);
-        //QString criteria = filterRegExp().pattern();
-        QString criteria = filterCriteria();
-        if (!criteria.isEmpty()) {
-            bool contains = itemName.contains(criteria, Qt::CaseInsensitive);
-            return contains;
-        } else {
-            //invalidateFilter();
-            return true;
-        }
-    }
-    return true;
-}
-
-void FileBrowserSortFilterProxyModel::setFilterCriteria(const QString &criteria)
-{
-    mFilterCriteria = criteria;
-    invalidate();
-}
-
-
-// End of File
--- a/filebrowser/ui/src/fileentry.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
-* 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;
-}
-
-// ---------------------------------------------------------------------------
--- a/filebrowser/ui/src/main.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* 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 "fbmainwindow.h"
-
-
-int main(int argc, char *argv[])
-{
-    HbApplication app(argc, argv);
-    FbMainWindow window;
-    window.init();
-    int result = app.exec();
-
-    return result;
-}
--- a/filebrowser/ui/src/notifications.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* 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 "notifications.h"
-
-#include <HbLabel>
-#include <HbProgressDialog>
-#include <HbMessageBox>
-
-// ---------------------------------------------------------------------------
-
-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.1.0 - 18th June 2010. Copyright © 2010 Nokia Corporation"
-                        "and/or its subsidiary(-ies). All rights reserved."
-                        "Licensed under Eclipse Public License v1.0.",
-                   "About File Browser"
-        );
-}
-
-// ---------------------------------------------------------------------------
-
-void Notifications::showInformationNote(const QString &text, const QString &title)
-{
-    showMessageBox(HbMessageBox::MessageTypeInformation, text, title, 3000);
-}
-
-// ---------------------------------------------------------------------------
-
-void Notifications::showErrorNote(const QString &text, bool noTimeout)
-{
-    showMessageBox(HbMessageBox::MessageTypeWarning, text, "",
-                   noTimeout ? HbPopup::NoTimeout : 3000 /*HbPopup::StandardTimeout*/);
-}
-
-// ---------------------------------------------------------------------------
-
-void Notifications::showConfirmationNote(const QString &text, bool noTimeout)
-{
-    showMessageBox(HbMessageBox::MessageTypeInformation, text, "",
-                   noTimeout ? HbPopup::NoTimeout : 3000 /*HbPopup::ConfirmationNoteTimeout*/);
-}
-
-// ---------------------------------------------------------------------------
-
-bool Notifications::showConfirmationQuery(const QString &aText)
-{
-    Q_UNUSED(aText);
-    return false; //HbMessageBox::question(aText);
-}
-
-// ---------------------------------------------------------------------------
--- a/filebrowser/ui/src/searchview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +0,0 @@
-/*
-* 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 "notifications.h"
-
-#include <HbView>
-#include <HbDataForm>
-#include <HbDataFormModel>
-#include <HbDataFormModelItem>
-#include <HbAction>
-#include <HbListWidget>
-#include <HbListWidgetItem>
-#include <HbDialog>
-#include <HbToolBar>
-#include <HbProgressDialog>
-
-#include <QtGui>
-#include <QDir>
-#include <QFileInfo>
-
-const QStringList RECURSEMODES = (QStringList() << "Non-recursive" << "Recursive");
-const QString acceptActionText = "Search";
-const QString rejectActionText = "Cancel";
-
-
-SearchView::SearchView(EngineWrapper &engineWrapper)
-    : mEngineWrapper(engineWrapper),
-    mAttributes(),
-    mResults(),
-    mForm(0),
-    mSearchFileNameItem(0),
-    mWildCardItem(0),
-    mHasString(0),
-    mRecurse(0),
-    mMinSize(0),
-    mMaxSize(0),
-    mMinDate(0),
-    mMaxDate(0),
-    mPath(),
-    mProgressDialog(0)
-{
-    // Set title and add this view to main window
-    setTitle("Search");
-
-    // Override back navigation action
-    HbAction *leaveViewAction = new HbAction(Hb::BackNaviAction, this);
-    connect(leaveViewAction, SIGNAL(triggered()), this, SLOT(reject()));
-    setNavigationAction(leaveViewAction);
-
-    initDataForm();
-    createToolbar();
-}
-
-SearchView::~SearchView() 
-{
-}
-
-void SearchView::initDataForm() {
-    mForm = new HbDataForm(/*HbFormView::ModeEdit,*/ this);
-    HbDataFormModel *model = new HbDataFormModel();
-
-    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");
-
-    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);
-    layout->addItem(mForm);
-    setLayout(layout);
-}
-
-void SearchView::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);
-}
-
-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);
-}
-
-/**
- * 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();
-}
-
-void SearchView::open(const QString &path)
-{   
-    mPath = path;
-    // load file search attribute values from FB engine:
-    loadAttributes();
-}
-
-void SearchView::startFileSearch()
-{
-    // save form data values and set them as search attributes into FB engine. 
-    readFormItems();
-    mEngineWrapper.setFileSearchAttributes(mAttributes);
-    
-    bool err = mEngineWrapper.searchFiles();
-
-    // show results of file search:
-    mResults = mEngineWrapper.getSearchResults();
-    fileSearchResults();
-}
-
-void SearchView::fileSearchResults()
-{
-    QString noteMsg("%1 entries found");
-    Notifications::showInformationNote(noteMsg.arg(mEngineWrapper.itemCount()), QString(""));
-}
-
-void SearchView::accept()
-{
-    startFileSearch();
-    emit finished(true);
-}
-
-void SearchView::reject()
-{
-    emit finished(false);
-}
--- a/filebrowser/ui/src/settingsview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,243 +0,0 @@
-/*
-* 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 "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(EngineWrapper &engineWrapper) :
-    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::accept()
-{
-    saveSettings(mEngineWrapper.settings());
-    mEngineWrapper.saveSettings();
-    emit finished(true);
-}
-
-void SettingsView::reject()
-{
-    emit finished(false);
-}
-
-// End of file
--- a/filebrowser/ui/ui.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-#
-# 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/fbmainwindow.h \
-           ./inc/fbdrivelistviewitem.h \
-           ./inc/fbdrivemodel.h \
-           ./inc/fbdriveview.h \
-           ./inc/fbfilelistviewitem.h \
-           ./inc/fbfilemodel.h \
-           ./inc/fbfileview.h \
-           ./inc/filebrowsersortfilterproxymodel.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/fbmainwindow.cpp \
-           ./src/fbdrivelistviewitem.cpp \
-           ./src/fbdrivemodel.cpp \
-           ./src/fbdriveview.cpp \
-           ./src/fbfilelistviewitem.cpp \
-           ./src/fbfilemodel.cpp \
-           ./src/fbfileview.cpp \
-           ./src/filebrowsersortfilterproxymodel.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 \
-            -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!")
-}
-	
--- a/filebrowser/ui/ui.qrc	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-<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>
-        <file alias="qgn_indi_tb_filebrowser_selection_active.svg" >../icons/qgn_indi_tb_filebrowser_selection_active.svg</file>
-    </qresource>
-</RCC>
--- a/group/bld.inf	Tue Aug 31 15:15:20 2010 +0300
+++ b/group/bld.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -19,12 +19,11 @@
 */
 
 
-//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"
-//Orbit version added #include "../stifui/avkon/group/bld.inf"
-//Orbit version added #include "../memspyui/group/bld.inf"
-//Orbit version added #include "../htiui/group/bld.inf"
+#include "../creator/group/bld.inf"
+#include "../filebrowser/group/bld.inf"
+#include "../launcher/group/bld.inf"
+#include "../loadgen/group/bld.inf"
+#include "../perfmon/group/bld.inf"
+#include "../screengrabber/group/bld.inf"
+#include "../memspyui/group/bld.inf"
+#include "../piprofilerui/group/bld.inf"
\ No newline at end of file
--- a/launcher/ReleaseNotes_Launcher.txt	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-===============================================================================
-
-RELEASE NOTES - LAUNCHER v4.0.1
-RELEASED 21st May 2010 
-
-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 v4.0.1
-====================
-- Feature: Orbit UI improvements
-- Fix: Launching DLL analysis not starting
-
-===============================================================================
-
-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:
-================
-3.7.0 - 29th May 2009
-- 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.
-
-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".
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/data/launcher.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,445 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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";
+        };
+    }
+  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/data/launcher_reg.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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";
+    }
--- a/launcher/engine/inc/e32image.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* 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>
-#include <e32ldr_private.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/engine/inc/e32imageheaders.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,540 +0,0 @@
-/*
-* 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__
--- a/launcher/engine/inc/launcherdllelement.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
-* 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_ */
--- a/launcher/engine/inc/launcherdllparser.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
-* 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_ */
--- a/launcher/engine/inc/launcherengine.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,274 +0,0 @@
-/*
-* 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 <e32hal.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
--- a/launcher/engine/inc/launcherparserobserver.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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_ */
--- a/launcher/engine/inc/launchertraces.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* 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__
-
--- a/launcher/engine/inc/launcherxmlparser.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* 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_ */
--- a/launcher/engine/src/e32image.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,846 +0,0 @@
-/*
-* 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());
-    }
-
-// ---------------------------------------------------------------------------
--- a/launcher/engine/src/launcherdllelement.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,191 +0,0 @@
-/*
-* 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; 
-    }
--- a/launcher/engine/src/launcherdllparser.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* 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));    
-    }
--- a/launcher/engine/src/launcherengine.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1665 +0,0 @@
-/*
-* 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);
-        User::LeaveIfError( 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");
-    if( iXMLParser )
-        {
-        iXMLParser->Cancel();
-        }
-    iLauncherUI->PrintText(_L("\nAnalysis cancelled.\n\n"));
-    WriteInitialStuffToTheLogL(_L("Analysis cancelled by user"), iBCLogFile);
-    iLogWriteBuf->Des().Zero();
-    iBCLogFile.Close();
-    }
-
-// ---------------------------------------------------------------------------
-
-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();
-    }
-
-// ---------------------------------------------------------------------------
-
-
-
-//////////////////////////////////////////////////////////////////////////////////////
-
--- a/launcher/engine/src/launcherxmlparser.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,430 +0,0 @@
-/*
-* 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;
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/envpatcher/EnvPatcher.pl	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,544 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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;    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/envpatcher/ReadMe.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,46 @@
+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/launcher/group/ReleaseNotes_Launcher.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,132 @@
+===============================================================================
+
+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".
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/group/backup_registration.xml	Wed Sep 01 12:30:35 2010 +0100
@@ -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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/group/bld.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/group/launcher.mmp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/group/launcher_icons_aif.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+#
+
+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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/group/launcher_stub_sis.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -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) : ..\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/launcher/icons/check.svg	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-<?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>
--- a/launcher/inc/applicationview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
-* 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
--- a/launcher/inc/commonActions.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/e32image.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 __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/inc/e32imageheaders.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,534 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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__
--- a/launcher/inc/enginewrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
-* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcher.hrh	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcher.pan	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcherapplication.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 __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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcherappui.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launchercontainerapps.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,118 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launchercontaineroutput.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcherdllelement.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/inc/launcherdllparser.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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/inc/launcherdocument.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+
+#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__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcherengine.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,218 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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__
--- a/launcher/inc/launchermainwindow.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* 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_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcherparserobserver.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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/inc/launchertraces.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,105 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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__
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcherviewapps.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcherviewoutput.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/inc/launcherxmlparser.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+#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_ */
--- a/launcher/inc/notifications.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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_
--- a/launcher/inc/outputview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* 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
-
--- a/launcher/launcher.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-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 -lws32 -lapparc -lefsrv -lcone
-
-
-        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!")
-}
--- a/launcher/launcher.qrc	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-<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	Tue Aug 31 15:15:20 2010 +0300
+++ b/launcher/rom/Launcher.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or 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,15 +20,13 @@
 #define __LAUNCHER_IBY__
 
 S60_APP_EXE(Launcher)
+S60_APP_AIF_ICONS(Launcher)
 S60_APP_RESOURCE(Launcher)
-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
+#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
--- a/launcher/rom/backup_registration.xml	Tue Aug 31 15:15:20 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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/sis/Launcher_S60-30.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+;
+
+; 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
--- a/launcher/sis/Launcher_S60-5x.pkg	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-;
-; 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/launcher/sis/Launcher_stub.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; Copyright (c) 2009 Nokia Corporation and/or 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),4,0,0
+#{"Launcher"},(0x101FB74F),1,0,0
 
 ; Non-localised vendor name
 :"Nokia Corporation"
@@ -28,7 +28,7 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\Launcher.exe"
-""-"z:\Resource\Apps\Launcher.mif"
+""-"z:\Resource\Apps\Launcher_aif.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
--- a/launcher/sis/launcher_stub_sis.mk	Tue Aug 31 15:15:20 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) : .\$(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/launcher/src/applicationview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,299 +0,0 @@
-/*
-* 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();
-        }
-}
-
-// ---------------------------------------------------------------------------
--- a/launcher/src/applicationview.xml	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-<?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>
--- a/launcher/src/commonActions.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
-* 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() ) );
-}
-
-
-// ---------------------------------------------------------------------------
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/e32image.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,846 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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());
+    }
+
+// ---------------------------------------------------------------------------
--- a/launcher/src/enginewrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,355 +0,0 @@
-/*
-* 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 <hbaction.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 && !action->text().compare("ok", Qt::CaseInsensitive) )
-        {
-        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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launcher.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+
+#include "launcherapplication.h"
+#include <eikstart.h>
+    
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CLauncherApplication;
+    }
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launcherapplication.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launcherappui.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launchercontainerapps.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,295 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launchercontaineroutput.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,348 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launcherdllelement.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/src/launcherdllparser.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+#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/src/launcherdocument.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launcherengine.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1800 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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");
+    }
+
+// ---------------------------------------------------------------------------
+
--- a/launcher/src/launchermainwindow.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
-* 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);
-    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launcherviewapps.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,208 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launcherviewoutput.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+// 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/src/launcherxmlparser.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,428 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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;
+    }
--- a/launcher/src/main.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* 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();
-}
-
--- a/launcher/src/notifications.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* 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.1 - 21st May 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
-        );
-}
-
-// ---------------------------------------------------------------------------
--- a/launcher/src/outputview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
-* 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();
-        }
-}
-
-// ---------------------------------------------------------------------------
-
--- a/launcher/src/outputview.xml	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-<?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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/launcher/symbian_version.hrh	Wed Sep 01 12:30:35 2010 +0100
@@ -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: 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_3
+
+
+#endif  // __SYMBIAN_VERSION_HRH
--- a/layers.sysdef.xml	Tue Aug 31 15:15:20 2010 +0300
+++ b/layers.sysdef.xml	Wed Sep 01 12:30:35 2010 +0100
@@ -1,35 +1,14 @@
 <?xml version="1.0"?>
-<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_4_0.dtd" [
   <!ENTITY layer_real_source_path "sf/app/rndtools" >
 ]>
 
-<SystemDefinition name="rndtools" schema="1.5.1">
+<SystemDefinition name="rndtools" schema="1.4.0">
   <systemModel>
     <layer name="app_layer">
-      <module name="screengrabber">
-				<unit unitID="tools.screengrabberqt" mrp="" bldFile="&layer_real_source_path;/screengrabber" name="screengrabber" proFile="screengrabber.pro" />
-			</module>
-			<module name="perfmon">
-				<unit unitID="tools.perfmonqt" mrp="" bldFile="&layer_real_source_path;/perfmon" name="perfmon" proFile="perfmon.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>
-			<module name="piprofilerui">
-				<unit unitID="tools.piprofilerui" mrp="" bldFile="&layer_real_source_path;/piprofilerui" name="piprofilerui" proFile="piprofilerui.pro" />
-			</module>
+      <module name="rndtools">
+        <unit unitID="tools.rndtools" mrp="" bldFile="&layer_real_source_path;/group" name="rndtools" />
+      </module>
     </layer>
   </systemModel>
 </SystemDefinition>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/data/loadgen.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1418 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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";
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/data/loadgen_reg.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+
+#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";    
+    }
--- a/loadgen/engine/inc/loadgen.hrh	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_applications.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_bluetooth.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* 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
-
--- a/loadgen/engine/inc/loadgen_cpuload.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_keypress.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_loadattributes.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,167 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_loadbase.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_memoryeat.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-/*
-* 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 <e32hal.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
--- a/loadgen/engine/inc/loadgen_messages.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,422 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_netconn.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
-* 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 <downloadcontroller.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
--- a/loadgen/engine/inc/loadgen_phonecall.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_photocapture.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/inc/loadgen_pointerevent.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* 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 <e32svr.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
--- a/loadgen/engine/inc/loadgen_std.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* 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
-
--- a/loadgen/engine/inc/loadgen_traces.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* 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__
-
--- a/loadgen/engine/inc/loadgen_utils.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_applications.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,686 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_bluetooth.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,339 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_cpuload.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_keypress.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,257 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_loadbase.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_memoryeat.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,603 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_messages.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,990 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_netconn.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_phonecall.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,353 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_photocapture.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,389 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_pointerevent.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-/*
-* 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
--- a/loadgen/engine/src/loadgen_utils.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
-* 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/envpatcher/EnvPatcher.pl	Wed Sep 01 12:30:35 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009 Nokia Corporation and/or 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,6 +49,7 @@
 
 # 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";
 
@@ -148,7 +149,7 @@
     # check if DEPENDS keyword already exists in the file
     if (string_exists_in_file($mmppmpath, "DEPENDS"))
     {
-        print "The SDK has already been patched with DEPENDS keyword hack.\n";        
+        print "The SDK can already handle DEPENDS keyword in a MMP file.\n";        
     }
     else
     {
@@ -189,6 +190,51 @@
             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	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/envpatcher/ReadMe.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -1,7 +1,7 @@
-Environment Patcher
-===================
+Environment Patcher v1.0.1
+==========================
 
-Updated: 9th January 2009
+Updated: 12th November 2009
 
 
 Introduction:
@@ -12,7 +12,8 @@
 
 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 resource keyword in an .mmp file
+- 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   
@@ -36,12 +37,10 @@
 
 
 
-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 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.
+This component and the accompanying materials are made available
+under the terms 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/ReleaseNotes_LoadGen.txt	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/group/ReleaseNotes_LoadGen.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -1,7 +1,7 @@
 ===============================================================================
 
-RELEASE NOTES - LOAD GENERATOR v1.5.0
-RELEASED 23rd April 2010
+RELEASE NOTES - LOAD GENERATOR v1.4.0
+RELEASED 30th September 2009
 
 SUPPORTS S60 3.0+
 
@@ -33,10 +33,11 @@
 
 ===============================================================================
 
-What's New in v1.5.0
+What's New in v1.4.0
 ====================
-- Feature: Orbit UI introduced
-
+- Feature: New load: Photo capture.
+- Feature: New load: Bluetooth actions.
+- Feature: New load: Pointer (touch ui) events. 
 
 ===============================================================================
 
@@ -84,12 +85,6 @@
 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.
@@ -124,11 +119,10 @@
 
 ===============================================================================
 
- 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".
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
 
-
+This component and the accompanying materials are made available
+under the terms 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/group/bld.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -1,31 +1,60 @@
-// ============================================================================
-// * Makefile for building: group
-// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-17T13:18:03
-// * This file is generated by qmake and should not be modified by the
-// * user.
-// * Project:  group.pro
-// * Template: subdirs
-// ============================================================================
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
 
-#define BLD_INF_GROUP_037FC092
+
+#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)
 
 
-prj_platforms
+PRJ_MMPFILES
+#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
+  gnumakefile loadgen_icons_aif.mk
+  gnumakefile loadgen_extraicons.mk
 
-WINSCW GCCE ARMV5 ARMV6
-#include "bld_generic.inf"
+  #ifdef MARM
+  gnumakefile loadgen_stub_sis.mk
+  #endif
+#endif
 
-
-prj_mmpfiles
+loadgen.mmp
 
 
-prj_extensions
+#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
 
-#if defined(WINSCW)
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME LoadGen_stub
+  END
+  #endif  
 #endif
-
-START EXTENSION qt/qmake_store_build
-END
-
-
--- a/loadgen/group/bld_generic.inf	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* 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
--- a/loadgen/group/group.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-
-
-TEMPLATE = subdirs
-
-BLD_INF_RULES.prj_platforms += "$${LITERAL_HASH}include \"bld_generic.inf\""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/group/loadgen.mmp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/group/loadgen_extraicons.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009 Nokia Corporation and/or 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/group/loadgen_icons_aif.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009 Nokia Corporation and/or 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/group/loadgen_stub_sis.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009 Nokia Corporation and/or 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:  
 #
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen.hrh	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,190 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/inc/loadgen_app.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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/inc/loadgen_applications.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_appui.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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/inc/loadgen_bluetooth.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_cpuload.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_document.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/inc/loadgen_editors.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,339 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/inc/loadgen_keypress.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_loadattributes.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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/inc/loadgen_loadbase.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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/inc/loadgen_maincontainer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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/inc/loadgen_mainview.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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/inc/loadgen_memoryeat.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_messages.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,421 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_model.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_netconn.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_phonecall.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_photocapture.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_pointerevent.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/inc/loadgen_settingsviewdlg.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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/inc/loadgen_std.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/inc/loadgen_traces.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 __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__
+
--- a/loadgen/loadgen.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#
-# 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/rom/loadgen.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -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 __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)
+#ifdef S60_UPGRADABLE_APP_REG_RSC
+  S60_UPGRADABLE_APP_REG_RSC(LoadGen)
+#else
+  S60_APP_AIF_RSC(LoadGen)
+#endif
+
+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__
--- a/loadgen/sis/LoadGen_S60-30.pkg	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/sis/LoadGen_S60-30.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; Copyright (c) 2009 Nokia Corporation and/or 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/loadgen/sis/LoadGen_stub.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -1,5 +1,5 @@
 ;
-; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+; Copyright (c) 2009 Nokia Corporation and/or 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,10 +11,9 @@
 ;
 ; Contributors:
 ;
-; Description: 
+; Description:
 ;
 
-
 ; Language - standard language definitions
 &EN
 
@@ -29,7 +28,6 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\LoadGen.exe"
-""-"z:\Resource\Apps\LoadGen.mif"
 ""-"z:\Resource\Apps\LoadGen_aif.mif"
 ""-"z:\Resource\Apps\LoadGen_ExtraIcons.mif"
 ""-"z:\Resource\Apps\LoadGen.rsc"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_app.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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/src/loadgen_applications.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,686 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_appui.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/src/loadgen_bluetooth.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,339 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_cpuload.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_document.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/src/loadgen_editors.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1437 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/src/loadgen_keypress.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,257 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_loadbase.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_maincontainer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+// 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/src/loadgen_mainview.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,175 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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/src/loadgen_memoryeat.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,603 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_messages.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,978 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_model.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1140 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_netconn.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,293 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_phonecall.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,353 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_photocapture.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,389 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_pointerevent.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,271 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadgen/src/loadgen_settingsviewdlg.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,323 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- a/loadgen/ui/avkon/data/loadgen.rss	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1421 +0,0 @@
-/*
-* 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
-//
-// ---------------------------------------------------------
-//
--- a/loadgen/ui/avkon/data/loadgen_reg.rss	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* 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";    
-    }
--- a/loadgen/ui/avkon/group/bld.inf	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* ============================================================================
-*  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
-
--- a/loadgen/ui/avkon/group/loadgen.mmp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/inc/loadgen_app.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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
-
--- a/loadgen/ui/avkon/inc/loadgen_appui.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/inc/loadgen_document.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* 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
-
--- a/loadgen/ui/avkon/inc/loadgen_editors.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,339 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/inc/loadgen_maincontainer.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/inc/loadgen_mainview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/inc/loadgen_model.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/inc/loadgen_settingsviewdlg.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
-* 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
-
--- a/loadgen/ui/avkon/rom/loadgen.iby	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* 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)
-#ifdef S60_UPGRADABLE_APP_REG_RSC
-  S60_UPGRADABLE_APP_REG_RSC(LoadGen)
-#else
-  S60_APP_AIF_RSC(LoadGen)
-#endif
-
-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__
--- a/loadgen/ui/avkon/src/loadgen_app.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* 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  
-
--- a/loadgen/ui/avkon/src/loadgen_appui.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
-* 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  
--- a/loadgen/ui/avkon/src/loadgen_document.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
-* 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  
--- a/loadgen/ui/avkon/src/loadgen_editors.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1437 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/src/loadgen_maincontainer.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,457 +0,0 @@
-/*
-* 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  
--- a/loadgen/ui/avkon/src/loadgen_mainview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/src/loadgen_model.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,910 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/avkon/src/loadgen_settingsviewdlg.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,323 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/hb/hb.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-# 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
-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: { 
-    MMP_RULES -= PAGED
-    MMP_RULES *= UNPAGED
-    BLD_INF_RULES.prj_exports += "./rom/loadgen.iby CORE_IBY_EXPORT_PATH(tools,loadgen.iby)"
-    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-    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_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 \
-        -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!")
--- a/loadgen/ui/hb/inc/engine.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-/*
-* 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
-
--- a/loadgen/ui/hb/inc/enginewrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/hb/inc/mainview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/hb/inc/notifications.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
-* 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_
--- a/loadgen/ui/hb/inc/settingsview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/hb/loadgen.qrc	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-<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>
--- a/loadgen/ui/hb/rom/loadgen.iby	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* 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__
--- a/loadgen/ui/hb/src/engine.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1240 +0,0 @@
-/*
-* 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
--- a/loadgen/ui/hb/src/enginewrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,737 +0,0 @@
-/*
-* 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 <hbaction.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)
-{
-    if( action && !action->text().compare("yes", Qt::CaseInsensitive) ){
-        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); 
-}
-
-// ---------------------------------------------------------------------------	
--- a/loadgen/ui/hb/src/main.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* 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();
-}
--- a/loadgen/ui/hb/src/mainview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,399 +0,0 @@
-/*
-* 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);
-//TODO to be fixed using replacement for downloadmanager
-/*
-		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);
-	}
-}	
-
-// ---------------------------------------------------------------------------
--- a/loadgen/ui/hb/src/notifications.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* 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();
-}
-
-// ---------------------------------------------------------------------------
--- a/loadgen/ui/hb/src/settingsview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1255 +0,0 @@
-/*
-* 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/data/memspyui.rss	Tue Aug 31 15:15:20 2010 +0300
+++ b/memspyui/data/memspyui.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -35,7 +35,7 @@
 
 
 // User includes
-#include "../ui/avkon/inc/MemSpy.hrh"
+#include "MemSpy.hrh"
 
 
 RESOURCE RSS_SIGNATURE { }
@@ -1019,7 +1019,7 @@
             id = EAknMessageQueryContentId;
             control = AVKON_MESSAGE_QUERY
 				{
-                message = "Version 1.2.0 - 27th October 2009. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
+                message = "Version 1.2.1 - 15th June 2010. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
 				};
 			}
 		};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/group/MemSpyCapabilities.mmh	Wed Sep 01 12:30:35 2010 +0100
@@ -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
--- a/memspyui/group/bld.inf	Tue Aug 31 15:15:20 2010 +0300
+++ b/memspyui/group/bld.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -11,20 +11,44 @@
 *
 * Contributors:
 *
-* Description:  
+* Description:
 *
 */
 
+
 #include <platform_paths.hrh>
+#include "../memspywindowserverhelper/group/bld.inf"
 
-prj_platforms
+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)
 
-WINSCW GCCE ARMV5 ARMV6
+
+PRJ_MMPFILES
+memspyui.mmp
+
+#ifndef SBSV2
+  gnumakefile memspyui_icons_aif.mk
 
-#include "bld_generic.inf"
-
-#include "../ui/avkon/group/bld.inf"
+  #ifdef MARM
+  gnumakefile memspyui_stub_sis.mk
+  #endif
+#endif
 
-prj_mmpfiles
+#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_extensions
\ No newline at end of file
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME MemSpy_stub
+  END
+  #endif 
+#endif
--- a/memspyui/group/bld_generic.inf	Tue Aug 31 15:15:20 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 <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
--- a/memspyui/group/group.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#
-# 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\""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/group/memspyui.mmp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+
+#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 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpy.hrh	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyApp.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyAppUi.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyContainer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyContainerObserver.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyDeviceWideOperationDialog.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyDocument.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyExportBitmapsToMemoryCardDialog.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpySettings.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyUiUtils.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewBase.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyViewChunkList.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewCodeSegList.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewDriveInfo.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewECom.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewFBServBitmaps.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewHeapTracking.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewHeapTrackingResults.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewHeapTrackingSettings.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewKernel.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyViewKernelContainers.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyViewKernelHeap.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyViewKernelObjects.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyViewMainMenu.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyViewMemoryTrackingAutoStartConfig.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewObserver.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewOpenFiles.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewProcesses.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+#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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyViewRAMInfo.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewROMInfo.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewServerList.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewSystemConfig.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemActiveObject.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemChunk.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemCodeSeg.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemGeneralInfo.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemGeneric.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemHeap.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemList.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemMemoryTracking.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemServer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreadInfoItemStack.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewThreads.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/include/MemSpyViewType.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/MemSpyViewWindowGroups.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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/include/viewcli.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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
--- a/memspyui/memspyui.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-#
-# 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/memspyui/rom/memspyui.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -22,8 +22,11 @@
 S60_APP_EXE(MemSpyUI)
 S60_APP_AIF_ICONS(MemSpyUI)
 S60_APP_RESOURCE(MemSpyUI)
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,MemSpyUI)
-data=ZPRIVATE\10003a3f\import\APPS\MemSpyUI_reg.RSC Private\10003a3f\import\Apps\MemSpyUI_reg.rsc
+#ifdef S60_UPGRADABLE_APP_REG_RSC
+  S60_UPGRADABLE_APP_REG_RSC(MemSpyUI)
+#else
+  S60_APP_AIF_RSC(MemSpyUI)
+#endif
 
 
 data=ZPRIVATE\2002129F\MemSpyEComInterfaceIds.xml							\private\2002129F\MemSpyEComInterfaceIds.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyApp.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyAppUi.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,721 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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();
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyContainer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+#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 );
+    }
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyDeviceWideOperationDialog.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyDocument.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+#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 );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyExportBitmapsToMemoryCardDialog.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpySettings.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,273 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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() ) );
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyUiUtils.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewBase.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,413 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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;
+        }
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyViewChunkList.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewCodeSegList.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewDriveInfo.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewECom.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewFBServBitmaps.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewHeapTracking.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewHeapTrackingResults.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewHeapTrackingSettings.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewKernel.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,161 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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;
+    }
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyViewKernelContainers.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+#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 );
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyViewKernelHeap.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+*
+*/
+
+#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();
+    }
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyViewKernelObjects.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,851 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 );
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyViewMainMenu.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,300 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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;
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyViewMemoryTrackingAutoStartConfig.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewOpenFiles.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewProcesses.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,513 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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;
+        }
+    }
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyViewRAMInfo.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewROMInfo.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewServerList.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewSystemConfig.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemActiveObject.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemChunk.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemCodeSeg.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemGeneralInfo.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemGeneric.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemHeap.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemList.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemMemoryTracking.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemServer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreadInfoItemStack.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewThreads.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,355 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 );
+    }
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/memspyui/source/MemSpyViewType.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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/source/MemSpyViewWindowGroups.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 );
+    }
+
+
--- a/memspyui/ui/avkon/group/MemSpyCapabilities.mmh	Tue Aug 31 15:15:20 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/ui/avkon/group/bld.inf	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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
--- a/memspyui/ui/avkon/group/memspyui.mmp	Tue Aug 31 15:15:20 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:
-*
-*/
-
-
-#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 
--- a/memspyui/ui/avkon/inc/MemSpy.hrh	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyApp.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyAppUi.h	Tue Aug 31 15:15:20 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 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>
-#include "MemSpySettings.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 OnCmdPhoneInformationOperationL( TDeviceWideOperation aOperation );
-    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;
-    CMemSpySettings* iSettings;
-    
-    // For phone information dialog
-    TBool iRunningDeviceWideOperation;
-    
-    // For auto-capture
-    TInt iAutoCaptureTimerPeriod;
-    CMemSpyDeviceWideOperations::TOperation iAutoCaptureOperationType;
-    CPeriodic* iAutoCaptureTimer;
-    };
-
-
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyContainer.h	Tue Aug 31 15:15:20 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 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
--- a/memspyui/ui/avkon/inc/MemSpyContainerObserver.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyDeviceWideOperationDialog.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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>
-#include <e32cmn.h>
-
-// Engine includes
-#include <memspy/engine/memspydevicewideoperations.h>
-#include <memspyengineclientinterface.h>
-#include <memspysession.h>
-
-//#include "MemSpyAppUi.h"
-
-// Classes referenced
-//class RMemSpySession;
-
-enum TDeviceWideOperation
-{
-	OutputPhoneInfo = 0,
-	    
-	OutputDetailedPhoneInfo,
-	    
-	OutputHeapInfo,
-	    
-	OutputCompactHeapInfo,
-	    
-	OutputHeapCellListing,
-	    
-	OutputHeapData,
-	    
-	OutputStackInfo,
-	    
-	OutputCompactStackInfo,
-	    
-	OutputUserStackData,
-	    
-	OutputKernelStackData
-};
-
-
-class MMemSpyDeviceWideOperationDialogObserver
-    {
-public:
-    virtual void DWOperationStarted() = 0;
-    virtual void DWOperationCancelled() = 0;
-    virtual void DWOperationCompleted() = 0;
-    };
-
-
-class CMemSpyDwoProgressTracker : public CActive, public MProgressDialogCallback
-{
-public:
-	CMemSpyDwoProgressTracker(RMemSpySession &aSession);
-	
-	virtual ~CMemSpyDwoProgressTracker();
-	
-	void Start();
-	
-	void Cancel();
-	
-	TMemSpyDeviceWideOperationProgress Progress() { return iProgress; }
-	
-	CAknProgressDialog* ProgressDialog() { return iProgressDialog; }
-	
-	void UpdateProcessDialogL( TInt aProgress, const TDesC& aProgressText );
-
-protected: // from CActive
-	
-	void DialogDismissedL(TInt aButtonId);
-	
-	virtual void RunL();
-	 
-	virtual void DoCancel();
-	 
-	virtual TInt RunError(TInt aError);
-	
-private:
-	TMemSpyDeviceWideOperationProgress iProgress;
-	RMemSpySession iSession;	
-	
-	CEikProgressInfo* iProgressInfo;
-	CAknProgressDialog* iProgressDialog;		
-};
-
-
-
-
-
-
-class CMemSpyDwoTracker : public CActive
-{	
-public:	
-	CMemSpyDwoTracker(RMemSpySession &aSession, TDeviceWideOperation aOperation);
-	
-	virtual ~CMemSpyDwoTracker();
-	
-	void Start();
-	
-	void Cancel();		
-	
-protected: // from CActive
-	
-	virtual void RunL();
-	 
-	virtual void DoCancel();
-	 
-	virtual TInt RunError(TInt aError);		
-	
-private:
-	RMemSpySession iSession;
-	CMemSpyDwoProgressTracker *iProgressTracker;	
-	TDeviceWideOperation iOperation;
-};
-
-
-
-
-
-
-
-class CMemSpyDeviceWideOperationDialog : public CBase, public MProgressDialogCallback, public MMemSpyDeviceWideOperationsObserver
-    {
-public:
-    //static void ExecuteLD( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver, CMemSpyDeviceWideOperations::TOperation aOperation );
-	//static void ExecuteLD( RMemSpySession& aSession, MMemSpyDeviceWideOperationDialogObserver& aObserver, CMemSpyDeviceWideOperations::TOperation aOperation );
-	static void ExecuteLD( RMemSpySession& aSession, TDeviceWideOperation aOp );
-    ~CMemSpyDeviceWideOperationDialog();
-    
-    //added
-    static CMemSpyDwoTracker* CreateDeviceWideOperation( RMemSpySession& aSession, TDeviceWideOperation aOp );
-
-private:
-    //CMemSpyDeviceWideOperationDialog( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver );
-    //CMemSpyDeviceWideOperationDialog( RMemSpySession& aSession, MMemSpyDeviceWideOperationDialogObserver& aObserver );
-    CMemSpyDeviceWideOperationDialog( RMemSpySession& aSession );
-    //void ExecuteL( CMemSpyDeviceWideOperations::TOperation aOperation );
-    void ExecuteL( TDeviceWideOperation aOp );
-
-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;
-    RMemSpySession iSession;	
-    //MMemSpyDeviceWideOperationDialogObserver& iObserver;
-    TBool iForcedCancel;
-    CEikProgressInfo* iProgressInfo;
-    CAknProgressDialog* iProgressDialog;
-    CMemSpyDeviceWideOperations* iOperation;        
-    };
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyDocument.h	Tue Aug 31 15:15:20 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 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
--- a/memspyui/ui/avkon/inc/MemSpyExportBitmapsToMemoryCardDialog.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpySettings.h	Tue Aug 31 15:15:20 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 MEMSPYSETTINGS_H
-#define MEMSPYSETTINGS_H
-
-// System includes
-#include <e32base.h>
-#include <badesca.h>
-#include <f32file.h>
-
-// Engine includes
-#include <memspy/engine/memspyengineoutputsink.h>
-#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.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();
-    
-    void SetSinkType( TMemSpySinkType aType ) { iSinkType = aType; }
-
-private: // Settings methods
-    void RestoreSettingsL();
-    void GetSettingsFileNameL( TDes& aFileName );
-    void GetSettingsPathL( TDes& aPath );
-    RFile SettingsFileLC( TBool aReplace = EFalse );
-
-private: // Data members
-    RFs& iFsSession;    
-    RMemSpySession& iMemSpySession;
-    
-private: //Settings
-    TMemSpySinkType iSinkType;
-    TMemSpyEngineHelperSysMemTrackerConfig iSwmtConfig;
-    RArray<TUid> iUidList;
-    };
-
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyUiUtils.h	Tue Aug 31 15:15:20 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 MEMSPYUIUTILS_H
-#define MEMSPYUIUTILS_H
-
-// System includes
-#include <e32std.h>
-#include <e32const.h>
-
-// Engine includes
-#include <memspy/engine/memspyengineutils.h>
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-
-typedef TBuf<20> TMemSpySizeText;
-
-_LIT( KTab, "\t" );
-
-//ThreadInfoItemList view types
-_LIT( KTypeUnknown, "Unknown Type" );
-_LIT( KGeneral, "General" );
-_LIT( KHeap, "Heap" );
-_LIT( KStack, "Stack" );
-_LIT( KChunks, "Chunks" );
-_LIT( KCodeSegs, "Code Segments" );
-_LIT( KOpenFiles, "Open Files" );
-_LIT( KActiveObjects, "Active Objects" );
-_LIT( KThreadHandlers, "Handlers to other Threads" );
-_LIT( KProcessHandlers, "Handlers to other Processes" );
-_LIT( KServers, "Servers running in Thread" );
-_LIT( KConnections, "Client <> Server Connections" );
-_LIT( KSemaphores, "Semaphores" );
-_LIT( KThreadReferences, "References in Thread" );
-_LIT( KProcessReferences, "References in Process" );
-_LIT( KMutexes, "Mutexes" );
-_LIT( KTimers, "Timers" );
-_LIT( KDD, "Logical DD Channels" );
-_LIT( KChangeNotif, "Change Notifiers" );
-_LIT( KUndertakers, "Undertakers" );
-_LIT( KLogicalDrivers, "Logical Device Drivers" );
-_LIT( KPhysicalDrivers, "Physical Device Drivers" );	
-
-//Kernel Object types
-_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." );
-
-
-class MemSpyUiUtils : public MemSpyEngineUtils
-    {
-public:
-    static void Format( TDes& aBuf, TInt aResourceId, ...);
-    static void GetErrorText( TDes& aBuf, TInt aError );
-    static HBufC* FormatItem( const TDesC& aCaption );
-    static TDesC& ThreadInfoItemNameByType( TMemSpyThreadInfoItemType aType );
-    static void AppendPriority( TDes& aDes, TProcessPriority aPriority );
-    static void AppendExitInfo( TDes& aDes, TExitType aType, TInt aExitReason, const TDesC& aExitCategory  );
-    static void AppendExitType( TDes& aDes, TExitType aType );
-    
-    //for Kernel Objects
-    static TPtrC TypeAsString( TMemSpyDriverContainerType aType );
-    static TMemSpySizeText FormatSizeText( const TInt64& aValue, TInt aDecimalPlaces, TBool aExtraRounding = EFalse );
-    };
-
-
-
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyViewBase.h	Tue Aug 31 15:15:20 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 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
--- a/memspyui/ui/avkon/inc/MemSpyViewChunkList.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewCodeSegList.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewDriveInfo.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewECom.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewFBServBitmaps.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewHeapTracking.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewHeapTrackingResults.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewHeapTrackingSettings.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewKernel.h	Tue Aug 31 15:15:20 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 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
--- a/memspyui/ui/avkon/inc/MemSpyViewKernelContainers.h	Tue Aug 31 15:15:20 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 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
--- a/memspyui/ui/avkon/inc/MemSpyViewKernelHeap.h	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#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
--- a/memspyui/ui/avkon/inc/MemSpyViewKernelObjects.h	Tue Aug 31 15:15:20 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 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
--- a/memspyui/ui/avkon/inc/MemSpyViewMainMenu.h	Tue Aug 31 15:15:20 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 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
--- a/memspyui/ui/avkon/inc/MemSpyViewMemoryTrackingAutoStartConfig.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewObserver.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewOpenFiles.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewProcesses.h	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#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
--- a/memspyui/ui/avkon/inc/MemSpyViewRAMInfo.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewROMInfo.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewServerList.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewSystemConfig.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewThreadInfoItemActiveObject.h	Tue Aug 31 15:15:20 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 RMemSpySession;
-
-
-class CMemSpyViewThreadInfoItemActiveObjectBase : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemActiveObjectBase( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
-    
-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( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
-    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/ui/avkon/inc/MemSpyViewThreadInfoItemChunk.h	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMCHUNK_H
-#define MEMSPYVIEWTHREADINFOITEMCHUNK_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-class RMemSpySession;
-
-class CMemSpyViewThreadInfoItemChunk : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemChunk( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId,  TThreadId aId, TMemSpyThreadInfoItemType aType );
-
-private: // From CMemSpyViewBase
-    CMemSpyViewBase* PrepareChildViewL();
-    };
-
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemCodeSeg.h	Tue Aug 31 15:15:20 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 MEMSPYVIEWTHREADINFOITEMCODESEG_H
-#define MEMSPYVIEWTHREADINFOITEMCODESEG_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-class RMemSpySession;
-
-class CMemSpyViewThreadInfoItemCodeSeg : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemCodeSeg( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-
-private: // From CMemSpyViewBase
-    CMemSpyViewBase* PrepareChildViewL();
-    };
-
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneralInfo.h	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMGENERALINFO_H
-#define MEMSPYVIEWTHREADINFOITEMGENERALINFO_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-class CMemSpyThreadInfoContainer;
-class CMemSpyThreadInfoItemBase;
-class RMemSpySession;
-
-class CMemSpyViewThreadInfoItemGeneralInfo : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemGeneralInfo( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
-
-public: // From CMemSpyViewBase
-    TBool HandleCommandL( TInt aCommand );
-    void HandleListBoxItemActionedL( TInt aCurrentIndex );
-
-private: // Command handlers
-    void OnCmdToggleKernelEventHooksL();
-    };
-
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemGeneric.h	Tue Aug 31 15:15:20 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 MEMSPYVIEWTHREADINFOITEMGENERIC_H
-#define MEMSPYVIEWTHREADINFOITEMGENERIC_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// Engine includes
-#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
-#include <memspy/api/memspyapithreadinfoitem.h>
-
-// User includes
-#include "MemSpyViewBase.h"
-
-// Classes referenced
-class CAknWaitDialog;
-class CMemSpyProcess;
-class CMemSpyThread;
-class CMemSpyThreadInfoContainer;
-class CMemSpyThreadInfoItemBase;
-class RMemSpySession;
-
-class CMemSpyViewThreadInfoItemGeneric : public CMemSpyViewBase
-    {
-public:
-    //CMemSpyViewThreadInfoItemGeneric( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aInfoContainer, TMemSpyThreadInfoItemType aType );
-	CMemSpyViewThreadInfoItemGeneric( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcessId, TThreadId aId, 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;
-    TThreadId ThreadId() { return iThreadId; }
-    
-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;
-    
-    RArray<CMemSpyApiThreadInfoItem*> iThreadInfoItems;  //cigasto
-    CDesCArrayFlat* iModel;
-    TThreadId iThreadId;
-    TProcessId iParentProcessId;
-    TMemSpyThreadInfoItemType iType;
-    };
-
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemHeap.h	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#ifndef MEMSPYVIEWTHREADINFOITEMHEAP_H
-#define MEMSPYVIEWTHREADINFOITEMHEAP_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-class RMemSpySession;
-
-class CMemSpyViewThreadInfoItemHeap : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemHeap( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType  );
-
-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/ui/avkon/inc/MemSpyViewThreadInfoItemList.h	Tue Aug 31 15:15:20 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 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 RMemSpySession;
-
-class CMemSpyViewThreadInfoItemList : public CMemSpyViewBase, public MMemSpyThreadInfoContainerObserver
-    {
-public:
-    //CMemSpyViewThreadInfoItemList( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThread& aThread );
-	CMemSpyViewThreadInfoItemList( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcess, TThreadId aThread );
-    ~CMemSpyViewThreadInfoItemList();
-    void ConstructL( const TRect& aRect, CCoeControl& aContainer, TMemSpyThreadInfoItemType iType);
-
-public: // API
-    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;
-    TThreadId iThreadId;
-    TProcessId iParentProcessId;
-    CMemSpyThreadInfoItemBase* iCurrentInfoItem;
-    TInt iCurrentInfoItemId;
-    CPeriodic* iIdleResetListboxTimer;
-    };
-
-
-#endif
--- a/memspyui/ui/avkon/inc/MemSpyViewThreadInfoItemMemoryTracking.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewThreadInfoItemServer.h	Tue Aug 31 15:15:20 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 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 RMemSpySession;
-
-class CMemSpyViewThreadInfoItemServer : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemServer( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
-
-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/ui/avkon/inc/MemSpyViewThreadInfoItemStack.h	Tue Aug 31 15:15:20 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 MEMSPYVIEWTHREADINFOITEMSTACK_H
-#define MEMSPYVIEWTHREADINFOITEMSTACK_H
-
-// System includes
-#include <coecntrl.h>
-#include <aknlists.h>
-
-// User includes
-#include "MemSpyViewThreadInfoItemGeneric.h"
-
-class RMemSpySession;
-
-class CMemSpyViewThreadInfoItemStack : public CMemSpyViewThreadInfoItemGeneric
-    {
-public:
-    CMemSpyViewThreadInfoItemStack( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType );
-
-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/ui/avkon/inc/MemSpyViewThreads.h	Tue Aug 31 15:15:20 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 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, TThreadId aThreadId );
-    ~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
--- a/memspyui/ui/avkon/inc/MemSpyViewType.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/MemSpyViewWindowGroups.h	Tue Aug 31 15:15:20 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/ui/avkon/inc/viewcli.h	Tue Aug 31 15:15:20 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
--- a/memspyui/ui/avkon/src/MemSpyApp.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyAppUi.cpp	Tue Aug 31 15:15:20 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 "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 );
-    	OnCmdPhoneInformationOperationL( OutputPhoneInfo );
-        break;        
-    case EMemSpyCmdPhoneInfoGeneralDetailed:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralDetailed );
-        OnCmdPhoneInformationOperationL( OutputDetailedPhoneInfo );
-        break;
-    /*
-    case EMemSpyCmdPhoneInfoGeneralHandles:
-        OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityGeneralHandles );
-        break;
-    case EMemSpyCmdPhoneInfoGeneralKernelContainers:
-        OnCmdPhoneInformationOperationKernelContainersL();
-        break;
-    //
-    */
-    case EMemSpyCmdPhoneInfoHeapInfoSummary:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapInfo );
-    	OnCmdPhoneInformationOperationL (OutputHeapInfo );
-        break;
-    case EMemSpyCmdPhoneInfoHeapInfoCompact:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceHeapInfoCompact );
-    	OnCmdPhoneInformationOperationL( OutputCompactHeapInfo );
-        break;
-    case EMemSpyCmdPhoneInfoHeapCellListing:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapCellListing );
-        OnCmdPhoneInformationOperationL( OutputHeapCellListing );
-        break;
-        
-    case EMemSpyCmdPhoneInfoHeapDump:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityHeapData );
-    	OnCmdPhoneInformationOperationL( OutputHeapData );
-        break;
-    //		   		    		
-    case EMemSpyCmdPhoneInfoStackInfo:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackInfo );
-        OnCmdPhoneInformationOperationL( OutputStackInfo );
-        break;
-    case EMemSpyCmdPhoneInfoStackInfoCompact:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EEntireDeviceStackInfoCompact );
-        OnCmdPhoneInformationOperationL( OutputCompactStackInfo );
-        break;
-    case EMemSpyCmdPhoneInfoStackDumpUser:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataUser );
-    	OnCmdPhoneInformationOperationL( OutputUserStackData );
-        break;
-    case EMemSpyCmdPhoneInfoStackDumpKernel:
-        //OnCmdPhoneInformationOperationL( CMemSpyDeviceWideOperations::EPerEntityStackDataKernel );
-        OnCmdPhoneInformationOperationL( OutputKernelStackData );
-        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( TDeviceWideOperation aOperation )
-    {	
-	//
-	//CMemSpyDeviceWideOperationDialog::ExecuteLD( iMemSpySession, aOperation );
-	CMemSpyDwoTracker* tracker = CMemSpyDeviceWideOperationDialog::CreateDeviceWideOperation( iMemSpySession, aOperation );
-	tracker->Start();		
-	/*
-#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( 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()
-    {
-	iMemSpySession.SwitchOutputSink( ESinkTypeDebug ); //set in engine
-	MemSpyDocument().Settings().SetSinkType( ESinkTypeDebug ); //set in settings
-    }
-
-
-void CMemSpyAppUi::OnCmdOutputToFileL()
-    {
-	iMemSpySession.SwitchOutputSink( ESinkTypeFile ); //set in engine
-	MemSpyDocument().Settings().SetSinkType( ESinkTypeFile ); //set in settings
-    }
-
-
-
-
-
-
-
-
-
-
-
-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();
-    }
-
-
-
-
--- a/memspyui/ui/avkon/src/MemSpyContainer.cpp	Tue Aug 31 15:15:20 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 "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 );
-    }
-
-
-
-
-
-
-
-
--- a/memspyui/ui/avkon/src/MemSpyDeviceWideOperationDialog.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,387 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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>
-
-#include <memspysession.h>
-
-/*
-CMemSpyDeviceWideOperationDialog::CMemSpyDeviceWideOperationDialog( CMemSpyEngine& aEngine, MMemSpyDeviceWideOperationDialogObserver& aObserver )
-:   iEngine( aEngine ), iObserver( aObserver )
-    {
-    }
-
-CMemSpyDeviceWideOperationDialog::CMemSpyDeviceWideOperationDialog( RMemSpySession& aSession, MMemSpyDeviceWideOperationDialogObserver& aObserver )
-:   iSession( aSession ), iObserver( aObserver )
-    {
-    }    
-*/
-
-CMemSpyDeviceWideOperationDialog::CMemSpyDeviceWideOperationDialog( RMemSpySession& aSession )
-:   iSession( aSession )
-    {
-    }    
-
-
-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(); //TODO
-
-#ifdef _DEBUG
-    RDebug::Printf("[MemSpy] CMemSpyDeviceWideOperationDialog::~CMemSpyDeviceWideOperationDialog() - END" );
-#endif
-    }
-
-
-//void CMemSpyDeviceWideOperationDialog::ExecuteL( CMemSpyDeviceWideOperations::TOperation aOperation )
-void CMemSpyDeviceWideOperationDialog::ExecuteL( TDeviceWideOperation aOp )
-    {
-	/*
-#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( RMemSpySession& aSession, TDeviceWideOperation aOp )
-    {
-    //CMemSpyDeviceWideOperationDialog* self = new(ELeave) CMemSpyDeviceWideOperationDialog( aSession, aObserver );
-	CMemSpyDeviceWideOperationDialog* self = new(ELeave) CMemSpyDeviceWideOperationDialog( aSession );
-    CleanupStack::PushL( self );
-    self->ExecuteL( aOp );
-    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();
-        }
-    }
-
-CMemSpyDwoTracker* CMemSpyDeviceWideOperationDialog::CreateDeviceWideOperation( RMemSpySession& aSession, TDeviceWideOperation aOp )
-{
-	return new CMemSpyDwoTracker( aSession, aOp );
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyDwoProgressTracker::CMemSpyDwoProgressTracker(RMemSpySession &aSession) 
-	: CActive( EPriorityStandard ), iSession( aSession )
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CMemSpyDwoProgressTracker::~CMemSpyDwoProgressTracker()
-	{
-	Cancel();	
-	}
-
-void CMemSpyDwoProgressTracker::Start()
-	{
-	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();	
-	
-	iSession.NotifyDeviceWideOperationProgress( iProgress, iStatus );
-	
-	UpdateProcessDialogL( iProgress.Progress(), iProgress.Description() );
-	
-	SetActive();
-	
-	iProgressDialog->RunLD();
-	}
-
-void CMemSpyDwoProgressTracker::Cancel()
-	{	
-	}
-
-void CMemSpyDwoProgressTracker::RunL()
-    { 		
-    // If an error occurred handle it in RunError().
-    User::LeaveIfError(iStatus.Int());
- 
-    // Resubmit the request immediately    
-    iSession.NotifyDeviceWideOperationProgress( iProgress, iStatus );     
-    
-    SetActive();            
-    
-    UpdateProcessDialogL( iProgress.Progress(), iProgress.Description() );    
-    }
- 
-void CMemSpyDwoProgressTracker::DoCancel()
-	{ 	
-	}
- 
-TInt CMemSpyDwoProgressTracker::RunError(TInt aError)
-	{ 
-	// KErrNotReady and KErrCancel errors are OK, they just notify 
-	// us about the outstanding notification request that won't be 
-	// processed.		
-    return KErrNone;
-	}
-
-void CMemSpyDwoProgressTracker::UpdateProcessDialogL( TInt aProgress, const TDesC& aProgressText )
-	{
-	if(iProgressDialog)
-		{
-		iProgressDialog->SetTextL( aProgressText );
-	    }
-	 
-	if(iProgressInfo)
-		{
-	    iProgressInfo->SetAndDraw( aProgress );	
-		}
-	}
-
-void CMemSpyDwoProgressTracker::DialogDismissedL(TInt aButtonId)
-	{
-	iProgressDialog = NULL;
-	iProgressInfo = NULL;	
-	 
-	Cancel();
-	}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-CMemSpyDwoTracker::CMemSpyDwoTracker( RMemSpySession &aSession, TDeviceWideOperation aOperation )
-:	CActive( EPriorityStandard ), 
-	iSession( aSession ),
-	iProgressTracker(new CMemSpyDwoProgressTracker( aSession )),
-	iOperation( aOperation )
-	{
-	CActiveScheduler::Add(this);
-	}
-
-CMemSpyDwoTracker::~CMemSpyDwoTracker()
-	{		
-	Cancel();
-	
-	delete iProgressTracker;
-	}
-
-void CMemSpyDwoTracker::Start()
-{	
-	void (RMemSpySession::*functions[])(TRequestStatus&) = { 
-		&RMemSpySession::OutputPhoneInfo,
-		&RMemSpySession::OutputDetailedPhoneInfo,
-		&RMemSpySession::OutputHeapInfo,
-		&RMemSpySession::OutputCompactHeapInfo,
-		&RMemSpySession::OutputHeapCellListing,
-		&RMemSpySession::OutputHeapData,
-		&RMemSpySession::OutputStackInfo,
-		&RMemSpySession::OutputCompactStackInfo,
-		&RMemSpySession::OutputUserStackData,
-		&RMemSpySession::OutputKernelStackData };
-		
-	(iSession.*functions[iOperation])(iStatus);			
-	
-	SetActive();
-	
-	iProgressTracker->Start();				
-}
-
-void CMemSpyDwoTracker::Cancel()
-{
-}
- 
-void CMemSpyDwoTracker::RunL()
-    { 
-    // If an error occurred handle it in RunError().
-    User::LeaveIfError(iStatus.Int());
- 
-    if( !IsActive() )
-    	{
-		iProgressTracker->ProgressDialog()->ProcessFinishedL();
-    	}
-    }
- 
-void CMemSpyDwoTracker::DoCancel()
-{ 
-	// Cancel progress tracker
-	iProgressTracker->Cancel();
-	
-	iSession.CancelDeviceWideOperationL();	
-}
- 
-TInt CMemSpyDwoTracker::RunError(TInt aError)
-{ 
-	// Emit the finished(false) signal to notify user 
-	// operation was canceled
-	//emit finished(false); //TODO:
-	
-    return KErrNone;
-}
--- a/memspyui/ui/avkon/src/MemSpyDocument.cpp	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#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 );
-    }
-
--- a/memspyui/ui/avkon/src/MemSpyExportBitmapsToMemoryCardDialog.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpySettings.cpp	Tue Aug 31 15:15:20 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 "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 <memspysession.h>
-
-// Constants
-_LIT( KMemSpySettingsFileName, "settings.dat" ); //file or avkon client settings
-
-// Version 03 dumped some of the system wide memory tracker settings
-const TInt KMemSpySettingsFileFormatVersion = 6;
-
-CMemSpySettings::CMemSpySettings( RFs& aFsSession, RMemSpySession& aSession )
-:   iFsSession( aFsSession ), iMemSpySession( aSession )
-    {	
-    }
-
-
-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, 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 );
-    
-    stream.WriteUint8L( iSinkType );
-    
-    
-    // Get SWMT config
-    //CMemSpyEngineHelperSysMemTracker& swmt = iEngine.HelperSysMemTracker();
-    //TMemSpyEngineHelperSysMemTrackerConfig swmtConfig;
-    //swmt.GetConfig( swmtConfig );
-
-    // Write SWMT settings
-    //stream.WriteInt32L( swmtConfig.TimerPeriod().Int() );
-    //stream.WriteUint8L( swmtConfig.DumpData() );
-    
-    stream.WriteInt32L( iSwmtConfig.TimerPeriod().Int() );
-    stream.WriteUint8L( iSwmtConfig.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;
-        }
-    */    
-    stream.WriteInt32L( iUidList.Count() );
-    for( TInt i = 0; i < iUidList.Count(); i++ )
-    	{
-		const TUid uid = iUidList[ 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 );
-    stream.WriteInt32L( iSwmtConfig.iEnabledCategories );
-    
-    // Write heap tracking thread name filter
-    //stream.WriteInt32L( swmtConfig.iThreadNameFilter.Length() );
-    stream.WriteInt32L( iSwmtConfig.iThreadNameFilter.Length() );
-    
-    /*
-    if ( swmtConfig.iThreadNameFilter.Length() > 0 )
-        {
-        stream.WriteL( swmtConfig.iThreadNameFilter, swmtConfig.iThreadNameFilter.Length() );
-        }
-    
-    // Write mode
-    stream.WriteInt32L( swmtConfig.iMode );
-    */
-    if ( iSwmtConfig.iThreadNameFilter.Length() > 0 )
-    	{
-		stream.WriteL( iSwmtConfig.iThreadNameFilter, iSwmtConfig.iThreadNameFilter.Length() );
-    	}
-        
-    // Write mode
-    stream.WriteInt32L( iSwmtConfig.iMode );
-    
-    stream.CommitL();
-    CleanupStack::PopAndDestroy( &stream ); // Closes file    
-    }
-
-void CMemSpySettings::RestoreSettingsL()
-    {  
-    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 );
-    //iMemSpySession.SwitchOutputSink( type ); //TODO: to argue to set stuf in engine from here
-    
-    // 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();
-        
-        //CArrayFixFlat<TUid>* list = new(ELeave)CArrayFixFlat<TUid>(count);
-        //CleanupStack::PushL(list );               
-        
-        for( TInt i=0; i<count; i++ )
-            {
-            TUid processUid;
-            stream >> processUid;
-            //           
-            User::LeaveIfError( list.Append( processUid ) );            
-            //list->AppendL( processUid );
-            }
-        //
-        //CMemSpyEngineHelperProcess& processHelper = iEngine.HelperProcess();
-        //processHelper.SetMemoryTrackingAutoStartProcessListL( list );        
-        //iMemSpySession.SetSwmtAutoStartProcessList( list );
-        iUidList = list; 	//TODO: to get it into the engine
-        
-        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 );
-    //iMemSpySession.SetSwmtConfig( swmtConfig );
-    
-    iSwmtConfig = swmtConfig; 	//TODO: to get it into the engine
-    
-    CleanupStack::PopAndDestroy( &stream ); // Closes file    
-    }
-
-
--- a/memspyui/ui/avkon/src/MemSpyUiUtils.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,367 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 );
-        }
-    }
-
-HBufC* MemSpyUiUtils::FormatItem( const TDesC& aCaption )
-	{
-	HBufC* retBuf = HBufC::NewL( 32 );
-	TPtr pRetBuf( retBuf->Des() );
-	pRetBuf.Zero();
-	pRetBuf.Append( _L("\t") );
-	pRetBuf.Append( aCaption );
-	return retBuf;
-	}
-
-TDesC& MemSpyUiUtils::ThreadInfoItemNameByType( TMemSpyThreadInfoItemType aType )
-	{	
-	TPtrC pType( KTypeUnknown );
-	
-	switch( aType )
-		{
-		case EMemSpyThreadInfoItemTypeFirst:			
-			pType.Set(KGeneral);
-			break;			
-		case EMemSpyThreadInfoItemTypeHeap:			
-			pType.Set(KHeap);
-			break;				
-		case EMemSpyThreadInfoItemTypeStack:			
-			pType.Set(KStack);
-			break;			
-		case EMemSpyThreadInfoItemTypeChunk:			
-			pType.Set(KChunks);
-			break;
-		case EMemSpyThreadInfoItemTypeCodeSeg:
-			pType.Set(KCodeSegs);
-			break;
-		case EMemSpyThreadInfoItemTypeOpenFiles:
-			pType.Set(KOpenFiles);
-			break;	
-		case EMemSpyThreadInfoItemTypeActiveObject:
-			pType.Set(KActiveObjects);
-			break;
-		case EMemSpyThreadInfoItemTypeOwnedThreadHandles:
-			pType.Set(KThreadHandlers);
-			break;
-		case EMemSpyThreadInfoItemTypeOwnedProcessHandles:
-			pType.Set(KProcessHandlers);
-			break;
-		case EMemSpyThreadInfoItemTypeServer:
-			pType.Set(KServers);
-			break;
-		case EMemSpyThreadInfoItemTypeSession:
-			pType.Set(KConnections);
-			break;
-		case EMemSpyThreadInfoItemTypeSemaphore:
-			pType.Set(KSemaphores);
-			break;
-		case EMemSpyThreadInfoItemTypeOtherThreads:
-			pType.Set(KThreadReferences);
-			break;
-		case EMemSpyThreadInfoItemTypeOtherProcesses:
-			pType.Set(KProcessReferences);
-			break;
-		case EMemSpyThreadInfoItemTypeMutex:
-			pType.Set(KMutexes);
-			break;
-		case EMemSpyThreadInfoItemTypeTimer:
-			pType.Set(KTimers);					
-			break;
-		case EMemSpyThreadInfoItemTypeLogicalChannel:
-			pType.Set(KDD);
-			break;
-		case EMemSpyThreadInfoItemTypeChangeNotifier:
-			pType.Set(KChangeNotif);
-			break;
-		case EMemSpyThreadInfoItemTypeUndertaker:
-			pType.Set(KUndertakers);
-			break;				
-		case EMemSpyThreadInfoItemTypeLDD:
-			pType.Set(KLogicalDrivers);
-			break;
-		case EMemSpyThreadInfoItemTypePDD:
-			pType.Set(KPhysicalDrivers);
-			break;
-			
-	    default:	       
-	    	break;  
-		}
-	return pType;
-	}
-
-
-void MemSpyUiUtils::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 MemSpyUiUtils::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 MemSpyUiUtils::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;
-        }
-    }
-
-
-TPtrC MemSpyUiUtils::TypeAsString( TMemSpyDriverContainerType aType )
-    {     
-    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;
-    }
-
-TMemSpySizeText MemSpyUiUtils::FormatSizeText( const TInt64& aValue, TInt aDecimalPlaces, TBool aExtraRounding )
-    {
-    _LIT(KFormatKilo, "%dK");
-    _LIT(KFormatMega, "%SM");
-    _LIT(KFormatGiga, "%SG");
-
-	TMemSpySizeText buf;
-	if  ( aValue < 1024000 )					// If < 1000K
-		{
-		TInt sizeInK = 0;
-
-        if  ( aValue != 0 )
-			{
-			sizeInK = I64INT( (aValue + 512) >> 10 );
-			if  (sizeInK < 1)
-                {
-				sizeInK = 1;
-                }
-			if  (sizeInK > 999)
-                {
-				sizeInK = 999;
-                }
-			}
-
-        buf.Format( KFormatKilo, sizeInK );
-		}
-	else
-		{
-		TReal sizeInM = I64INT( aValue );
-		sizeInM /= 1048576;
-		if  ( sizeInM < 1 )
-            {
-			sizeInM = 1;
-            }
-
-        TPtrC pFormat( KFormatMega );
-		if  ( sizeInM >= 1000 )
-			{
-			sizeInM /= 1024;				// Size in G
-			if  (sizeInM < 1)
-                {
-				sizeInM = 1;
-                }
-			
-            pFormat.Set( KFormatGiga );
-			}
-
-        if  ( sizeInM > 999.9)
-            {
-            sizeInM = 999.9;
-            }
-
-        if  ( aExtraRounding )
-            {
-			sizeInM += 0.499999;
-            }
-
-		TBuf<16> size;
-		size.Num( sizeInM, TRealFormat( 14, aDecimalPlaces ) );	// Allow for "17179869184.0"G which is 2^64
-        buf.Format( pFormat, &size );
-		}
-
-    return buf;
-    }
--- a/memspyui/ui/avkon/src/MemSpyViewBase.cpp	Tue Aug 31 15:15:20 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 "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;
-        }
-    }
-
-
-
-
--- a/memspyui/ui/avkon/src/MemSpyViewChunkList.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewCodeSegList.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewDriveInfo.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewECom.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewFBServBitmaps.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewHeapTracking.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewHeapTrackingResults.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewHeapTrackingSettings.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewKernel.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,170 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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( iMemSpySession, iObserver );
-        }
-    else if ( index == 1 )
-        {        
-		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;
-    }
-
-
-
-
-
-
-
-
--- a/memspyui/ui/avkon/src/MemSpyViewKernelContainers.cpp	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#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( MemSpyUiUtils::FormatSizeText( size, 0 ) );
-								
-		HBufC* tempName = HBufC::NewL( iKernelObjects[i]->Name().Length() + 32 );
-		
-		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( MemSpyUiUtils::TypeAsString( iKernelObjects[i]->Type() ) );
-		//
-		pName.Format( KNameFormat, &pType, count );
-		//
-		if  ( count == 0 || count > 1 )
-			{
-			pName.Append( _L("s") );
-			}
-
-		pName.AppendFormat( _L(", %S"), &sizeText );
-		
-		model->AppendL( pName );
-		
-		CleanupStack::PopAndDestroy( tempName); //---
-		}
-	
-	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()
-    {
-	iMemSpySession.OutputAllContainerContents();		
-    }
--- a/memspyui/ui/avkon/src/MemSpyViewKernelHeap.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,424 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 );
-		
-	model = FormatModel( iHeap );	
-				
-	CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-	listbox->Model()->SetItemTextArray( model );
-	listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );			
-	}
-
-
-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()
-    {	
-    iMemSpySession.DumpKernelHeap();
-    }
-
-
-//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( KMaxName );	
-	
-	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( KMaxName );
-	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( KMaxName );
-	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( KMaxName );
-	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( KMaxName );
-	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( KMaxName );
-	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( KMaxName );
-	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( KMaxName );
-	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( KMaxName );	//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;
-	}
--- a/memspyui/ui/avkon/src/MemSpyViewKernelObjects.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,923 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 );
-    	
-    	TBuf<KMaxName> temp;
-    	temp.Copy(iKernelObjectItems[i]->Name());    	
-    	tempNamePtr.Append( temp	 );
-    	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 )
-    {	
-    TKeyResponse resp = EKeyWasNotConsumed;
-    resp = CMemSpyViewBase::OfferKeyEventL( aKeyEvent, aType );    
-    //}
-    return resp;
-    }
-
-void CMemSpyViewKernelObjects::TabChangedL( TInt /*aIndex*/ )
-    {
-    }
-
-
-void CMemSpyViewKernelObjects::OnCmdTerminateL()
-    {
-    switch ( iObjectType )
-        {
-        case EMemSpyDriverContainerTypeThread:
-            {
-            TBool err = EFalse;
-            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
-                        
-            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.EndThread( id, ETerminate );
-					RefreshL();
-					}
-            	}            
-            
-            /*
-            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();
-                    }                
-                }
-            */            
-            break;
-            }        
-        case EMemSpyDriverContainerTypeProcess:
-            {
-            TBool err = EFalse;
-            TBool doTerminate = ETrue;
-            TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
-            iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
-            
-            if( err )
-            	{
-				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
-                doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                
-                if( doTerminate )
-                	{
-                    iMemSpySession.EndProcess( id, ETerminate );     
-                    RefreshL();
-                    }
-            	}
-            
-            // 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()
-    {	
-	TBool brought = EFalse;
-	/*
-    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( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
-            TInt error = iMemSpySession.SwitchToThread( currentThreadId, brought );
-            /*
-            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:
-            {                        
-            TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
-            TInt error = iMemSpySession.SwitchToProcess( id, brought  );
-            /*
-            //CMemSpyEngineObjectContainer& container = iEngine.Container();
-            //TProcessId id( iObjectList->At( iListBox->CurrentItemIndex() ).iId );
-            //CMemSpyProcess& process = container.ProcessByIdL( id );
-            
-            TProcessId id( iKernelObjectItems[iListBox->CurrentItemIndex()]->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 err = EFalse;
-            TBool doTerminate = ETrue;
-            
-            TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread                                   
-            iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
-            
-            if( err )
-            	{
-				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                        				
-				if ( doTerminate )
-					{
-					iMemSpySession.EndThread( id, EKill );
-					RefreshL();
-					}
-            	}            
-
-            
-            /*
-            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 err = EFalse;
-            TBool doTerminate = ETrue;
-            TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
-            iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
-            
-            if( err )
-            	{
-				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
-				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-				
-				if( doTerminate )
-					{
-					iMemSpySession.EndProcess( id, EKill);     
-					RefreshL();
-					}
-            	}
-            
-            /*
-            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 err = EFalse;
-            TBool doTerminate = ETrue;
-            
-            TThreadId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() ); //get id of the current thread                                   
-            iMemSpySession.ThreadSystemPermanentOrCritical( id, err );
-            
-            if( err )
-            	{
-				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();
-				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                        				
-				if ( doTerminate )
-					{
-					iMemSpySession.EndThread( id, EPanic );
-					RefreshL();
-					}
-            	}
-            
-            break;
-            }
-        case EMemSpyDriverContainerTypeProcess:
-            {
-            TBool err = EFalse;
-            TBool doTerminate = ETrue;
-            TProcessId id( iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Id() );
-            iMemSpySession.ProcessSystemPermanentOrCritical( id, err );
-            
-            if( err )
-            	{
-				CAknQueryDialog* importDialog = CAknQueryDialog::NewL();	
-				doTerminate = ( importDialog->ExecuteLD( R_MEMSPY_PANIC_SYSTEM_CRITICAL_THREAD_OR_PROCESS ) );
-                           
-				if( doTerminate )
-					{
-					iMemSpySession.EndProcess( id, EPanic );     
-					RefreshL();
-					}
-            	}
-        
-            break;
-            }
-        default:
-            {
-            // Programming error
-            __ASSERT_ALWAYS( EFalse, User::Panic( _L("MemSpy-View"), 0 ) );
-            }
-        }
-    }
-
-
-void CMemSpyViewKernelObjects::CreateTabsL()
-    {
-	TMemSpyDriverContainerType type = iKernelObjectItems[ iListBox->CurrentItemIndex() ]->Type();
-	const TPtrC pType( MemSpyUiUtils::TypeAsString( type ) );
-	
-	CEikStatusPane* statusPane = static_cast<CAknAppUi*> ( iEikonEnv->EikAppUi() )->StatusPane();
-	TUid uid;
-	uid.iUid = EEikStatusPaneUidNavi;
-	iNaviPane = ( CAknNavigationControlContainer * ) statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) );	
-	iNavDecorator=iNaviPane->CreateMessageLabelL( pType );
-	iNaviPane->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 );
-    }
-
--- a/memspyui/ui/avkon/src/MemSpyViewMainMenu.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,317 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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;
-    }
-
--- a/memspyui/ui/avkon/src/MemSpyViewMemoryTrackingAutoStartConfig.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewOpenFiles.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewProcesses.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,687 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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"
-#include "MemSpyUiUtils.h"
-
-// Constants
-const TInt KMemSpyMaxSearchTextLength = 30;
-const TInt KMemSpyMaxSearchTextLengthWithWildcards = KMemSpyMaxSearchTextLength + 4;
-
-
-CMemSpyViewProcesses::CMemSpyViewProcesses( RMemSpySession& aSession, MMemSpyViewObserver& aObserver )
-:   CMemSpyViewBase( aSession, aObserver )
-    {
-    }
-
-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  ( iCurrentProcessId > 0 )
-        {
-		TInt index = 0;
-	//	TProcessId selectedItem = aSelectionRune; //static_cast< TProcessId >( *aSelectionRune );
-		for( TInt i=0; i<iProcesses.Count();i++)
-			{
-			if( iProcesses[i]->Id() == iCurrentProcessId )
-				{
-				index = i;
-				}
-			}					        
-        
-        if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
-            {
-            iListBox->SetCurrentItemIndex( index );
-            HandleListBoxItemSelectedL( index );
-            }            
-        }
-    else if ( iProcesses.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( 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(), 0 );
-    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;
-		TProcessPriority tempPriority = aProcesses[i]->Priority();
-		MemSpyUiUtils::AppendPriority( priority, tempPriority );
-		
-	    // 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
-	    TUint32 tempSID =  aProcesses[i]->SID();
-	    name.AppendFormat( KMemSpyProcessNameFormatSpecBasicName, &overflow, tempName, tempSID );	//tempNamePtr
-	    
-	    if( aProcesses[i]->ExitType() != EExitPending ) // instead of IsDead() method
-	    	{
-			MemSpyUiUtils::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;
-        }
-    }
-*/
-
--- a/memspyui/ui/avkon/src/MemSpyViewRAMInfo.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewROMInfo.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewServerList.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewSystemConfig.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewThreadInfoItemActiveObject.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,248 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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>
-#include <memspysession.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-
-
-CMemSpyViewThreadInfoItemActiveObjectBase::CMemSpyViewThreadInfoItemActiveObjectBase(RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, 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()
-    {
-	iMemSpySession.OutputAOListL( ThreadId(), EMemSpyThreadInfoItemTypeActiveObject );
-	
-	/*
-    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( RMemSpySession& aSession, MMemSpyViewObserver& aObserver,  TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewThreadInfoItemActiveObjectBase( aSession, aObserver, aProcId, aId, aType )
-    {
-    }
-
-
-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
-    /* TODO: to consider this
-    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( 0 ); //selectedIndex
-        HandleListBoxItemSelectedL( 0 ); //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/ui/avkon/src/MemSpyViewThreadInfoItemChunk.cpp	Tue Aug 31 15:15:20 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( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, EMemSpyThreadInfoItemTypeChunk )
-    {
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemChunk::PrepareChildViewL()
-    {	
-    CMemSpyViewBase* child = NULL;
-    /* TODO
-    // 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/ui/avkon/src/MemSpyViewThreadInfoItemCodeSeg.cpp	Tue Aug 31 15:15:20 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( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, EMemSpyThreadInfoItemTypeCodeSeg )
-    {
-    }
-
-
-TBool CMemSpyViewThreadInfoItemCodeSeg::HandleCommandL( TInt aCommand )
-    {
-    TBool handled = CMemSpyViewBase::HandleCommandL( aCommand );
-    return handled;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemCodeSeg::PrepareChildViewL()
-    {	
-    CMemSpyViewBase* child = NULL;
-    /* TODO
-    // 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/ui/avkon/src/MemSpyViewThreadInfoItemGeneralInfo.cpp	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#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>
-#include <memspysession.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 )
-    {
-    }
-*/
-CMemSpyViewThreadInfoItemGeneralInfo::CMemSpyViewThreadInfoItemGeneralInfo( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, 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/ui/avkon/src/MemSpyViewThreadInfoItemGeneric.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,330 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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>
-#include <memspysession.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewThreadInfoItemList.h"
-#include "MemSpyUiUtils.h"
-
-// Constants
-const TInt KMemSpyConstructionCheckerTimerPeriod = 500000; // 1/2 second
-
-CMemSpyViewThreadInfoItemGeneric::CMemSpyViewThreadInfoItemGeneric( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcessId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewBase( aSession, aObserver )//, iThreadId( aId ), iType( aType )		//iContainer( aInfoContainer )
-    {
-	iParentProcessId = aProcessId;
-	iThreadId = aId;
-	iType = aType;
-    }
-
-
-CMemSpyViewThreadInfoItemGeneric::~CMemSpyViewThreadInfoItemGeneric()
-    {/* TODO:
-    if  ( iInfoItem )
-        {
-        iInfoItem->Close();
-        }    
-    DestroyWaitNote();    
-    */
-    }
-
-
-void CMemSpyViewThreadInfoItemGeneric::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-	const TPtrC pTitle( MemSpyUiUtils::ThreadInfoItemNameByType( iType ) );
-	SetTitleL( pTitle );
-
-    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();     //TODO
-    SetListBoxModelL();
-    CMemSpyViewBase::RefreshL();
-    }
-
-
-TMemSpyViewType CMemSpyViewThreadInfoItemGeneric::ViewType() const
-    {
-    TMemSpyViewType type = EMemSpyViewTypeNone;
-    //
-    //switch( iInfoItem->Type() )
-    switch( iType )
-        {
-    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( iMemSpySession, iObserver, iParentProcessId, iThreadId );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent(), iType );
-    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()
-    {
-	iMemSpySession.GetThreadInfoItems( iThreadInfoItems, iThreadId, iType );
-	
-	iModel = new (ELeave) CDesC16ArrayFlat( iThreadInfoItems.Count() + 10 );
-	
-	for( TInt i=0; i<iThreadInfoItems.Count(); i++)
-		{						
-		HBufC* combined = HBufC::NewLC( iThreadInfoItems[i]->Caption().Length() + iThreadInfoItems[i]->Value().Length() + 30 );		
-			/*
-		else if ( combined->Des().MaxLength() < requiredLength )
-			{
-			combined = combined->ReAllocL( requiredLength );
-			}*/				
-        
-		TPtr pCombined( combined->Des() );
-		pCombined.Zero();
-		pCombined.Copy( _L("\t") );
-		if( iThreadInfoItems[i]->Caption() != KNullDesC )
-			pCombined.Append( iThreadInfoItems[i]->Caption() );
-		if( iType != EMemSpyThreadInfoItemTypeChunk )
-			{
-			pCombined.Append( _L("\t\t") );
-			pCombined.Append( iThreadInfoItems[i]->Value() );
-			}					
-		
-		iModel->AppendL( pCombined );								
-		}	
-	
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
-    //listbox->Model()->SetItemTextArray( iInfoItem );
-    listbox->Model()->SetItemTextArray( iModel );
-    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/ui/avkon/src/MemSpyViewThreadInfoItemHeap.cpp	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#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>
-#include <memspysession.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyViewThreadInfoItemHeap.h"
-#include "MemSpyAppUi.h" 
-
-
-/*
-CMemSpyViewThreadInfoItemHeap::CMemSpyViewThreadInfoItemHeap( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver, CMemSpyThreadInfoContainer& aContainer )
-:   CMemSpyViewThreadInfoItemGeneric( aEngine, aObserver, aContainer, EMemSpyThreadInfoItemTypeHeap )
-    {
-    }
-*/
-CMemSpyViewThreadInfoItemHeap::CMemSpyViewThreadInfoItemHeap( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId , 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()
-    {
-	iMemSpySession.OutputThreadHeapDataL( ThreadId() );    
-    }
-
-
-void CMemSpyViewThreadInfoItemHeap::OnCmdHeapCellListingL()
-    {
-    iMemSpySession.OutputThreadCellListL( ThreadId() );
-    }
-
-
-void CMemSpyViewThreadInfoItemHeap::OnCmdHeapInfoL()
-    {
-	iMemSpySession.OutputHeapInfoUserL( ThreadId() );    
-    }
-
-
-void CMemSpyViewThreadInfoItemHeap::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        //aMenuPane->SetItemDimmed( EMemSpyCmdHeap, Thread().IsDead() ); //TODO
-        }
-    }
--- a/memspyui/ui/avkon/src/MemSpyViewThreadInfoItemList.cpp	Tue Aug 31 15:15:20 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 "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>
-#include <memspysession.h>
-
-// UI Utils include
-#include "MemSpyUiUtils.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( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcess, TThreadId aThread )
-:   CMemSpyViewBase( aSession, aObserver ), iParentProcessId( aProcess ), iThreadId( aThread )
-    {
-    }
-
-
-CMemSpyViewThreadInfoItemList::~CMemSpyViewThreadInfoItemList()
-    {
-	/* TODO:
-    TRAP_IGNORE( 
-        CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
-        container.ObserverRemove( *this );
-    );
-	*/
-    }
-
-
-
-void CMemSpyViewThreadInfoItemList::ConstructL( const TRect& aRect, CCoeControl& aContainer, TMemSpyThreadInfoItemType aType )
-    {
-    _LIT( KTitle, "Thread Objects" );
-    SetTitleL( KTitle );
-    //
-    //iIdleResetListboxTimer = CPeriodic::NewL( CActive::EPriorityIdle );    
-    /* TODO: to solve observer
-    CMemSpyThreadInfoContainer& container = iThread.InfoContainerL();
-    container.ObserverAddL( *this );
-    */    
-    CMemSpyViewBase::ConstructL( aRect, aContainer );
-    //
-    if( aType > EMemSpyThreadInfoItemTypeFirst || aType < EMemSpyThreadInfoItemTypeLast )
-    	{
-		TInt index(aType);
-		if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
-			{
-			iListBox->SetCurrentItemIndex( index );
-			HandleListBoxItemSelectedL( index );
-			}
-    	}
-    else
-    	{
-		iListBox->SetCurrentItemIndex( 0 );
-        HandleListBoxItemSelectedL( 0 );
-    	}
-    /*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 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( iMemSpySession, iObserver, iParentProcessId, iThreadId );
-    CleanupStack::PushL( parent );
-    parent->ConstructL( Rect(), *Parent() );
-    CleanupStack::Pop( parent );
-    return parent;
-    }
-
-
-CMemSpyViewBase* CMemSpyViewThreadInfoItemList::PrepareChildViewL()
-    {
-    CMemSpyViewBase* child = NULL;
-
-    TMemSpyThreadInfoItemType type;
-    iMemSpySession.GetInfoItemType( iCurrentInfoItemId, iThreadId, type );
-    
-    switch( type )
-        {    	
-    case EMemSpyThreadInfoItemTypeHeap:
-        child = new(ELeave) CMemSpyViewThreadInfoItemHeap( iMemSpySession, iObserver, iParentProcessId, iThreadId, type );
-        break;        
-    case EMemSpyThreadInfoItemTypeStack:
-        child = new(ELeave) CMemSpyViewThreadInfoItemStack( iMemSpySession, iObserver, iParentProcessId, iThreadId, type );
-        break;        
-    case EMemSpyThreadInfoItemTypeChunk:
-        child = new(ELeave) CMemSpyViewThreadInfoItemChunk( iMemSpySession, iObserver, iParentProcessId, iThreadId, type  );
-        break;
-    case EMemSpyThreadInfoItemTypeCodeSeg:
-        child = new(ELeave) CMemSpyViewThreadInfoItemCodeSeg( iMemSpySession, iObserver, iParentProcessId, iThreadId, type  );
-        break;        
-    case EMemSpyThreadInfoItemTypeServer:
-        child = new(ELeave) CMemSpyViewThreadInfoItemServer( iMemSpySession, iObserver, iParentProcessId, iThreadId, type  );
-        break;        
-    case EMemSpyThreadInfoItemTypeActiveObject:
-        child = new(ELeave) CMemSpyViewThreadInfoItemActiveObject( iMemSpySession, iObserver, iParentProcessId, iThreadId, type  );
-        break;             
-    case EMemSpyThreadInfoItemTypeGeneralInfo:
-        child = new(ELeave) CMemSpyViewThreadInfoItemGeneralInfo( iMemSpySession, iObserver, iParentProcessId, iThreadId, type );
-        break;
-    /* 
-     * This subview is permanently removed from Thread Info Item subview.
-     * 
-    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( iMemSpySession, iObserver, iParentProcessId, iThreadId, 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() ); //TODO
-        }
-    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()
-    {
-    iMemSpySession.OutputThreadInfoHandlesL( iThreadId );
-    }
-
-
-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()
-    {	
-	CDesC16ArrayFlat* iModel = new (ELeave) CDesC16ArrayFlat( 32 );
-	
-	HBufC* iItem = HBufC::NewL( 32 );
-	
-	iItem = MemSpyUiUtils::FormatItem( KGeneral );
-	TPtr pItem( iItem->Des() );
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KHeap );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KStack );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KChunks );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KCodeSegs );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KOpenFiles );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KActiveObjects );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KThreadHandlers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KProcessHandlers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KServers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KConnections );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KSemaphores );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KThreadReferences );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KProcessReferences );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KMutexes );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KTimers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KDD );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KChangeNotif );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KUndertakers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KLogicalDrivers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();
-	
-	iItem = MemSpyUiUtils::FormatItem( KPhysicalDrivers );
-	pItem = iItem->Des();
-	iModel->AppendL( pItem );
-	pItem.Zero();		
-	
-    CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox ); 
-    listbox->Model()->SetItemTextArray( iModel );
-    listbox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
-    }
-
-
-void CMemSpyViewThreadInfoItemList::HandleListBoxItemActionedL( TInt /*aIndex*/ )
-    {
-    // Notify observer about an item being 'fired'
-    ReportEventL( MMemSpyViewObserver::EEventItemActioned );
-    }
-
-
-void CMemSpyViewThreadInfoItemList::HandleListBoxItemSelectedL( TInt aIndex )
-    {
-	iCurrentInfoItemId = aIndex;
-	
-    // 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/ui/avkon/src/MemSpyViewThreadInfoItemMemoryTracking.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewThreadInfoItemServer.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,394 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, 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
-    /* TODO
-    // 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 )
-    {/* TODO
-    // 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/ui/avkon/src/MemSpyViewThreadInfoItemStack.cpp	Tue Aug 31 15:15:20 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:
-*
-*/
-
-#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>
-#include <memspysession.h>
-
-// User includes
-#include "MemSpyContainerObserver.h"
-#include "MemSpyViewThreads.h"
-#include "MemSpyViewThreadInfoItemHeap.h"
-#include "MemSpyAppUi.h"
-
-
-
-CMemSpyViewThreadInfoItemStack::CMemSpyViewThreadInfoItemStack( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aProcId, TThreadId aId, TMemSpyThreadInfoItemType aType )
-:   CMemSpyViewThreadInfoItemGeneric( aSession, aObserver, aProcId, aId, 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()
-    {
-	iMemSpySession.OutputStackInfoL( ThreadId() );   
-    }
-
-
-void CMemSpyViewThreadInfoItemStack::OnCmdStackDataUserL()
-    {
-    iMemSpySession.OutputStackDataL( ThreadId(), EMemSpyDriverDomainUser );
-    }
-
-
-void CMemSpyViewThreadInfoItemStack::OnCmdStackDataKernelL()
-    {
-	iMemSpySession.OutputStackDataL( ThreadId(), EMemSpyDriverDomainKernel );
-    }    
-
-
-void CMemSpyViewThreadInfoItemStack::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane )
-    {
-    if  ( aResourceId == R_MEMSPY_MENUPANE )
-        {
-        //TODO aMenuPane->SetItemDimmed( EMemSpyCmdStack, Thread().IsDead() );
-        }
-    }
--- a/memspyui/ui/avkon/src/MemSpyViewThreads.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,377 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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( RMemSpySession& aSession, MMemSpyViewObserver& aObserver, TProcessId aId, TThreadId aThreadId )
-:   CMemSpyViewBase( aSession, aObserver ), iParentProcessId( aId ), iCurrentThreadId( aThreadId )
-    {    
-    }
-
-
-CMemSpyViewThreads::~CMemSpyViewThreads()
-    {
-    }
-
- 
-void CMemSpyViewThreads::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
-    {
-	iMemSpySession.GetThreadsL( iParentProcessId, iThreads );
-	
-    _LIT( KTitle, "Threads" );
-    SetTitleL( KTitle );
-    //
-    CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
-    //    
-    if( iCurrentThreadId > 0 )
-        {		
-		for( TInt i = 0; i < iThreads.Count() ; i++ )
-			{
-			if( iThreads[i]->Id() == iCurrentThreadId )
-				{
-				const TInt index = i;
-				if  ( index >= 0 && index < iListBox->Model()->NumberOfItems() )
-					{
-					iListBox->SetCurrentItemIndex( index );
-					HandleListBoxItemSelectedL( index );
-					}
-				}			
-			}
-        }
-    else if( iThreads.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( iMemSpySession, iObserver, iParentProcessId, iCurrentThreadId );
-    CleanupStack::PushL( child );
-    child->ConstructL( Rect(), *Parent(), EMemSpyThreadInfoItemTypeFirst );
-    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()
-    {
-	iMemSpySession.OutputThreadInfoHandlesL( iCurrentThreadId );	
-    }
-
-
-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( 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 );
-    }
-
-
-
--- a/memspyui/ui/avkon/src/MemSpyViewType.cpp	Tue Aug 31 15:15:20 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/ui/avkon/src/MemSpyViewWindowGroups.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,316 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 );
-    }
-
-
--- a/memspyui/ui/hb/hb.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-#
-# 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/memspylistview.h \
-	inc/memspymainview.h \
-	inc/memspyprocessview.h \
-	inc/memspythreadview.h \
-	inc/memspythreaddetailindexview.h \
-	inc/memspythreaddetailview.h \
-	inc/memspykernelobjecttypeview.h \
-	inc/memspykernelobjectview.h \
-	inc/memspykernelobjectdetailview.h \
-	inc/memspytrackingview.h \
-	inc/memspyswmtview.h \
-	inc/memspyheapdumpsview.h \
-	inc/memspysettingsview.h
-
-SOURCES += src/main.cpp \
-	src/enginewrapper.cpp \
-	src/viewmanager.cpp \
-	src/memspyview.cpp \
-	src/memspylistview.cpp \
-	src/memspymainview.cpp \
-	src/memspyprocessview.cpp \
-	src/memspythreadview.cpp \
-	src/memspythreaddetailindexview.cpp \
-	src/memspythreaddetailview.cpp \
-	src/memspykernelobjecttypeview.cpp \
-	src/memspykernelobjectview.cpp \
-	src/memspykernelobjectdetailview.cpp \
-	src/memspytrackingview.cpp \
-	src/memspyswmtview.cpp \
-	src/memspyheapdumpsview.cpp \
-	src/memspysettingsview.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")
-}
--- a/memspyui/ui/hb/inc/enginewrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,529 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 <QVariantList>
-#include <QSettings>
-
-#include <memspysession.h>
-
-typedef quint64 ProcessId;
-typedef quint64 ThreadId;
-
-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
-};
-
-enum ThreadInfoType
-{
-	ThreadInfoTypeGeneral = EMemSpyThreadInfoItemTypeGeneralInfo,
-	ThreadInfoTypeHeap = EMemSpyThreadInfoItemTypeHeap,
-	ThreadInfoTypeStack = EMemSpyThreadInfoItemTypeStack,
-	ThreadInfoTypeChunk = EMemSpyThreadInfoItemTypeChunk,
-	ThreadInfoTypeCodeSeg = EMemSpyThreadInfoItemTypeCodeSeg,
-	ThreadInfoTypeOpenFiles = EMemSpyThreadInfoItemTypeOpenFiles,
-	ThreadInfoTypeActiveObjects = EMemSpyThreadInfoItemTypeActiveObject,
-	ThreadInfoTypeOwnedThreadHandles = EMemSpyThreadInfoItemTypeOwnedThreadHandles,
-	ThreadInfoTypeOwnedProcessHandles = EMemSpyThreadInfoItemTypeOwnedProcessHandles,
-	ThreadInfoTypeServer = EMemSpyThreadInfoItemTypeServer,
-	ThreadInfoTypeSession = EMemSpyThreadInfoItemTypeSession,
-	ThreadInfoTypeSemaphore = EMemSpyThreadInfoItemTypeSemaphore,
-	ThreadInfoTypeOtherThreads = EMemSpyThreadInfoItemTypeOtherThreads,
-	ThreadInfoTypeOtherProcesses = EMemSpyThreadInfoItemTypeOtherProcesses,
-	ThreadInfoTypeMutex = EMemSpyThreadInfoItemTypeMutex,
-	ThreadInfoTypeTimer = EMemSpyThreadInfoItemTypeTimer,
-	ThreadInfoTypeChannel = EMemSpyThreadInfoItemTypeLogicalChannel,
-	ThreadInfoTypeChangeNotifier = EMemSpyThreadInfoItemTypeChangeNotifier,
-	ThreadInfoTypeUndertaker = EMemSpyThreadInfoItemTypeUndertaker,
-	ThreadInfoTypeMessageQueue = EMemSpyThreadInfoItemTypeMessageQueue,
-	ThreadInfoTypeConditionalVariable = EMemSpyThreadInfoItemTypeConditionalVariable,
-	ThreadInfoTypeLDD = EMemSpyThreadInfoItemTypeLDD,
-	ThreadInfoTypePDD = EMemSpyThreadInfoItemTypePDD,
-};
-
-enum DeviceWideOperation
-{
-	OutputPhoneInfo = 0,
-	    
-	OutputDetailedPhoneInfo,
-	    
-	OutputHeapInfo,
-	    
-	OutputCompactHeapInfo,
-	    
-	OutputHeapCellListing,
-	    
-	OutputHeapData,
-	    
-	OutputStackInfo,
-	    
-	OutputCompactStackInfo,
-	    
-	OutputUserStackData,
-	    
-	OutputKernelStackData
-};
-
-enum SwmtMode
-{
-	SwmtModeBasic = 0,
-	SwmtModeFull,
-	SwmtModeCustom
-};
-
-enum HeapDumpsMode
-{
-	HeapDumpsModeKernel = 0,
-	HeapDumpsModeUser,
-	HeapDumpsModeBoth
-};
-
-enum OutputMode
-{
-	OutputModeTrace = 0,
-	OutputModeFile
-};
-
-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()); }
-	
-	QString exitInfo() const;
-	
-	int priority() const { return mProcess->Priority(); }
-	
-	int threadCount() const { return mProcess->ThreadCount(); }
-	
-	int sid() const { return mProcess->SID(); }
-	
-	int vid() const { return mProcess->VID(); }
-	
-	bool isDead() const { return mProcess->IsDead(); }
-	
-private:
-	CMemSpyApiProcess *mProcess;
-};
-
-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()); }
-	
-	int count() const { return mType->Count(); }
-	
-	qint64 size() const { return mType->Size(); }
-	
-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 MemSpyThreadInfoItem 
-{
-public:
-	MemSpyThreadInfoItem(CMemSpyApiThreadInfoItem *item)
-		: mItem(item)
-	{}
-	
-	virtual  ~MemSpyThreadInfoItem() { delete mItem;	}
-	
-	QString caption() const { return QString((QChar*) mItem->Caption().Ptr(), mItem->Caption().Length()); }
-	
-	QString value() const { return QString((QChar*) mItem->Value().Ptr(), mItem->Value().Length()); }
-	
-private:
-	CMemSpyApiThreadInfoItem* mItem;
-};
-
-class MemSpyDwoProgressTracker : public QObject, public CActive
-{
-	Q_OBJECT
-
-public:
-	MemSpyDwoProgressTracker(RMemSpySession &session);
-	virtual ~MemSpyDwoProgressTracker();
-	
-public slots:
-
-	void start();
-
-	void cancel();
-	
-protected: // from CActive
-	
-	virtual void RunL();
-	 
-	virtual void DoCancel();
-	 
-	virtual TInt RunError(TInt aError);
-	
-signals:
-	void progress(int progress, const QString& processName);
-	
-private:
-	TMemSpyDeviceWideOperationProgress mProgress;
-	RMemSpySession mSession;
-};
-
-class MemSpyDwoTracker : public QObject, public CActive
-{
-	Q_OBJECT
-
-public:
-	MemSpyDwoTracker(RMemSpySession &session, DeviceWideOperation operation);
-	virtual ~MemSpyDwoTracker();
-	
-public slots:
-
-	void start();
-	
-	void cancel();
-	
-protected: // from CActive
-	
-	virtual void RunL();
-	 
-	virtual void DoCancel();
-	 
-	virtual TInt RunError(TInt aError);
-	
-signals:
-	void finished(int errorCode);
-	void progress(int progress, const QString& processName);
-	
-private:
-	RMemSpySession mSession;
-	MemSpyDwoProgressTracker *mProgressTracker;
-	DeviceWideOperation mOperation;
-};
-
-class MemSpyAsyncTracker : public QObject, public CActive
-{
-	Q_OBJECT
-	
-public:
-	
-	MemSpyAsyncTracker(RMemSpySession& session, void (RMemSpySession::*function)(TRequestStatus&));
-	
-	void start();
-	
-	virtual void RunL();
-	
-	virtual void DoCancel();
-	
-	virtual TInt RunError(TInt aError);
-	
-signals:
-	
-	void finished(int errorCode);
-	
-private:
-	void (RMemSpySession::*mFunction)(TRequestStatus&);
-	RMemSpySession& mSession;
-};
-
-class MemSpySwmtDumpTracker : public MemSpyAsyncTracker
-{
-public:
-	MemSpySwmtDumpTracker(RMemSpySession& session) : 
-		MemSpyAsyncTracker(session, &RMemSpySession::ForceSwmtUpdate)
-	{}
-};
-
-class MemSpyKernelHeapDumpTracker : public MemSpyAsyncTracker
-{
-public:
-	MemSpyKernelHeapDumpTracker(RMemSpySession& session) : 
-		MemSpyAsyncTracker(session, &RMemSpySession::OutputKernelHeapData)
-	{}
-};
-
-class MemSpySettings : private QSettings
-{
-public:
-	
-	MemSpySettings();
-	
-	OutputMode outputMode() const;
-	void setOutputMode(OutputMode mode);
-	
-	QString outputPath() const;
-	void setOutputPath(const QString& path);
-		
-	int swmtTimerPeriod() const;
-	void setSwmtTimerPeriod(int period);
-	
-	SwmtMode swmtMode() const;
-	void setSwmtMode(SwmtMode mode);
-	
-	QVariantList swmtCategories() const;
-	void setSwmtCategories(const QVariantList& categories);
-	
-	HeapDumpsMode heapDumpsMode() const;
-	void setHeapDumpsMode(HeapDumpsMode mode);
-};
-
-class EngineWrapper : public QObject
-{
-	Q_OBJECT
-	
-public:
-	EngineWrapper();
-	
-	virtual ~EngineWrapper();
-	
-	bool initialize();
-	
-	MemSpySettings& settings();
-	
-	const MemSpySettings& settings() const;
-	
-	
-	
-	QList<MemSpyProcess*> getProcesses();
-	
-	QList<MemSpyThread*> getThreads(ProcessId processId);
-	
-	QList<MemSpyThreadInfoItem*> getThreadInfo(ThreadId threadId, ThreadInfoType type);
-	
-	void setThreadPriority(ThreadId threadId, ThreadPriority priority);
-	
-	QList<MemSpyKernelObjectType*> getKernelObjectTypes();
-	
-	QList<MemSpyKernelObject*> getKernelObjects(int type);
-	
-	MemSpyDwoTracker* createDeviceWideOperation(DeviceWideOperation operation);
-	
-	MemSpyKernelHeapDumpTracker* createKernelHeapDumpTracker();
-	
-	MemSpySwmtDumpTracker* createSwmtDumpTracker();
-	
-	void setSwmtSettings(SwmtMode mode, const QVariantList& categories);
-	
-	bool isSwmtRunning();
-	
-	void startSwmt(int period);
-	
-	void stopSwmt();
-	
-	void forceSwmtDump();
-	
-	void outputKernelHeapData();
-	
-	int outputThreadHeapData(const QString& filter);
-	
-	void updateOutputSettings();
-	
-private:
-	RMemSpySession mSession;
-	
-	bool mSwmtRunning;
-	
-	MemSpySettings mSettings;
-};
-
-#endif /* ENGINEWRAPPER_H_ */
--- a/memspyui/ui/hb/inc/memspyheapdumpsview.h	Tue Aug 31 15:15:20 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 MEMSPYHEAPDUMPSVIEW_H_
-#define MEMSPYHEAPDUMPSVIEW_H_
-
-#include "memspyview.h"
-
-class HbDataFormModel;
-class HbDataFormModelItem;
-
-class MemSpyHeapDumpsView : public MemSpyView
-{
-	Q_OBJECT
-	
-public:
-	MemSpyHeapDumpsView(EngineWrapper &engine, ViewManager &viewManager);
-	virtual ~MemSpyHeapDumpsView();
-	
-	void initialize(const QVariantMap& params);
-		
-protected:
-	HbToolBar* createToolBar();
-	
-	HbWidget* createCentralWidget();
-	
-private slots:
-	void modeChanged(int mode);
-	void dump();
-
-	void updateDwoProgress(int progress, const QString& processName);
-	void asyncOperationFinished(int errorCode);
-
-	
-private:
-	void removeFilterItem();
-	void createFilterItem();
-	
-private:
-	HbDataFormModel* mModel;
-	HbDataFormModelItem* mModeItem;
-	HbDataFormModelItem* mFilterItem;
-	
-	HbProgressDialog* mDwoProgressDialog;
-};
-
-#endif /* MEMSPYHEAPDUMPSVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspykernelobjectdetailview.h	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#ifndef MEMSPYKERNELOBJECTDETAILVIEW_H_
-#define MEMSPYKERNELOBJECTDETAILVIEW_H_
-
-#include "memspylistview.h"
-
-class MemSpyKernelObjectDetailModel : public QAbstractListModel
-{
-public:
-    MemSpyKernelObjectDetailModel(const QStringList& details, QObject *parent = 0);
-    
-    int rowCount(const QModelIndex &parent = QModelIndex()) const;
-    
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-  
-private:
-    QStringList mDetails;
-};
-
-class MemSpyKernelObjectDetailView : public MemSpyListView
-{
-	Q_OBJECT
-	
-public:
-	MemSpyKernelObjectDetailView(EngineWrapper &engine, ViewManager &viewManager) 
-		: MemSpyListView(engine, viewManager) {}
-	
-protected:
-	virtual void initialize(const QVariantMap& params);
-	
-	virtual bool isBreadCrumbVisible() const;
-	        
-	virtual QString getBreadCrumbText() const;
-	
-private:
-	QString mTypeName;
-	QString mObjectName;
-};
-
-#endif /* MEMSPYKERNELOBJECTDETAILVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspykernelobjecttypeview.h	Tue Aug 31 15:15:20 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 MEMSPYKERNELOBJECTTYPESVIEW_H_
-#define MEMSPYKERNELOBJECTTYPESVIEW_H_
-
-#include "memspylistview.h"
-#include "enginewrapper.h"
-
-class MemSpyKernelObjectTypeModel : public QAbstractListModel
-{
-public:
-	MemSpyKernelObjectTypeModel(EngineWrapper &engine, QObject *parent = 0);
-	
-	virtual ~MemSpyKernelObjectTypeModel();
-	
-	int rowCount(const QModelIndex &parent = QModelIndex()) const;
-	
-	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-	
-private:
-	QString formatSize(qint64 size) const;
-	
-private:
-	QList<MemSpyKernelObjectType*> mObjectTypes;
-	
-	QStringList mKernelObjectNames;
-};
-
-class MemSpyKernelObjectTypeView : public MemSpyListView
-{
-	Q_OBJECT
-	
-public:
-	MemSpyKernelObjectTypeView(EngineWrapper &engine, ViewManager &viewManager) 
-		: MemSpyListView(engine, viewManager) {}
-
-protected:
-	virtual void initialize(const QVariantMap& params);
-
-private slots:
-	void itemClicked(const QModelIndex& index);
-};
-
-#endif /* MEMSPYKERNELOBJECTTYPESVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspykernelobjectview.h	Tue Aug 31 15:15:20 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 MEMSPYKERNELOBJECTVIEW_H_
-#define MEMSPYKERNELOBJECTVIEW_H_
-
-#include "memspylistview.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 MemSpyListView
-{
-	Q_OBJECT
-
-public:
-	MemSpyKernelObjectView(EngineWrapper &engine, ViewManager &viewManager) 
-		: MemSpyListView(engine, viewManager) {}
-
-protected:
-	virtual void initialize(const QVariantMap& params);
-	
-	virtual bool isBreadCrumbVisible() const;
-	            
-	virtual QString getBreadCrumbText() const;
-
-private slots:
-	void itemClicked(const QModelIndex& index);
-	
-private:
-	QStringList getDetails(MemSpyKernelObject *object);
-};
-
-#endif /* MEMSPYKERNELOBJECTVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspylistview.h	Tue Aug 31 15:15:20 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 MEMSPYLISTVIEW_H_
-#define MEMSPYLISTVIEW_H_
-
-#include <HbListView>
-
-#include "memspyview.h"
-
-class MemSpyListView : public MemSpyView
-	{
-public:
-	MemSpyListView(EngineWrapper &engine, ViewManager &viewManager) : 
-		MemSpyView(engine, viewManager) {}
-	
-protected:
-	virtual HbWidget* createCentralWidget();
-	
-protected:
-	HbListView mListView;
-	};
-
-#endif /* MEMSPYLISTVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspymainview.h	Tue Aug 31 15:15:20 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 MEMSPYMAINVIEW_H_
-#define MEMSPYMAINVIEW_H_
-
-#include "memspylistview.h"
-
-class MemSpyMainView : public MemSpyListView
-{
-    Q_OBJECT
-    
-public:
-	MemSpyMainView(EngineWrapper &engine, ViewManager &viewManager) 
-		: MemSpyListView(engine, viewManager) {}
-protected:
-	virtual void initialize(const QVariantMap& params);
-	virtual bool isBreadCrumbVisible() const;
-	
-public slots:
-	void itemClicked(const QModelIndex& index);
-};
-
-#endif /* MEMSPYMAINVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspyprocessview.h	Tue Aug 31 15:15:20 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 MEMSPYPROCESSVIEW_H_
-#define MEMSPYPROCESSVIEW_H_
-
-#include <QAbstractListModel>
-
-#include "memspylistview.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;
-	
-	void refresh();
-	
-private:
-	EngineWrapper& mEngine;
-	
-	QList<MemSpyProcess*> mProcesses;
-	
-	QMap<int, QString> mPriorityMap;
-};
-
-class MemSpyProcessView : public MemSpyListView
-{
-    Q_OBJECT
-    
-public:
-	MemSpyProcessView(EngineWrapper &engine, ViewManager &viewManager) : 
-        MemSpyListView(engine, viewManager),
-		mModel(0)
-	{}
-	
-public slots:
-    virtual void refresh();
-	
-protected:
-	void initialize(const QVariantMap& params);
-	
-protected:
-	virtual bool isRefreshable() const { return true; }
-	
-private slots:
-	void itemClicked(const QModelIndex& index);
-	
-private:
-	MemSpyProcessModel* mModel;
-};
-
-#endif /* MEMSPYPROCESSVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspysettingsview.h	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#ifndef MEMSPYSETTINGSVIEW_H_
-#define MEMSPYSETTINGSVIEW_H_
-
-#include <HbView>
-
-class HbDataForm;
-class HbDataFormModel;
-class HbDataFormModelItem;
-class EngineWrapper;
-
-class MemSpySettingsView : public HbView
-{
-	Q_OBJECT
-	
-public:
-	MemSpySettingsView(EngineWrapper &engine);
-	virtual ~MemSpySettingsView();
-	
-	void initialize(const QVariantMap& params);
-	
-private slots:
-	void updateModel();
-	void accept();
-	void reject();
-	
-signals:
-	void finished(bool ok);
-
-private:
-	HbDataForm* mForm;
-	HbDataFormModel* mModel;
-	HbDataFormModelItem* mModeItem;
-	HbDataFormModelItem* mPathItem;
-	HbDataFormModelItem* mCustomPathItem;
-	
-	EngineWrapper& mEngine;
-};
-
-#endif /* MEMSPYSETTINGSVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspyswmtview.h	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#ifndef MEMSPYSWMTVIEW_H_
-#define MEMSPYSWMTVIEW_H_
-
-#include "memspyview.h"
-
-class HbDataFormModel;
-class HbDataFormModelItem;
-class HbProgressDialog;
-
-class MemSpySwmtView : public MemSpyView
-{
-	Q_OBJECT
-	
-public:
-	MemSpySwmtView(EngineWrapper &engine, ViewManager &viewManager);
-	virtual ~MemSpySwmtView();
-	
-	void initialize(const QVariantMap& params);
-		
-protected:
-	HbToolBar* createToolBar();
-	
-	HbWidget* createCentralWidget();
-	
-private slots:
-	void toggleTimer();
-	void forceDump();
-	void modeChanged(int mode);
-	void asyncOperationFinished(int errorCode);
-	
-private:
-	void updateTimerAction(bool isRunning);
-	void removeCategoriesItem();
-	void createCategoriesItem();
-	void updateSettings();
-	
-private:
-	HbAction* mToggleTimerAction;
-	
-	HbDataFormModel* mModel;
-	HbDataFormModelItem* mTimerItem;
-	HbDataFormModelItem* mModeItem;
-	HbDataFormModelItem* mCategoriesItem;
-	
-	HbProgressDialog* mProgressDialog;
-};
-
-#endif /* MEMSPYSWMTVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspythreaddetailindexview.h	Tue Aug 31 15:15:20 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 MEMSPYTHREADDETAILINDEXVIEW_H_
-#define MEMSPYTHREADDETAILINDEXVIEW_H_
-
-#include "memspylistview.h"
-#include "enginewrapper.h"
-
-class HbMenu;
-
-class MemSpyThreadDetailIndexView : public MemSpyListView
-{
-	Q_OBJECT
-	
-public:
-	MemSpyThreadDetailIndexView(EngineWrapper &engine, ViewManager &viewManager) 
-		: MemSpyListView(engine, viewManager) {}
-protected:
-	virtual void initialize(const QVariantMap& params);
-	
-	virtual HbMenu* createToolMenu();
-	
-	virtual bool isBreadCrumbVisible() const;
-	    
-	virtual QString getBreadCrumbText() const;
-
-private slots:
-	void changePriority();
-	void itemClicked(const QModelIndex& index);
-	
-private:
-	ThreadId mThreadId;
-	HbMenu *mPriorityMenu;
-	QString mProcessName;
-	QString mThreadName;
-};
-
-#endif /* MEMSPYTHREADDETAILINDEXVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspythreaddetailview.h	Tue Aug 31 15:15:20 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 MEMSPYTHREADDETAILVIEW_H_
-#define MEMSPYTHREADDETAILVIEW_H_
-
-#include "memspylistview.h"
-#include "enginewrapper.h"
-
-class HbMenu;
-
-class MemSpyThreadDetailModel : public QAbstractListModel
-{
-public:
-	MemSpyThreadDetailModel(EngineWrapper &engine, ThreadId threadId, ThreadInfoType type, QObject *parent = 0);
-	
-	~MemSpyThreadDetailModel();
-	
-	int rowCount(const QModelIndex &parent = QModelIndex()) const;
-	
-	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-	
-private:
-	QList<MemSpyThreadInfoItem*> mThreadInfo;
-};
-
-
-class MemSpyThreadDetailView : public MemSpyListView
-{
-	Q_OBJECT
-	
-public:
-	MemSpyThreadDetailView(EngineWrapper &engine, ViewManager &viewManager) 
-		: MemSpyListView(engine, viewManager) {}
-protected:
-	virtual void initialize(const QVariantMap& params);
-	
-	virtual bool isBreadCrumbVisible() const;
-	
-	virtual QString getBreadCrumbText() const;
-	
-private:
-	ThreadId mThreadId;
-	HbMenu *mPriorityMenu;
-	QString mProcessName;
-	QString mThreadName;
-};
-
-#endif /* MEMSPYTHREADDETAILVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspythreadview.h	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#ifndef MEMSPYTHREADVIEW_H_
-#define MEMSPYTHREADVIEW_H_
-
-#include "memspylistview.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;
-	
-	void refresh();
-	
-private:
-	ProcessId mProcessId;
-	
-	EngineWrapper& mEngine;
-	
-	QList<MemSpyThread*> mThreads;
-	
-	QMap<int, QString> mPriorityMap;
-};
-
-
-class MemSpyThreadView : public MemSpyListView
-{
-	Q_OBJECT
-	
-public:
-	MemSpyThreadView(EngineWrapper &engine, ViewManager &viewManager);
-	~MemSpyThreadView();
-	
-public slots:
-    virtual void refresh();
-
-protected:
-	void initialize(const QVariantMap& params);
-	
-protected:
-	virtual bool isRefreshable() const { return true; }
-	
-	virtual bool isBreadCrumbVisible() const;
-	
-	QString getBreadCrumbText() const;
-	
-private slots:
-	void itemClicked(const QModelIndex& index);
-	void catchLongPress(HbAbstractViewItem *item, const QPointF &coords);
-	void changePriority();
-	
-private:
-	HbMenu* mContextMenu;
-	HbMenu* mPriorityMenu;
-	ThreadId mThreadId;
-	QString mProcessName;
-	
-	MemSpyThreadModel* mModel;
-};
-
-#endif /* MEMSPYTHREADVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspytrackingview.h	Tue Aug 31 15:15:20 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 MEMSPYTRACKINGVIEW_H_
-#define MEMSPYTRACKINGVIEW_H_
-
-#include "memspylistview.h"
-
-class MemSpyTrackingView : public MemSpyListView
-{
-    Q_OBJECT
-    
-public:
-    MemSpyTrackingView(EngineWrapper &engine, ViewManager &viewManager) 
-		: MemSpyListView(engine, viewManager) {}
-protected:
-	virtual void initialize(const QVariantMap& params);
-	virtual bool isBreadCrumbVisible() const;
-	
-public slots:
-	void itemClicked(const QModelIndex& index);
-};
-
-#endif /* MEMSPYTRACKINGVIEW_H_ */
--- a/memspyui/ui/hb/inc/memspyview.h	Tue Aug 31 15:15:20 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:
-* 
-*/
-
-#ifndef MEMSPYVIEW_H_
-#define MEMSPYVIEW_H_
-
-#include <HbView>
-#include <HbListView>
-#include <QVariantMap>
-
-class HbLabel;
-class HbProgressDialog;
-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;
-	
-	virtual bool isBreadCrumbVisible() const;
-	
-	virtual QString getBreadCrumbText() const;
-	
-	virtual HbWidget* createCentralWidget() = 0;
-	
-public slots:
-
-	virtual void initialize(const QVariantMap& params);
-
-	virtual void refresh();
-	
-	void showSettings();
-	
-	void showAbout();
-	
-private slots:
-	
-	void closeSettings();
-		
-protected:
-	
-	EngineWrapper &mEngine;
-	
-	ViewManager &mViewManager;
-	
-	
-private:
-	HbMenu* mOutputMenu;
-	HbMenu* mOutputGenInfoMenu;
-	HbMenu* mOutputHeapInfoMenu;
-	HbMenu* mOutputStackInfoMenu;
-	HbToolBar* mToolBar;
-	
-	HbLabel* mBreadCrumb;
-};
-
-#endif /* MEMSPYVIEW_H_ */
--- a/memspyui/ui/hb/inc/viewmanager.h	Tue Aug 31 15:15:20 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 VIEWMANAGER_H_
-#define VIEWMANAGER_H_
-
-
-#include <QObject>
-#include <QVariantMap>
-
-enum ViewIndex {
-	MainView,
-	ProcessView,
-	ThreadView,
-	ThreadDetailIndexView,
-	ThreadDetailView,
-	KernelObjectTypeView,
-	KernelObjectView,
-	KernelObjectDetailView,
-	TrackingView,
-	SwmtView,
-	HeapDumpsView
-};
-
-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_ */
--- a/memspyui/ui/hb/src/enginewrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,506 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* 
-*/
-
-#include <QMessageBox>
-
-#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
-
-#include "enginewrapper.h"
-
-// CONSTANTS
-
-const QString OUTPUT_MODE = "output/mode";
-const QString OUTPUT_PATH = "output/path";
-const QString SWMT_PERIOD = "swmt/period";
-const QString SWMT_MODE = "swmt/mode";
-const QString SWMT_CATEGORIES = "swmt/categories";
-const QString HEAP_DUMPS_MODE = "heapdumps/mode";
-
-QString MemSpyProcess::exitInfo() const
-{
-    QChar exitType[] = {'K', 'T', 'P', 'R'};
-    QString result = QString("[%1]").arg(exitType[mProcess->ExitType()]);
-    
-    if (mProcess->ExitType() != EExitKill && mProcess->ExitType() != EExitPending) {
-        
-        QString exitCategory = QString((QChar*) mProcess->ExitCategory().Ptr(), mProcess->ExitCategory().Length());
-        result.append(QString(" %1-%2").arg(exitCategory).arg(mProcess->ExitReason()));
-    }
-    
-    return result;
-}
-
-
-MemSpyDwoProgressTracker::MemSpyDwoProgressTracker(RMemSpySession &session) :
-	CActive(EPriorityStandard), mSession(session)
-{
-	CActiveScheduler::Add(this);
-}
-
-MemSpyDwoProgressTracker::~MemSpyDwoProgressTracker()
-{
-	Cancel();
-}
-
-void MemSpyDwoProgressTracker::start()
-{
-	mSession.NotifyDeviceWideOperationProgress(mProgress, iStatus);
-	
-	SetActive();
-}
-
-void MemSpyDwoProgressTracker::cancel()
-{
-	Cancel();
-}
-
-// Event handler method.
- 
-void MemSpyDwoProgressTracker::RunL()
-    {
- 
-    // If an error occurred handle it in RunError().
-    User::LeaveIfError(iStatus.Int());
- 
-    // Resubmit the request immediately
-    
-    mSession.NotifyDeviceWideOperationProgress(mProgress, iStatus);
- 
-    SetActive();
- 
-    emit progress(mProgress.Progress(), QString((QChar*) mProgress.Description().Ptr(), mProgress.Description().Length()));
-    }
- 
-void MemSpyDwoProgressTracker::DoCancel()
-{ 
-	// this is not yet implemented, as it is not required in current use cases
-}
- 
-TInt MemSpyDwoProgressTracker::RunError(TInt aError)
-{ 
-	// KErrNotReady and KErrCancel errors are OK, they just notify 
-	// us about the outstanding notification request that won't be 
-	// processed.
-	Q_UNUSED(aError);
-	
-    return KErrNone;
-}
-
-MemSpyDwoTracker::MemSpyDwoTracker(RMemSpySession &session, DeviceWideOperation operation) :
-	CActive(EPriorityStandard), 
-	mSession(session),
-	mProgressTracker(new MemSpyDwoProgressTracker(session)),
-	mOperation(operation)
-{
-	CActiveScheduler::Add(this);
-	connect(mProgressTracker, SIGNAL(progress(int,QString)), this, SIGNAL(progress(int,QString)));
-}
-
-MemSpyDwoTracker::~MemSpyDwoTracker()
-{
-	Cancel();
-	
-	delete mProgressTracker;
-}
-
-void MemSpyDwoTracker::start()
-{
-	void (RMemSpySession::*functions[])(TRequestStatus&) = { 
-			&RMemSpySession::OutputPhoneInfo,
-			&RMemSpySession::OutputDetailedPhoneInfo,
-			&RMemSpySession::OutputHeapInfo,
-			&RMemSpySession::OutputCompactHeapInfo,
-			&RMemSpySession::OutputHeapCellListing,
-			&RMemSpySession::OutputHeapData,
-			&RMemSpySession::OutputStackInfo,
-			&RMemSpySession::OutputCompactStackInfo,
-			&RMemSpySession::OutputUserStackData,
-			&RMemSpySession::OutputKernelStackData };
-	
-	(mSession.*functions[mOperation])(iStatus);
-	
-	mProgressTracker->start();
-	
-	SetActive();
-}
-
-void MemSpyDwoTracker::cancel()
-{
-	Cancel();
-}
-
-// Event handler method.
- 
-void MemSpyDwoTracker::RunL()
-    {
- 
-    // If an error occurred handle it in RunError().
-    User::LeaveIfError(iStatus.Int());
- 
-    // Operation has finished successfully 
-    emit finished(0);
-    }
- 
-void MemSpyDwoTracker::DoCancel()
-{
-	// Cancel progress tracker
-	mProgressTracker->cancel();
-	
-	mSession.CancelDeviceWideOperationL();
-}
- 
-TInt MemSpyDwoTracker::RunError(TInt aError)
-{ 
-	// Emit the finished signal to notify user 
-	// operation was canceled
-	emit finished(aError);
-	
-    return KErrNone;
-}
-
-MemSpyAsyncTracker::MemSpyAsyncTracker(RMemSpySession& session, void (RMemSpySession::*function)(TRequestStatus&)) :
-	CActive(EPriorityStandard), 
-	mFunction(function),
-	mSession(session)
-{
-	CActiveScheduler::Add(this);
-}
-
-void MemSpyAsyncTracker::RunL()
-{ 
-    // If an error occurred handle it in RunError().
-    User::LeaveIfError(iStatus.Int());
- 
-    // Operation has finished successfully 
-    emit finished(0);
-}
-
-void MemSpyAsyncTracker::DoCancel()
-{
-	// nothing to do here
-}
-
-TInt MemSpyAsyncTracker::RunError(TInt aError)
-{ 
-	// Emit the finished signal to notify user 
-	// that operation was canceled
-	emit finished(aError);
-	
-    return KErrNone;
-}
-
-void MemSpyAsyncTracker::start()
-{
-	(mSession.*mFunction)(iStatus);
-	
-	SetActive();
-}
-
-MemSpySettings::MemSpySettings() : 
-	QSettings("Nokia", "MemSpy") 
-{
-}
-
-OutputMode MemSpySettings::outputMode() const
-{
-	return static_cast<OutputMode>(value(OUTPUT_MODE, 0).toInt());
-}
-
-void MemSpySettings::setOutputMode(OutputMode mode)
-{
-	setValue(OUTPUT_MODE, mode);
-}
-	
-QString MemSpySettings::outputPath() const
-{
-	return value(OUTPUT_PATH).toString();
-}
-
-void MemSpySettings::setOutputPath(const QString& path)
-{
-	setValue(OUTPUT_PATH, path);
-}
-
-int MemSpySettings::swmtTimerPeriod() const
-{
-	return value(SWMT_PERIOD, 30).toInt();
-}
-
-void MemSpySettings::setSwmtMode(SwmtMode mode)
-{
-	setValue(SWMT_MODE, mode);
-}
-
-SwmtMode MemSpySettings::swmtMode() const
-{
-	return static_cast<SwmtMode>(value(SWMT_MODE, 0).toInt());
-}
-
-void MemSpySettings::setSwmtTimerPeriod(int period)
-{
-	setValue(SWMT_PERIOD, period);
-}
-
-
-QVariantList MemSpySettings::swmtCategories() const
-{
-	return value(SWMT_CATEGORIES).toList();
-}
-
-void MemSpySettings::setSwmtCategories(const QVariantList& categories)
-{
-	setValue(SWMT_CATEGORIES, categories);
-}
-
-HeapDumpsMode MemSpySettings::heapDumpsMode() const
-{
-	return static_cast<HeapDumpsMode>(value(HEAP_DUMPS_MODE).toInt());
-}
-
-void MemSpySettings::setHeapDumpsMode(HeapDumpsMode mode)
-{
-	setValue(HEAP_DUMPS_MODE, mode);
-}
-
-
-EngineWrapper::EngineWrapper() :
-	mSwmtRunning(false)
-{
-}
-
-EngineWrapper::~EngineWrapper()
-{
-	mSession.Close();
-}
-
-bool EngineWrapper::initialize()
-{
-	return mSession.Connect() == KErrNone;
-}
-
-MemSpySettings& EngineWrapper::settings()
-{
-	return mSettings;
-}
-
-const MemSpySettings& EngineWrapper::settings() const
-{
-	return mSettings;
-}
-
-
-
-QList<MemSpyProcess*> EngineWrapper::getProcesses()
-{
-	QList<MemSpyProcess*> result;
-	
-	RArray<CMemSpyApiProcess*> proc;
-	
-	QT_TRAP_THROWING(mSession.GetProcessesL(proc));
-	
-	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;
-	
-	QT_TRAP_THROWING(mSession.GetThreadsL(processId, proc));
-	
-    for (TInt i=0; i<proc.Count(); i++)
-        result.append(new MemSpyThread(proc[i]));
-	
-	return result;
-}
-
-QList<MemSpyThreadInfoItem*> EngineWrapper::getThreadInfo(ThreadId threadId, ThreadInfoType type)
-{
-	QList<MemSpyThreadInfoItem*> result;
-	RArray<CMemSpyApiThreadInfoItem*> threadInfo;
-	qt_symbian_throwIfError(mSession.GetThreadInfoItems(threadInfo, threadId, 
-			static_cast<TMemSpyThreadInfoItemType>(type)));
-	
-	for (TInt i=0; i<threadInfo.Count(); i++)
-		result.append(new MemSpyThreadInfoItem(threadInfo[i]));
-	
-	return result;
-}
-
-void EngineWrapper::setThreadPriority(ThreadId threadId, ThreadPriority priority)
-{
-	TRAP_IGNORE(mSession.SetThreadPriorityL(threadId, priority));
-}
-
-QList<MemSpyKernelObjectType*> EngineWrapper::getKernelObjectTypes()
-{
-	QList<MemSpyKernelObjectType*> result;
-		
-	RArray<CMemSpyApiKernelObject*> types;
-	qt_symbian_throwIfError(mSession.GetKernelObjects(types));
-	
-	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;
-	qt_symbian_throwIfError(mSession.GetKernelObjectItems(objects, 
-			static_cast<TMemSpyDriverContainerType>(type)));
-	
-	for(TInt i=0; i<objects.Count(); i++)
-		result.append(new MemSpyKernelObject(objects[i]));
-	
-	return result;
-}
-
-MemSpyDwoTracker* EngineWrapper::createDeviceWideOperation(DeviceWideOperation operation)
-{
-	return new MemSpyDwoTracker(mSession, operation);
-}
-
-MemSpyKernelHeapDumpTracker* EngineWrapper::createKernelHeapDumpTracker()
-{
-	return new MemSpyKernelHeapDumpTracker(mSession);
-}
-
-MemSpySwmtDumpTracker* EngineWrapper::createSwmtDumpTracker()
-{
-	return new MemSpySwmtDumpTracker(mSession);
-}
-
-void EngineWrapper::setSwmtSettings(SwmtMode mode, const QVariantList& categories)
-{
-	int bits = 0;
-	bool heapDumps = false;
-	switch (mode)
-	{
-	case SwmtModeBasic:
-		bits = TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap | 
-			TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks |
-			TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData |
-			TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory;
-		
-		break;
-		
-	case SwmtModeFull:
-		bits = TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryAll;
-		heapDumps = true;
-		
-		break;
-		
-	case SwmtModeCustom:
-		bits = 0;
-		// this needs to be in sync. with swmt view categories
-		TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerCategories cats[] = {
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryFileServerCache,
-            //TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryBitmapHandles,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap,
-            //TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHeap,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryLocalChunks,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalChunks,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMDrive,
-            //TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks,
-            //TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMLoadedCode,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHandles,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryOpenFiles,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryDiskusage,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory,
-            TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryWindowGroups
-		};
-
-		foreach (const QVariant& bit, categories)
-			bits |= cats[bit.toInt()];
-		
-		break;
-	}
-	
-	TRAP_IGNORE(mSession.SetSwmtCategoriesL(bits));
-	TRAP_IGNORE(mSession.SetSwmtHeapDumpsEnabledL(heapDumps));
-}
-
-bool EngineWrapper::isSwmtRunning()
-{
-	return mSwmtRunning;
-}
-	
-void EngineWrapper::startSwmt(int period)
-{
-	mSwmtRunning = true;
-	updateOutputSettings();
-	TRAP_IGNORE(mSession.StartSwmtTimerL(period));
-}
-
-void EngineWrapper::stopSwmt()
-{
-	mSwmtRunning = false;
-	TRAP_IGNORE(mSession.StopSwmtTimerL());
-}
-
-void EngineWrapper::forceSwmtDump()
-{
-	updateOutputSettings();	
-	TRAP_IGNORE(mSession.ForceSwmtUpdateL());
-}
-
-void EngineWrapper::outputKernelHeapData()
-{
-	updateOutputSettings();
-	TRAP_IGNORE(mSession.OutputKernelHeapDataL());
-}
-
-int EngineWrapper::outputThreadHeapData(const QString& filter)
-{
-	TPtrC customFilterDesc(static_cast<const TUint16*>(filter.utf16()), filter.length());
-	
-	TRAPD(err, mSession.OutputThreadHeapDataL(customFilterDesc));
-	
-	return err;
-}
-
-void EngineWrapper::updateOutputSettings()
-{
-	switch (mSettings.outputMode()) {
-		case OutputModeTrace:
-			TRAP_IGNORE(mSession.SwitchOutputToTraceL());
-			break;
-		
-		case OutputModeFile:
-		
-			if (mSettings.outputPath().isEmpty()) {
-				TRAP_IGNORE(mSession.SwitchOutputToFileL(KNullDesC));
-			
-			} else {
-				
-				QString root = mSettings.outputPath();
-				TPtrC rootDesc (static_cast<const TUint16*>(root.utf16()), root.length());
-			
-				TRAP_IGNORE(mSession.SwitchOutputToFileL(rootDesc));
-			}
-	
-	}
-}
--- a/memspyui/ui/hb/src/main.cpp	Tue Aug 31 15:15:20 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:
-*  
-*/
-
-#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();
-}
--- a/memspyui/ui/hb/src/memspyheapdumpsview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include <HbToolBar>
-#include <HbAction>
-#include <HbDataForm>
-#include <HbDataFormModel>
-#include <HbProgressDialog>
-#include <HbMessageBox>
-#include <HbLabel>
-
-#include "memspyheapdumpsview.h"
-#include "enginewrapper.h"
-
-const QStringList MODE_ITEMS = QStringList() << 
-	MemSpyHeapDumpsView::tr("Kernel") << 
-	MemSpyHeapDumpsView::tr("User") << 
-	MemSpyHeapDumpsView::tr("Both");
-	
-MemSpyHeapDumpsView::MemSpyHeapDumpsView(EngineWrapper &engine, ViewManager &viewManager) : 
-	MemSpyView(engine, viewManager),
-	mModel(0),
-	mModeItem(0),
-	mFilterItem(0),
-	mDwoProgressDialog(0)
-{
-}
-
-MemSpyHeapDumpsView::~MemSpyHeapDumpsView()
-{
-	delete mDwoProgressDialog;
-}
-
-void MemSpyHeapDumpsView::initialize(const QVariantMap& params)
-{
-	setTitle(tr("Heap Dumps"));
-	
-	MemSpyView::initialize(params);
-}
-
-HbToolBar* MemSpyHeapDumpsView::createToolBar()
-{
-	HbToolBar* toolBar = new HbToolBar();
-	toolBar->addAction(tr("Dump Now"), this, SLOT(dump()));
-	return toolBar;
-}
-
-HbWidget* MemSpyHeapDumpsView::createCentralWidget()
-{
-	mModel = new HbDataFormModel(this);
-	
-	//TODO: uncomment after kernel heap dumps are implemented 
-//	mModeItem = mModel->appendDataFormItem(
-//		HbDataFormModelItem::ComboBoxItem, tr("Heap Dump"));
-//	mModeItem->setContentWidgetData("items", MODE_ITEMS);
-//	mModeItem->setContentWidgetData("currentIndex", mEngine.settings().heapDumpsMode());
-//	modeChanged(mEngine.settings().heapDumpsMode());
-	
-	//TODO: remove after kernel heap dumps are implemented
-	createFilterItem();
-	
-	HbDataForm* form = new HbDataForm(this);
-	form->setModel(mModel);
-	
-	//TODO: uncomment after kernel heap dumps are implemented
-//	form->addConnection(mModeItem, SIGNAL(currentIndexChanged(int)), this, SLOT(modeChanged(int)));
-	
-	return form;
-}
-
-void MemSpyHeapDumpsView::modeChanged(int mode)
-{
-	if (mode == HeapDumpsModeKernel && mFilterItem)
-		removeFilterItem();
-	else if (mode != HeapDumpsModeKernel && !mFilterItem)
-		createFilterItem();
-}
-
-void MemSpyHeapDumpsView::createFilterItem()
-{
-	mFilterItem = mModel->appendDataFormItem(
-			HbDataFormModelItem::TextItem, tr("Filter"));
-}
-
-void MemSpyHeapDumpsView::removeFilterItem()
-{
-	mModel->removeItem(mFilterItem);
-	mFilterItem = 0;
-}
-
-void MemSpyHeapDumpsView::dump()
-{
-    mEngine.updateOutputSettings();
-    
-	HeapDumpsMode mode = HeapDumpsModeUser;
-	//TODO: uncomment after kernel heap dumps are implemented 
-	//static_cast<HeapDumpsMode>(mModeItem->contentWidgetData("currentIndex").toInt());
-	
-	// save settings
-	//TODO: uncomment after kernel heap dumps are implemented
-	//mEngine.settings().setHeapDumpsMode(mode);
-
-	if (mode == HeapDumpsModeKernel || mode == HeapDumpsModeBoth) {
-		// dump kernel heap
-		mDwoProgressDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
-		mDwoProgressDialog->setText(tr("Please wait..."));
-		mDwoProgressDialog->show();
-		
-		MemSpyKernelHeapDumpTracker* tracker = mEngine.createKernelHeapDumpTracker();
-		connect(tracker, SIGNAL(finished(int)), this, SLOT(asyncOperationFinished(int)));
-		tracker->start();
-	}
-	
-	if (mode == HeapDumpsModeUser || mode == HeapDumpsModeBoth) {
-		// dump user heap
-		
-		QString filter = mFilterItem->contentWidgetData("text").toString();
-		if (!filter.isEmpty()) {
-		    
-			int errorCode = mEngine.outputThreadHeapData(filter);
-            if (errorCode == KErrNotFound) {
-                HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
-                messageBox->setText(tr("No thread matches your filter"));
-                HbLabel *header = new HbLabel(tr("No such thread"), messageBox);
-                messageBox->setHeadingWidget(header);
-                messageBox->setAttribute(Qt::WA_DeleteOnClose);
-                messageBox->setTimeout(HbPopup::StandardTimeout);
-                messageBox->open();
-            }
-			    
-			
-		} else {
-			mDwoProgressDialog = new HbProgressDialog(HbProgressDialog::ProgressDialog);
-			mDwoProgressDialog->setMinimum(0);
-			mDwoProgressDialog->setMaximum(100);
-			mDwoProgressDialog->show();
-			
-			MemSpyDwoTracker* tracker = mEngine.createDeviceWideOperation(OutputHeapData);
-			connect(tracker, SIGNAL(progress(int,QString)), this, SLOT(updateDwoProgress(int,QString)));
-			connect(tracker, SIGNAL(finished(int)), this, SLOT(asyncOperationFinished(int)));
-			connect(mDwoProgressDialog, SIGNAL(cancelled()), tracker, SLOT(cancel()));
-			tracker->start();
-		}
-	}
-}
-
-void MemSpyHeapDumpsView::updateDwoProgress(int progress, const QString& processName)
-{
-	mDwoProgressDialog->setText(processName);
-	mDwoProgressDialog->setProgressValue(progress);
-}
-
-void MemSpyHeapDumpsView::asyncOperationFinished(int errorCode)
-{
-	mDwoProgressDialog->hide();
-	delete mDwoProgressDialog;
-	mDwoProgressDialog = 0;
-	
-	delete sender();    
-	
-	if (errorCode != KErrNone && errorCode != KErrCancel) {
-	    HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeWarning);
-        messageBox->setText(tr("An error occured during the operation. Error code: %1").arg(errorCode));
-        HbLabel *header = new HbLabel(tr("Error"), messageBox);
-        messageBox->setHeadingWidget(header);
-        messageBox->setAttribute(Qt::WA_DeleteOnClose);
-        messageBox->setTimeout(HbPopup::StandardTimeout);
-        messageBox->open();
-	}
-}
--- a/memspyui/ui/hb/src/memspykernelobjectdetailview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include <QStringListModel>
-
-#include "memspykernelobjectdetailview.h"
-
-MemSpyKernelObjectDetailModel::MemSpyKernelObjectDetailModel(const QStringList& details, QObject *parent) :
-    QAbstractListModel(parent),
-    mDetails(details)
-{
-
-}
-    
-int MemSpyKernelObjectDetailModel::rowCount(const QModelIndex &parent) const
-{
-    Q_UNUSED(parent);
-    return mDetails.count();
-}
-    
-QVariant MemSpyKernelObjectDetailModel::data(const QModelIndex &index, int role) const
-{
-    if (role == Qt::DisplayRole) {
-        
-        // convert from semicolon delimited line to two lines
-        return mDetails.at(index.row()).split(": ");
-    }
-    
-    return QVariant();
-}
-
-
-void MemSpyKernelObjectDetailView::initialize(const QVariantMap& params)
-{
-	setTitle("Details");
-	
-	mTypeName = params["typeName"].toString();
-	mObjectName = params["objectName"].toString();
-	MemSpyView::initialize(params);
-		
-	QStringList items = params.value("details").toStringList();
-	mListView.setModel(new MemSpyKernelObjectDetailModel(items, this));
-}
-
-bool MemSpyKernelObjectDetailView::isBreadCrumbVisible() const
-{
-    return true;
-}
-            
-QString MemSpyKernelObjectDetailView::getBreadCrumbText() const
-{
-    return tr("Kernel Objects > %1 > %2").arg(mTypeName).arg(mObjectName);
-}
--- a/memspyui/ui/hb/src/memspykernelobjecttypeview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include <QStringListModel>
-
-#include "memspykernelobjecttypeview.h"
-#include "viewmanager.h"
-
-MemSpyKernelObjectTypeModel::MemSpyKernelObjectTypeModel(EngineWrapper &engine, QObject *parent) :
-	QAbstractListModel(parent),
-	mObjectTypes(engine.getKernelObjectTypes())
-{
-    mKernelObjectNames << "Threads" << "Processes" << "Chunks" << "Libraries" <<
-        "Semaphores" << "Mutexes" << "Timers" << "Servers" << "Sessions" << "Logical Devices" <<
-        "Physical Devices" << "Logical Channels" << "Change Notifiers" << "Undertakers" <<
-        "Message Queues" << "Property Refs." << "Conditional Vars.";
-}
-
-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 << mKernelObjectNames.at(index.row());
-		lines << QString("%1, %2").
-			arg(tr("%n item(s)", "", mObjectTypes.at(index.row())->count())).
-			arg(formatSize(mObjectTypes.at(index.row())->size()));
-		
-		return lines;
-	}
-	
-	if (role == Qt::UserRole)
-		return mObjectTypes.at(index.row())->id();
-	
-	return QVariant();
-}
-
-QString MemSpyKernelObjectTypeModel::formatSize(qint64 size) const
-{
-	// If < 1000K
-	if  (size < 1024000)
-		return QString("%1K").arg(size ? qBound<int>(1, (size + 512) >> 10, 999) : 0);
-	
-	// larger than 1M
-	double sizeInM = size / 1048576.;
-	return sizeInM >= 1000 ?
-		QString("%1G").arg(qMax<double>(1, sizeInM / 1024), 0, 'f', 1) :
-		QString("%1M").arg(qBound<double>(1, sizeInM, 999.9), 0, 'f', 1);
-}
-
-void MemSpyKernelObjectTypeView::initialize(const QVariantMap& params)
-{
-	setTitle(tr("Kernel Objects"));
-		
-	MemSpyView::initialize(params);
-			
-	mListView.setModel(new MemSpyKernelObjectTypeModel(mEngine, 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);
-}
-
--- a/memspyui/ui/hb/src/memspykernelobjectview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#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)
-{
-	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));
-	
-	MemSpyView::initialize(params);
-	
-	//mListView.setModel(new MemSpyKernelObjectTypeModel(mEngine, this));
-	mListView.setModel(new MemSpyKernelObjectModel(mEngine, type, this));
-	
-	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
-}
-
-bool MemSpyKernelObjectView::isBreadCrumbVisible() const
-{
-    return true;
-}
-            
-QString MemSpyKernelObjectView::getBreadCrumbText() const
-{
-    return tr("Kernel Objects");
-}
-
-
-void MemSpyKernelObjectView::itemClicked(const QModelIndex& index)
-{
-	QVariantMap map;
-	map.insert("details", getDetails(static_cast<MemSpyKernelObject*>(qVariantValue<void*>(index.data(Qt::UserRole)))));
-	map.insert("typeName", title());
-	map.insert("objectName", static_cast<MemSpyKernelObject*>(qVariantValue<void*>(index.data(Qt::UserRole)))->nameDetail());
-    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;
-}
--- a/memspyui/ui/hb/src/memspylistview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include "memspylistview.h"
-
-HbWidget* MemSpyListView::createCentralWidget()
-{
-	return &mListView;
-}
--- a/memspyui/ui/hb/src/memspymainview.cpp	Tue Aug 31 15:15:20 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 "memspymainview.h"
-#include "viewmanager.h"
-
-#include <QStringListModel>
-#include <QDebug>
-
-void MemSpyMainView::initialize(const QVariantMap& params)
-{
-	setTitle("MemSpy");
-	
-	MemSpyView::initialize(params);
-	
-	QStringList items = QStringList() 
-			<< tr("Processes & Threads") 
-			<< tr("Kernel Objects")
-			<< tr("Tracking");
-	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, TrackingView };
-    mViewManager.showView(indexes[index.row()]);
-}
-
-bool MemSpyMainView::isBreadCrumbVisible() const
-{
-	return false;
-}
-
--- a/memspyui/ui/hb/src/memspyprocessview.cpp	Tue Aug 31 15:15:20 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 "memspyprocessview.h"
-
-#include <QVariantMap>
-
-#include "viewmanager.h"
-
-MemSpyProcessModel::MemSpyProcessModel(EngineWrapper &engine, QObject *parent) :
-	QAbstractListModel(parent),
-	mEngine(engine),
-	mProcesses(engine.getProcesses())
-{
-    mPriorityMap.insert(EPriorityLow, tr("[L]"));
-    mPriorityMap.insert(EPriorityBackground, tr("[B]"));
-    mPriorityMap.insert(EPriorityForeground, tr("[F]"));
-    mPriorityMap.insert(EPriorityHigh, tr("[H]"));
-    mPriorityMap.insert(EPriorityWindowServer, tr("[WS]"));
-    mPriorityMap.insert(EPriorityFileServer, tr("[FS]"));
-    mPriorityMap.insert(EPriorityRealTimeServer, tr("[RTS]"));
-    mPriorityMap.insert(EPrioritySupervisor, tr("[SUP]"));
-}
-
-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) {
-	    const MemSpyProcess* process = mProcesses.at(index.row());
-	    
-		QStringList lines;
-		lines << process->name();
-		
-		lines << (process->isDead() ? 
-		    process->exitInfo() :
-		    QString("%1, %2 thr, %3").
-                arg(process->sid(), 0, 16).
-                arg(process->threadCount()).
-                arg(mPriorityMap.value(process->priority(), tr("[?]"))));
-		
-		return lines;
-	}
-	
-	if (role == Qt::UserRole)
-		return mProcesses.at(index.row())->id();
-	
-	return QVariant();
-}
-
-void MemSpyProcessModel::refresh()
-{
-    beginResetModel();
-    QList<MemSpyProcess*> data = mEngine.getProcesses();
-    qDeleteAll(mProcesses);
-    mProcesses = data;
-    endResetModel();
-}
-	
-
-void MemSpyProcessView::initialize(const QVariantMap& params)
-{
-	setTitle(tr("Processes"));
-	MemSpyView::initialize(params);
-	
-	mModel = new MemSpyProcessModel(mEngine, this);
-	mListView.setModel(mModel);
-	
-	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
-}
-
-void MemSpyProcessView::itemClicked(const QModelIndex& index)
-{
-	QVariantMap map;
-	map.insert("pid", index.data(Qt::UserRole));
-	map.insert("pname", index.data(Qt::DisplayRole).toStringList().at(0));
-    mViewManager.showView(ThreadView, map);
-}
-
-void MemSpyProcessView::refresh()
-{ 
-    mModel->refresh(); 
-}
-
--- a/memspyui/ui/hb/src/memspysettingsview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include <HbToolBar>
-#include <HbAction>
-#include <HbDataForm>
-#include <HbDataFormModel>
-#include <HbProgressDialog>
-
-#include "memspysettingsview.h"
-#include "enginewrapper.h"
-
-const QStringList MODE_ITEMS = QStringList() << 
-	MemSpySettingsView::tr("RDebug") << 
-	MemSpySettingsView::tr("File");
-	
-MemSpySettingsView::MemSpySettingsView(EngineWrapper &engine) :
-	mForm(new HbDataForm(this)),
-	mModel(0),
-	mModeItem(0),
-	mPathItem(0),
-	mCustomPathItem(0),
-	mEngine(engine)
-{
-	setTitle(tr("Settings"));
-	
-	toolBar()->addAction(tr("OK"), this, SLOT(accept()));
-	toolBar()->addAction(tr("Cancel"), this, SLOT(reject()));
-	
-	mModel = new HbDataFormModel(this);
-		
-	mModeItem = mModel->appendDataFormItem(
-		HbDataFormModelItem::ComboBoxItem, tr("Output"));
-	mModeItem->setContentWidgetData("items", MODE_ITEMS);
-	mModeItem->setContentWidgetData("currentIndex", mEngine.settings().outputMode());
-	
-	updateModel();
-		
-	
-	mForm->setModel(mModel);
-	mForm->addConnection(mModeItem, SIGNAL(currentIndexChanged(int)), this, SLOT(updateModel()));
-	setWidget(mForm);
-	
-	// change navigation action
-	HbAction* action = new HbAction(Hb::BackNaviAction, this);
-	connect(action, SIGNAL(triggered()), this, SLOT(reject()));
-	setNavigationAction(action);
-}
-
-MemSpySettingsView::~MemSpySettingsView()
-{
-}
-
-void MemSpySettingsView::updateModel()
-{
-	OutputMode mode = static_cast<OutputMode>(mModeItem->contentWidgetData("currentIndex").toInt());
-	if (mode == OutputModeTrace) {
-		// remove both path item and custom path item
-		if (mPathItem)
-			mModel->removeItem(mPathItem);
-		if (mCustomPathItem)
-			mModel->removeItem(mCustomPathItem);
-		
-		mPathItem = mCustomPathItem = 0;
-	} else if (mode == OutputModeFile) {
-		if (!mPathItem) {
-			// create path item
-			mPathItem = mModel->appendDataFormItem(
-					HbDataFormModelItem::CheckBoxItem, tr("Path"));
-			mPathItem->setContentWidgetData("text", tr("Use Default Path (\\MemSpy)"));
-			mPathItem->setContentWidgetData("checkState", 
-					mEngine.settings().outputPath().isEmpty() ? Qt::Checked : Qt::Unchecked);
-			
-			mForm->addConnection(mPathItem, SIGNAL(stateChanged(int)), 
-					this, SLOT(updateModel()));
-		}
-		
-		if (mPathItem->contentWidgetData("checkState").toInt() == Qt::Unchecked && !mCustomPathItem) {
-			// create custom path item
-			mCustomPathItem = mModel->appendDataFormItem(
-					HbDataFormModelItem::TextItem, tr("Custom Path"));
-			mCustomPathItem->setContentWidgetData("text", 
-					mEngine.settings().outputPath().isEmpty() ? "\\MemSpy" : mEngine.settings().outputPath());
-		}
-		
-		if (mPathItem->contentWidgetData("checkState").toInt() == Qt::Checked && mCustomPathItem) {
-			// remove cusom path item
-			mModel->removeItem(mCustomPathItem);
-			mCustomPathItem = 0;
-		}
-	}
-}
-
-void MemSpySettingsView::accept()
-{
-	OutputMode mode = static_cast<OutputMode>(mModeItem->contentWidgetData("currentIndex").toInt());
-	
-	mEngine.settings().setOutputMode(mode);
-	
-	if (mode == OutputModeFile) {
-		QString path = mPathItem->contentWidgetData("checkState").toInt() == Qt::Checked ? 
-				"" :
-				mCustomPathItem->contentWidgetData("text").toString();
-		mEngine.settings().setOutputPath(path);
-	}
-	emit finished(true);
-}
-
-void MemSpySettingsView::reject()
-{
-	emit finished(false);
-}
-
--- a/memspyui/ui/hb/src/memspyswmtview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,180 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *  
- */
-
-#include <HbToolBar>
-#include <HbAction>
-#include <HbDataForm>
-#include <HbDataFormModel>
-#include <HbProgressDialog>
-
-#include "memspyswmtview.h"
-#include "enginewrapper.h"
-
-const QStringList MODE_ITEMS = QStringList() << 
-	MemSpySwmtView::tr("Basic") << 
-	MemSpySwmtView::tr("Full") << 
-	MemSpySwmtView::tr("Custom");
- 
-const QStringList CATEGORIES_ITEMS = QStringList() <<
-	MemSpySwmtView::tr("FileServer Cache") <<
-	//MemSpySwmtView::tr("Bitmap Handles") <<
-	MemSpySwmtView::tr("User Heap") <<
-	//MemSpySwmtView::tr("Kernel Heap") <<
-	MemSpySwmtView::tr("Local Chunks") <<
-	MemSpySwmtView::tr("Global Chunks") <<
-	MemSpySwmtView::tr("RAM Drive") <<
-	//MemSpySwmtView::tr("User Stacks") <<
-	//MemSpySwmtView::tr("Global Data") <<
-	MemSpySwmtView::tr("RAM-loaded Code") <<
-	MemSpySwmtView::tr("Kernel Handles") <<
-	MemSpySwmtView::tr("Open Files") <<
-	MemSpySwmtView::tr("Disk Usage") <<
-	MemSpySwmtView::tr("System Memory") <<
-	MemSpySwmtView::tr("Windows Groups");
-	
-MemSpySwmtView::MemSpySwmtView(EngineWrapper &engine, ViewManager &viewManager) : 
-	MemSpyView(engine, viewManager), 
-	mToggleTimerAction(0),
-	mCategoriesItem(0),
-	mProgressDialog(0)
-{
-}
-
-MemSpySwmtView::~MemSpySwmtView()
-{
-}
-
-void MemSpySwmtView::initialize(const QVariantMap& params)
-{
-	setTitle(tr("SWMT"));
-	
-	MemSpyView::initialize(params);
-}
-
-HbToolBar* MemSpySwmtView::createToolBar()
-{
-	HbToolBar* toolBar = new HbToolBar();
-	mToggleTimerAction = toolBar->addAction("", this, SLOT(toggleTimer()));
-	toolBar->addAction(tr("Dump Now"), this, SLOT(forceDump()));
-	
-	updateTimerAction(mEngine.isSwmtRunning());
-	
-	return toolBar;
-}
-
-HbWidget* MemSpySwmtView::createCentralWidget()
-{
-	mModel = new HbDataFormModel(this);
-	
-	mTimerItem = mModel->appendDataFormItem(
-			HbDataFormModelItem::TextItem, tr("Timer (sec.)"));
-	mTimerItem->setContentWidgetData("maxLength", 2);
-	mTimerItem->setContentWidgetData("text", mEngine.settings().swmtTimerPeriod());
-	
-	mModeItem = mModel->appendDataFormItem(
-			HbDataFormModelItem::ComboBoxItem, tr("Tracking mode"));
-	mModeItem->setContentWidgetData("items", MODE_ITEMS);
-	mModeItem->setContentWidgetData("currentIndex", mEngine.settings().swmtMode());
-	
-	modeChanged(mEngine.settings().swmtMode());
-	
-	HbDataForm* form = new HbDataForm(this);
-	form->setModel(mModel);
-	
-	form->addConnection(mModeItem, SIGNAL(currentIndexChanged(int)), this, SLOT(modeChanged(int)));
-	
-	return form;
-}
-
-void MemSpySwmtView::updateTimerAction(bool isRunning)
-{
-	mToggleTimerAction->setText(isRunning ? tr("Stop Timer") : tr("Start Timer"));
-}
-
-void MemSpySwmtView::toggleTimer()
-{
-	bool wasRunning = mEngine.isSwmtRunning();
-	if (wasRunning)
-		mEngine.stopSwmt();
-	else
-	{
-		updateSettings();
-		mEngine.startSwmt(qBound(5, mTimerItem->contentWidgetData("text").toInt(), 60));
-	}
-	
-	updateTimerAction(!wasRunning);
-}
-
-void MemSpySwmtView::forceDump()
-{
-	updateSettings();
-	mEngine.updateOutputSettings();
-		
-	MemSpySwmtDumpTracker* tracker = mEngine.createSwmtDumpTracker();
-	connect(tracker, SIGNAL(finished(int)), this, SLOT(asyncOperationFinished(int)));
-	
-	mProgressDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
-	mProgressDialog->setText(tr("Please wait..."));
-	mProgressDialog->show();
-	
-	tracker->start();
-}
-
-void MemSpySwmtView::updateSettings()
-{
-	mEngine.settings().setSwmtTimerPeriod(mTimerItem->contentWidgetData("text").toInt());
-	mEngine.settings().setSwmtMode(static_cast<SwmtMode>(
-			mModeItem->contentWidgetData("currentIndex").toInt()));
-	if (mCategoriesItem)
-		mEngine.settings().setSwmtCategories(mCategoriesItem->contentWidgetData("selectedItems").toList());
-	
-	mEngine.setSwmtSettings(static_cast<SwmtMode>(mEngine.settings().swmtMode()), 
-		mEngine.settings().swmtCategories());
-}
-
-void MemSpySwmtView::modeChanged(int mode)
-{
-	if (mode != SwmtModeCustom && mCategoriesItem)
-		removeCategoriesItem();
-	else if (mode == SwmtModeCustom && !mCategoriesItem)
-		createCategoriesItem();
-}
-
-void MemSpySwmtView::asyncOperationFinished(int errorCode)
-{
-	Q_UNUSED(errorCode);
-		
-	mProgressDialog->hide();
-	delete mProgressDialog;
-	mProgressDialog = 0;
-	
-	delete sender();
-}
-
-void MemSpySwmtView::createCategoriesItem()
-{
-	mCategoriesItem = mModel->appendDataFormItem(
-			HbDataFormModelItem::MultiselectionItem, tr("Categories"));
-	mCategoriesItem->setContentWidgetData("items", CATEGORIES_ITEMS);
-	mCategoriesItem->setContentWidgetData("selectedItems", mEngine.settings().swmtCategories());
-}
-
-void MemSpySwmtView::removeCategoriesItem()
-{
-	mModel->removeItem(mCategoriesItem);
-	mCategoriesItem = 0;
-}
--- a/memspyui/ui/hb/src/memspythreaddetailindexview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include <QAction>
-#include <QStringListModel>
-#include <HbMenu>
-
-#include "memspythreaddetailindexview.h"
-#include "viewmanager.cpp"
-
-void MemSpyThreadDetailIndexView::initialize(const QVariantMap& params)
-{
-	setTitle(tr("Details"));
-	
-	mProcessName = params["pname"].toString();
-	mThreadName = params["tname"].toString();
-	
-	MemSpyView::initialize(params);
-	
-	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");
-	
-	mListView.setModel(new QStringListModel(lines, this));
-	
-	connect(&mListView, SIGNAL(activated(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
-}
-
-HbMenu* MemSpyThreadDetailIndexView::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;
-}
-
-bool MemSpyThreadDetailIndexView::isBreadCrumbVisible() const
-{
-    return true;
-}
-
-QString MemSpyThreadDetailIndexView::getBreadCrumbText() const
-{
-    return tr("Processes > %1 > Threads > %2").arg(mProcessName).arg(mThreadName);
-}
-
-void MemSpyThreadDetailIndexView::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]);
-}
-
-void MemSpyThreadDetailIndexView::itemClicked(const QModelIndex& index)
-{
-	ThreadInfoType types[] = { ThreadInfoTypeGeneral, ThreadInfoTypeHeap, 
-			ThreadInfoTypeStack, ThreadInfoTypeChunk, ThreadInfoTypeCodeSeg, 
-			ThreadInfoTypeOpenFiles, ThreadInfoTypeActiveObjects, ThreadInfoTypeOwnedThreadHandles,
-			ThreadInfoTypeOwnedProcessHandles, ThreadInfoTypeServer, ThreadInfoTypeSession, 
-			ThreadInfoTypeSemaphore, ThreadInfoTypeOtherThreads, ThreadInfoTypeOtherProcesses,
-			ThreadInfoTypeMutex, ThreadInfoTypeTimer, ThreadInfoTypeChannel,
-			ThreadInfoTypeChangeNotifier, ThreadInfoTypeUndertaker,
-			ThreadInfoTypeLDD, ThreadInfoTypePDD };
-	
-	QVariantMap map;
-	map.insert("tid", mThreadId);
-	map.insert("type", types[index.row()]);
-	map.insert("pname", mProcessName);
-	map.insert("tname", mThreadName);
-	mViewManager.showView(ThreadDetailView, map);
-}
-
--- a/memspyui/ui/hb/src/memspythreaddetailview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include <QAction>
-#include <QStringListModel>
-#include <HbMenu>
-
-#include "memspythreaddetailview.h"
-
-MemSpyThreadDetailModel::MemSpyThreadDetailModel(EngineWrapper &engine, ThreadId threadId, ThreadInfoType type, QObject *parent) :
-	QAbstractListModel(parent),
-	mThreadInfo(engine.getThreadInfo(threadId, type))
-{
-}
-
-MemSpyThreadDetailModel::~MemSpyThreadDetailModel()
-{
-	qDeleteAll(mThreadInfo);
-}
-	
-int MemSpyThreadDetailModel::rowCount(const QModelIndex &parent) const
-{
-	Q_UNUSED(parent);
-	return qMax(mThreadInfo.count(), 1);
-}
-	
-QVariant MemSpyThreadDetailModel::data(const QModelIndex &index, int role) const
-{
-	if (role == Qt::DisplayRole) {
-	    
-	    if (mThreadInfo.count()) {
-            QStringList lines;
-            lines << mThreadInfo.at(index.row())->caption();
-            lines << mThreadInfo.at(index.row())->value();
-            return lines;
-	    }
-	    
-	    return tr("(no items found)");
-	}
-	
-	if (role == Qt::TextAlignmentRole && mThreadInfo.count() == 0) {
-	    
-	    return Qt::AlignHCenter;
-	}
-	
-	return QVariant();
-}
-
-void MemSpyThreadDetailView::initialize(const QVariantMap& params)
-{
-    mProcessName = params["pname"].toString();
-    mThreadName = params["tname"].toString();
-    
-    // TODO: Remove duplicates with memspythreaddetailindexview
-    QMap<int, QString> titleMap;
-    titleMap[ThreadInfoTypeGeneral] = tr("General");
-    titleMap[ThreadInfoTypeHeap] = tr("Heap");
-    titleMap[ThreadInfoTypeStack] = tr("Stack");
-    titleMap[ThreadInfoTypeChunk] = tr("Chunks");
-    titleMap[ThreadInfoTypeCodeSeg] = tr("Code Segments"); 
-    titleMap[ThreadInfoTypeOpenFiles] = tr("Open Files");
-    titleMap[ThreadInfoTypeActiveObjects] = tr("Active Objects");
-    titleMap[ThreadInfoTypeOwnedThreadHandles] = tr("Handles to other Threads");
-    titleMap[ThreadInfoTypeOwnedProcessHandles] = tr("Handles to other Processes");
-    titleMap[ThreadInfoTypeServer] = tr("Servers Running in Thread");
-    titleMap[ThreadInfoTypeSession] = tr("Client <-> Server connections");
-    titleMap[ThreadInfoTypeSemaphore] = tr("Semaphores");
-    titleMap[ThreadInfoTypeOtherThreads] = tr("References this Thread");
-    titleMap[ThreadInfoTypeOtherProcesses] = tr("References this Process");
-    titleMap[ThreadInfoTypeMutex] = tr("Mutexes");
-    titleMap[ThreadInfoTypeTimer] = tr("Timers");
-    titleMap[ThreadInfoTypeChannel] = tr("Logical DD Channels");
-    titleMap[ThreadInfoTypeChangeNotifier] = tr("Change Notifiers"); 
-    titleMap[ThreadInfoTypeUndertaker] = tr("Undertakers");
-    titleMap[ThreadInfoTypeLDD] = tr("Logical Device Drivers");
-    titleMap[ThreadInfoTypePDD] = tr("Physical Device Drivers");
-    
-    setTitle(titleMap.value(params["type"].toInt()));
-    
-	MemSpyView::initialize(params);
-	
-	ThreadId threadId = qVariantValue<ThreadId>(params["tid"]);
-	ThreadInfoType type = static_cast<ThreadInfoType>(qVariantValue<int>(params["type"]));
-	
-	mListView.setModel(new MemSpyThreadDetailModel(mEngine, threadId, type, this));
-}
-
-bool MemSpyThreadDetailView::isBreadCrumbVisible() const
-{
-    return true;
-}
-
-QString MemSpyThreadDetailView::getBreadCrumbText() const
-{
-    return tr("Processes > %1 > Threads > %2").arg(mProcessName).arg(mThreadName);
-}
--- a/memspyui/ui/hb/src/memspythreadview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,204 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this 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 processId, QObject *parent) :
-	QAbstractListModel(parent),
-	mProcessId(processId),
-	mEngine(engine),
-	mThreads(engine.getThreads(processId))
-{
-	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();
-}
-
-void MemSpyThreadModel::refresh()
-{
-    beginResetModel();
-    QList<MemSpyThread*> data = mEngine.getThreads(mProcessId);
-    qDeleteAll(mThreads);
-    mThreads = data;
-    endResetModel();
-}
-
-MemSpyThreadView::MemSpyThreadView(EngineWrapper &engine, ViewManager &viewManager) : 
-	MemSpyListView(engine, viewManager), 
-	mContextMenu(0), 
-	mPriorityMenu(0),
-	mThreadId(0),
-	mModel(0)
-{
-}
-
-MemSpyThreadView::~MemSpyThreadView()
-{
-	delete mContextMenu;
-	delete mPriorityMenu;
-}
-
-void MemSpyThreadView::initialize(const QVariantMap& params)
-{
-	ProcessId pid = qVariantValue<ProcessId>(params["pid"]);
-	setTitle(tr("Threads"));
-	
-	mProcessName = params["pname"].toString();
-	
-	MemSpyView::initialize(params);
-	
-	mModel = new MemSpyThreadModel(mEngine, pid, this);
-	mListView.setModel(mModel);
-	
-	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()));
-}
-
-
-bool MemSpyThreadView::isBreadCrumbVisible() const
-{
-    return true;
-}
-
-QString MemSpyThreadView::getBreadCrumbText() const
-{
-    return tr("Processes > %1").arg(mProcessName);
-}
-
-void MemSpyThreadView::itemClicked(const QModelIndex& index)
-{
-	QVariantMap map;
-	map["tid"] = index.data(Qt::UserRole);
-	map.insert("pname", mProcessName);
-	map.insert("tname", index.data(Qt::DisplayRole).toStringList().at(0));
-	
-	mViewManager.showView(ThreadDetailIndexView, map);
-}
-
-void MemSpyThreadView::catchLongPress(HbAbstractViewItem *item, const QPointF &coords)
-{
-	mThreadId = qVariantValue<ThreadId>(item->modelIndex().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]);
-	refresh();
-}
-
-void MemSpyThreadView::refresh()
-{ 
-    mModel->refresh(); 
-}
--- a/memspyui/ui/hb/src/memspytrackingview.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include "memspytrackingview.h"
-#include "viewmanager.h"
-
-#include <QStringListModel>
-#include <QDebug>
-
-void MemSpyTrackingView::initialize(const QVariantMap& params)
-{
-	setTitle("MemSpy");
-	
-	MemSpyView::initialize(params);
-	
-	QStringList items = QStringList() 
-			<< tr("System Wide Memory Tracking")
-			<< tr("Heap Dumps");
-	mListView.setModel(new QStringListModel(items, this));
-    
-	QObject::connect(&mListView, SIGNAL(released(QModelIndex)), this, SLOT(itemClicked(QModelIndex)));
-}
-
-void MemSpyTrackingView::itemClicked(const QModelIndex& index)
-{
-	Q_UNUSED(index);
-	ViewIndex indexes[] = { SwmtView, HeapDumpsView };
-    mViewManager.showView(indexes[index.row()]);
-}
-
-bool MemSpyTrackingView::isBreadCrumbVisible() const
-{
-	return false;
-}
-
--- a/memspyui/ui/hb/src/memspyview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-* 
-*/
-
-#include <QSignalMapper>
-#include <QGraphicsLinearLayout>
-#include <QDebug>
-#include <HbMenu>
-#include <HbAction>
-#include <HbToolBar>
-#include <HbApplication>
-#include <HbMessageBox>
-#include <HbMainWindow>
-#include <HbLabel>
-
-#include "memspyview.h"
-#include "enginewrapper.h"
-
-#include "memspysettingsview.h"
-
-MemSpyView::MemSpyView(EngineWrapper &engine, ViewManager &viewManager) : 
-	HbView(),
-	mEngine(engine),
-	mViewManager(viewManager),
-	mOutputMenu(0), 
-	mOutputGenInfoMenu(0), 
-	mOutputHeapInfoMenu(0),
-	mOutputStackInfoMenu(0),
-	mToolBar(0),
-	mBreadCrumb(0)
-{
-}
-
-MemSpyView::~MemSpyView()
-{
-	delete mBreadCrumb;
-	delete mToolBar;
-	delete mOutputStackInfoMenu;
-	delete mOutputHeapInfoMenu;
-	delete mOutputGenInfoMenu; 
-	delete mOutputMenu;
-}
-
-void MemSpyView::initialize(const QVariantMap& params)
-{
-	Q_UNUSED(params);
-	QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical, this);
-	
-	if (isBreadCrumbVisible()) {
-		mBreadCrumb = new HbLabel(this);
-		mBreadCrumb->setTextWrapping(Hb::TextWordWrap);
-		mBreadCrumb->setElideMode(Qt::ElideLeft);
-		mBreadCrumb->setPlainText(getBreadCrumbText());
-		HbFontSpec spec(HbFontSpec::PrimarySmall);
-		mBreadCrumb->setFontSpec(spec);
-		layout->addItem(mBreadCrumb);
-	}
-	layout->addItem(createCentralWidget());
-	setLayout(layout); 
-	
-	if (isRefreshable())
-		menu()->addAction(tr("Refresh"), this, SLOT(refresh()));
-	
-	HbMenu* toolMenu = createToolMenu();
-	if (toolMenu)
-		menu()->addMenu(toolMenu);
-	
-	menu()->addAction(tr("Settings ..."), this, SLOT(showSettings()));
-	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;
-}
-
-bool MemSpyView::isBreadCrumbVisible() const
-{
-    return false;
-}
-
-QString MemSpyView::getBreadCrumbText() const
-{
-	QStringList views;
-	for (int i=1; i<mainWindow()->views().count() - 1; i++)	{
-		const HbView *view = mainWindow()->views().at(i);
-		if (view == this)
-			break;
-		views.append(view->title());
-	}
-	views.append(title());
-	
-	return views.join(" > ");
-}
-
-void MemSpyView::refresh()
-{
-	// Empty default implementation
-}
-
-void MemSpyView::showSettings()
-{
-	MemSpySettingsView* settings = new MemSpySettingsView(mEngine);
-	connect(settings, SIGNAL(finished(bool)), this, SLOT(closeSettings()));
-	mainWindow()->addView(settings);
-	mainWindow()->setCurrentView(settings);
-}
-
-void MemSpyView::showAbout()
-{
-	HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
-	messageBox->setText("Version 2.1.0 - 15th June 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();
-}
-
-void MemSpyView::closeSettings()
-{
-	sender()->deleteLater();
-	mainWindow()->setCurrentView(this);
-}
--- a/memspyui/ui/hb/src/viewmanager.cpp	Tue Aug 31 15:15:20 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:
- *  
- */
-
-#include <HbMainWindow>
-#include <HbAction>
-#include <HbMessageBox>
-#include <HbLabel>
-
-#include "viewmanager.h"
-
-#include "enginewrapper.h"
-#include "memspyview.h"
-#include "memspymainview.h"
-#include "memspyprocessview.h"
-#include "memspythreadview.h"
-#include "memspythreaddetailindexview.h"
-#include "memspythreaddetailview.h"
-#include "memspykernelobjecttypeview.h"
-#include "memspykernelobjectview.h"
-#include "memspykernelobjectdetailview.h"
-#include "memspytrackingview.h"
-#include "memspyswmtview.h"
-#include "memspyheapdumpsview.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<MemSpyThreadDetailIndexView>,
-	&factory<MemSpyThreadDetailView>,
-	&factory<MemSpyKernelObjectTypeView>,
-	&factory<MemSpyKernelObjectView>,
-	&factory<MemSpyKernelObjectDetailView>,
-	&factory<MemSpyTrackingView>,
-	&factory<MemSpySwmtView>,
-	&factory<MemSpyHeapDumpsView>
-};
-
-
-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;
-    try {
-        view = sFactories[viewIndex](mEngine, *this);
-        view->initialize(params);
-    }
-    catch (std::exception& ex)
-    {
-        // show message box with exception
-        // TODO: qt_symbian_exception2Error shouldn't probably be here
-        QString error = tr("An error occured during the operation. Error code: %1").arg(
-                qt_symbian_exception2Error(ex));
-        
-        HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeWarning);
-        messageBox->setText(error);
-        HbLabel *header = new HbLabel(tr("Error"), messageBox);
-        messageBox->setHeadingWidget(header);
-        messageBox->setAttribute(Qt::WA_DeleteOnClose);
-        messageBox->setTimeout(HbPopup::StandardTimeout);
-        messageBox->open();
-        
-        delete view;
-        return;
-    }
-    
-	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/inc/perfmon.hrh	Tue Aug 31 15:15:20 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 PERFMON_HRH
-#define PERFMON_HRH
-
-enum TPerfMonCommandIds
-    {
-    EPerfMonCmdEnableLogging = 1,
-    EPerfMonCmdDisableLogging,
-    EPerfMonCmdSettings,
-    EPerfMonCmdAbout,
-
-    EPerfMonCmdSettingsChange,
-    EPerfMonCmdSettingsExit,
-    EPerfMonCmdSettingsBack,
-    
-    EPerfMonSettingItemList = 1000
-    };
-
-enum TPerfMonMainViewTabs
-    {
-    ETabMainViewValues = 1,
-    ETabMainViewGraphs    
-    };
-               
-enum TPerfMonSettingListTabs
-    {
-    ETabSettingsGeneral = 0,
-    ETabSettingsDataPopup,    
-    ETabSettingsGraphs,    
-    ETabSettingsLogging    
-    };
-    
-enum TPerfMonSettingListIds
-    {
-    ESettingListItemHeartBeat = 0,
-    ESettingListItemMaxSamples,
-    ESettingListItemPriority,
-    ESettingListItemCPUMode,
-    ESettingListItemKeepBackLightOn,
-
-    ESettingListItemDataPopupVisbility,
-    ESettingListItemDataPopupLocation,
-    ESettingListItemDataPopupSources,
-
-    ESettingListItemGraphsVerticalBarPeriod,
-    ESettingListItemGraphsSources,
-
-    ESettingListItemLoggingMode,
-    ESettingListItemLoggingFilePath,
-    ESettingListItemLoggingSources
-    };
-
-enum TPerfMonSettingThreadPriorityTypes
-    {
-    EThreadPriorityTypeMuchLess = 0,    
-    EThreadPriorityTypeLess,    
-    EThreadPriorityTypeNormal,    
-    EThreadPriorityTypeMore,    
-    EThreadPriorityTypeMuchMore,    
-    EThreadPriorityTypeRealTime,    
-    EThreadPriorityTypeAbsoluteVeryLow,    
-    EThreadPriorityTypeAbsoluteLow,    
-    EThreadPriorityTypeAbsoluteBackground,    
-    EThreadPriorityTypeAbsoluteForeground,    
-    EThreadPriorityTypeAbsoluteHigh
-    };
-
-enum TPerfMonSettingCPUModes
-    {
-    ECPUModeNotSet = -1,
-    ECPUModeCPUTime,
-    ECPUModeNOPs
-    };
-
-enum TPerfMonSettingDataPopupVisbilities
-    {
-    EDataPopupVisbilityAlwaysOn = 0,
-    EDataPopupVisbilityBackgroundOnly,
-    EDataPopupVisbilityAlwaysAlwaysOff
-    };
-
-enum TPerfMonSettingDataPopupLocations
-    {
-    EDataPopupLocationTopRight = 0,
-    EDataPopupLocationBottomMiddle
-    };
-        
-enum TPerfMonSettingSources
-    {
-    ESourceCPU = 0,
-    ESourceRAM,
-    ESourceC,
-    ESourceD,
-    ESourceE,
-    ESourceF,
-    ESourceG,
-    ESourceH,
-    ESourceI,
-    ESourcesLength // this should be always the last!
-    };
-    
-enum TPerfMonSettingLoggingMode
-    {
-    ELoggingModeRDebug = 0,
-    ELoggingModeLogFile,
-    ELoggingModeRDebugLogFile
-    };
-
-#endif      // PERFMON_HRH
--- a/perfmon/engine/inc/perfmon_engine.h	Tue Aug 31 15:15:20 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:  
-*
-*/
-
-
-#ifndef PERFMON_ENGINE_H
-#define PERFMON_ENGINE_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <apgcli.h>
-#include <gdi.h>
-
-#include "perfmon.hrh"
-
-
-// setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
-const TUid KPMSettingHeartBeat                              = { 0x00 };
-const TUid KPMSettingMaxSamples                             = { 0x01 };
-const TUid KPMSettingPriority                               = { 0x02 };
-const TUid KPMSettingCPUMode                                = { 0x03 };
-const TUid KPMSettingKeepBackLightOn                        = { 0x04 };
-
-const TUid KPMSettingDataPopupVisbility                     = { 0x05 };
-const TUid KPMSettingDataPopupLocation                      = { 0x06 };
-const TUid KPMSettingDataPopupSources                       = { 0x07 };
-
-const TUid KPMSettingGraphsVerticalBarPeriod                = { 0x08 };
-const TUid KPMSettingGraphsSources                          = { 0x09 };
-
-const TUid KPMSettingLoggingMode                            = { 0x0A };
-const TUid KPMSettingLoggingFilePath                        = { 0x0B };
-const TUid KPMSettingLoggingSources                         = { 0x0C };
-
-// FORWARD DECLARATIONS
-class CPerfMonValuesContainer;
-class CPerfMonGraphsContainer;
-class CPerfMonDataPopupContainer;
-class CEikonEnv;
-class CCoeControl;
-class CDictionaryFileStore;
-
-
-// CLASS DECLARATIONS
-
-
-class TPerfMonSources
-    {
-public:
-    TBool iSrcEnabled[ESourcesLength];
-
-public:
-    inline void SetDefaults1()
-        {
-        iSrcEnabled[ESourceCPU] = ETrue;
-        iSrcEnabled[ESourceRAM] = ETrue;
-        iSrcEnabled[ESourceC]   = ETrue;
-        iSrcEnabled[ESourceD]   = EFalse;
-        iSrcEnabled[ESourceE]   = EFalse;
-        iSrcEnabled[ESourceF]   = EFalse;
-        iSrcEnabled[ESourceG]   = EFalse;
-        iSrcEnabled[ESourceH]   = EFalse;
-        iSrcEnabled[ESourceI]   = EFalse;        
-        }
-    inline void SetDefaults2()
-        {
-        iSrcEnabled[ESourceCPU] = ETrue;
-        iSrcEnabled[ESourceRAM] = ETrue;
-        iSrcEnabled[ESourceC]   = EFalse;
-        iSrcEnabled[ESourceD]   = EFalse;
-        iSrcEnabled[ESourceE]   = EFalse;
-        iSrcEnabled[ESourceF]   = EFalse;
-        iSrcEnabled[ESourceG]   = EFalse;
-        iSrcEnabled[ESourceH]   = EFalse;
-        iSrcEnabled[ESourceI]   = EFalse;        
-        }
-    TInt EnabledSourcesCount()
-        {
-        TInt srcCount(0);
-        
-        for (TInt i=0; i<ESourcesLength; i++)
-            {
-            if (iSrcEnabled[i])
-                srcCount++;
-            }
-        
-        return srcCount;
-        }
-    };
-    
-
-class TPerfMonSettings
-    {
-public:
-    TInt                iHeartBeat;
-    TInt                iMaxSamples;
-    TInt                iPriority;
-    TInt                iCPUMode;
-    TBool               iKeepBacklightOn;
-
-    TInt                iDataPopupVisibility;
-    TInt                iDataPopupLocation;
-    TPerfMonSources     iDataPopupSources;
-
-    TInt                iGraphsVerticalBarPeriod;
-    TPerfMonSources     iGraphsSources;
-
-    TInt                iLoggingMode;
-    TFileName           iLoggingFilePath;
-    TPerfMonSources     iLoggingSources;
-    
-    TBool               iLoggingEnabled;
-    };
-
-
-class TSampleData
-	{
-public:
-    TInt64                          iFree;
-    TInt64                          iSize;
-    TTimeIntervalMicroSeconds       iTimeFromStart;
-	}; 
-
-typedef CArrayFixSeg<TSampleData> CSampleDataArray;
-
-
-class TSampleEntry
-	{
-public:
-    TBuf<16>            iDescription;
-    TBuf<16>            iUnitTypeShort; //eg. b
-    TBuf<16>            iUnitTypeLong;  //eg. bytes
-    TInt                iDriveNumber;   //used only for disk drives
-    TRgb                iGraphColor;
-    CSampleDataArray*   iSampleDataArray;
-	}; 
-	
-typedef CArrayFixSeg<TSampleEntry> CSampleEntryArray;
-
-
-
-class CPerfMonEngine : public CActive
-	{
-public:
-	~CPerfMonEngine();
-	void ActivateEngineL();
-	void DeActivateEngineL();
-    void EnableLogging(TBool aEnable);
-
-private:
-	void RunL();
-	void DoCancel();
-
-protected:
-	CPerfMonEngine();
-	void ConstructL();
-    void LoadSettingsL();
-    void SaveSettingsL();
-    void OpenLogFile(TBool aOpen);
-    void CreateSamplesDataArrayL();
-    void UpdateSamplesDataL();
-    void AppendLatestSamplesToLogsL();
-    void ActivateCPUMonitoringL();
-    TBool OpenHandleToNullThread();
-    void DeActivateCPUMonitoring();
-    TBool CPUTimeSupported();
-    TThreadPriority SettingItemToThreadPriority(TInt aIndex);
-    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue);
-    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue);
-    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TPerfMonSources& aValue);
-    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue);
-    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue);
-    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TPerfMonSources& aValue);
-    
-protected:
-    virtual void SendDrawEventToContainersL() = 0;
-    virtual void HandleSettingsChangeL();
-    
-public:
-    inline TPerfMonSettings& Settings() { return iSettings; }
-    inline CEikonEnv* EikonEnv() { return iEnv; }
-    inline RApaLsSession& LsSession() { return iLs; }
-
-    inline CSampleEntryArray* SampleEntryArray() { return iSampleEntryArray; } 
-
-protected:
-    RTimer                          iTimer;
-    CEikonEnv*                      iEnv;
-    TPerfMonSettings                iSettings;
-    RApaLsSession                   iLs;
-    CSampleEntryArray*              iSampleEntryArray;
-    TTime                           iStartTime;
-
-    TInt                            iCurrentCPUMode;
-
-    RThread                         iNullThread;
-    RThread                         iCPULoadThread;
-	TBool                           iCPULoadCalibrating;
-	TInt                            iCPULoadCalibrationCounter;
-	TInt64                          iCPULoadMaxValue;
-	TInt64                          iCPULoadPreviousValue;    
-	TInt64                          iCPULoadCounter;
-    TTime                           iPreviousTime;
-    
-    TBool                           iLogFileInitialized;
-    RFile                           iLogFile;
-    };
- 
-
-#endif
--- a/perfmon/engine/src/perfmon_engine.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,925 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this 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 "perfmon_engine.h"
-#include <coeutils.h>
-#include <bautils.h>
-#include <eikenv.h>
-#include <e32hal.h>
-#include <u32std.h>
-#include <s32file.h>
-#include <akntitle.h> 
-#include <eikspane.h>
-#include <aknnotewrappers.h>  
-_LIT(KDefaultLogFilePath, "c:\\data\\PerfMon.log");
-
-const TInt KCalibrationLength = 2;
-const TInt KMinimumSamplesLength = 16;
-const TInt KCPUTimeMultiplier = 1000000; // used to avoid TReal conversions
-
-const TInt KSettingsDrive = EDriveC;
-_LIT(KSettingsFileName, "perfmon_settings.ini");
-
-// --------------------------------------------------------------------------------------------
-
-TInt CPULoadCount(TAny* aInt)
-    {
-    // increase the counter
-    (*(TUint*) aInt)++;
-    return 1;
-    }
-
-TInt CPULoadNOPThread(TAny* aParam)
-    {
-    CTrapCleanup* pC = CTrapCleanup::New();
-    CActiveScheduler* pS = new CActiveScheduler;
-    CActiveScheduler::Install(pS);
-
-    CIdle* idle = CIdle::NewL(CActive::EPriorityLow);
-    TCallBack cb(CPULoadCount, aParam);
-    idle->Start(cb);
-
-    pS->Start();
-
-    delete idle;
-    delete pS;
-    delete pC;
-
-    return 0;
-    }
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CPerfMonEngine::CPerfMonEngine() :
-    CActive(EPriorityUserInput)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::ConstructL()
-    {
-    iCurrentCPUMode = ECPUModeNotSet;
-    iLogFileInitialized = EFalse;
-
-    iEnv = CEikonEnv::Static();
-    User::LeaveIfError(iLs.Connect());
-
-    User::LeaveIfError(iTimer.CreateLocal());
-    CActiveScheduler::Add(this);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::ActivateEngineL()
-    {
-    // load settings
-    TRAP_IGNORE(LoadSettingsL());
-
-    // create data storages for the samples
-    CreateSamplesDataArrayL();
-
-    // set default modes
-    HandleSettingsChangeL();
-
-    // start sampling data immediately (jump to RunL)    
-    iTimer.After(iStatus, 100);
-    SetActive();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::DeActivateEngineL()
-    {
-    Cancel();
-
-    DeActivateCPUMonitoring();
-
-    // close log file
-    OpenLogFile(EFalse);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPerfMonEngine::~CPerfMonEngine()
-    {
-    iTimer.Close();
-
-    // clear data storages
-    if (iSampleEntryArray)
-        {
-        for (TInt i = 0; i < iSampleEntryArray->Count(); i++)
-            {
-            delete iSampleEntryArray->At(i).iSampleDataArray;
-            }
-
-        delete iSampleEntryArray;
-        }
-
-    iLs.Close();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::DoCancel()
-    {
-    iTimer.Cancel();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::RunL()
-    {
-    // calculate new values 
-    UpdateSamplesDataL();
-
-    // log changes
-    AppendLatestSamplesToLogsL();
-
-    // redraw views
-    SendDrawEventToContainersL();
-
-    // continue
-    iTimer.After(iStatus, iSettings.iHeartBeat * 1000); // convert from milliseconds to microseconds
-    SetActive();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::HandleSettingsChangeL()
-    {
-    // set priority of the thread
-    RThread().SetPriority(SettingItemToThreadPriority(iSettings.iPriority));
-
-    // init cpu monitor if setting has been changed
-    if (iCurrentCPUMode != iSettings.iCPUMode)
-        {
-        DeActivateCPUMonitoring();
-        ActivateCPUMonitoringL();
-        }
-
-    // close log file
-    OpenLogFile(EFalse);
-
-    // enable log file
-    if (iSettings.iLoggingEnabled && (iSettings.iLoggingMode
-            == ELoggingModeLogFile || iSettings.iLoggingMode
-            == ELoggingModeRDebugLogFile))
-        OpenLogFile(ETrue);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::EnableLogging(TBool aEnable)
-    {
-    if (aEnable)
-        {
-        if (iSettings.iLoggingMode == ELoggingModeLogFile
-                || iSettings.iLoggingMode == ELoggingModeRDebugLogFile)
-            OpenLogFile(ETrue);
-
-        iSettings.iLoggingEnabled = ETrue;
-        }
-    else // disable
-        {
-        iSettings.iLoggingEnabled = EFalse;
-        OpenLogFile(EFalse);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::OpenLogFile(TBool aOpen)
-    {
-    // open log file for writing
-    if (aOpen)
-        {
-        if (!iLogFileInitialized)
-            {
-            TInt err(KErrNone);
-
-            // open the log file for writing
-            if (iLogFile.Open(iEnv->FsSession(), iSettings.iLoggingFilePath,
-                    EFileWrite) != KErrNone)
-                {
-                iEnv->FsSession().MkDirAll(iSettings.iLoggingFilePath);
-                err = iLogFile.Replace(iEnv->FsSession(),
-                        iSettings.iLoggingFilePath, EFileWrite);
-                }
-            else
-                {
-                // file opens correctly, seek to the end
-                TInt fileSize = 0;
-                iLogFile.Size(fileSize);
-                err = iLogFile.Seek(ESeekCurrent, fileSize);
-                }
-
-            if (err == KErrNone)
-                {
-                iLogFileInitialized = ETrue;
-                }
-            else
-                {
-                // show error
-                CAknErrorNote* note = new (ELeave) CAknErrorNote();
-                note->ExecuteLD(_L("Unable to create log file, check settings"));
-                }
-            }
-        }
-
-    // close handle to log file
-    else
-        {
-        if (iLogFileInitialized)
-            {
-            iLogFile.Flush();
-            iLogFile.Close();
-
-            iLogFileInitialized = EFalse;
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::ActivateCPUMonitoringL()
-    {
-    // reset counter variables
-    iCPULoadCalibrating = ETrue;
-    iCPULoadCalibrationCounter = 0;
-    iCPULoadMaxValue = 999999999;
-    iCPULoadPreviousValue = 1;
-    iCPULoadCounter = 0;
-
-    // use null thread is cpu time is supported and the setting is on
-    if (CPUTimeSupported() && iSettings.iCPUMode == ECPUModeCPUTime)
-        {
-        // try to open handle to null thread
-        if (OpenHandleToNullThread())
-            {
-            // handle is open, get initial value
-            TTimeIntervalMicroSeconds time;
-            iNullThread.GetCpuTime(time);
-            iCPULoadPreviousValue = time.Int64();
-            iPreviousTime.HomeTime();
-
-            iCurrentCPUMode = ECPUModeCPUTime;
-            return; // cpu time is succesfully in use           
-            }
-        }
-
-    // otherwise use normal sampling with nops    
-    iCurrentCPUMode = ECPUModeNotSet;
-
-    // show a warning if cpu time cannot be taken in use
-    if (iSettings.iCPUMode == ECPUModeCPUTime)
-        {
-        CAknInformationNote* note = new (ELeave) CAknInformationNote();
-        note->ExecuteLD(
-                _L("CPU Time not supported in this system, using NOPs sampling"));
-        }
-
-    // create a thread for CPU load monitoring
-    User::LeaveIfError(iCPULoadThread.Create(_L("PerfMonCPULoad"),
-            CPULoadNOPThread, 0x1000, 0x1000, 0x100000, &iCPULoadCounter));
-    iCPULoadThread.SetPriority(EPriorityAbsoluteVeryLow);
-    iCPULoadThread.Resume();
-
-    iCurrentCPUMode = ECPUModeNOPs; // NOPs taken succesfully in use
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CPerfMonEngine::OpenHandleToNullThread()
-    {
-    // find the kernel process and then the null thread
-    TFindProcess fp(_L("ekern.exe*"));
-
-    TFullName kernelName;
-    if (fp.Next(kernelName) == KErrNone)
-        {
-        // process found, append null thread identifier
-        kernelName.Append(_L("::Null"));
-
-        // find the thread
-        TFindThread ft(kernelName);
-
-        TFullName threadName;
-        if (ft.Next(threadName) == KErrNone)
-            {
-            // open instance to the thread
-            if (iNullThread.Open(threadName) != KErrNone)
-                return EFalse;
-            }
-        }
-
-    // process not found
-    else
-        return EFalse;
-
-    // success!
-    return ETrue;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::DeActivateCPUMonitoring()
-    {
-    if (iCurrentCPUMode == ECPUModeCPUTime)
-        {
-        iNullThread.Close();
-        }
-
-    else if (iCurrentCPUMode == ECPUModeNOPs)
-        {
-        // kill the cpu load thread
-        iCPULoadThread.Kill(0);
-        iCPULoadThread.Close();
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TBool CPerfMonEngine::CPUTimeSupported()
-    {
-    TTimeIntervalMicroSeconds time;
-    TInt err = RThread().GetCpuTime(time);
-
-    if (err == KErrNone && time.Int64() > 0)
-        return ETrue;
-    else
-        return EFalse;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TThreadPriority CPerfMonEngine::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 CPerfMonEngine::CreateSamplesDataArrayL()
-    {
-    TInt
-            maxSamples =
-                    iSettings.iMaxSamples >= KMinimumSamplesLength ? iSettings.iMaxSamples
-                            : KMinimumSamplesLength;
-
-    // create the data structure to store all samples
-    iSampleEntryArray = new (ELeave) CSampleEntryArray(16);
-
-    // add all source entries
-    for (TInt i = 0; i < ESourcesLength; i++)
-        {
-        TSampleEntry newSampleEntry;
-
-        if (i == ESourceCPU)
-            {
-            newSampleEntry.iDescription.Copy(_L("CPU"));
-            newSampleEntry.iUnitTypeShort.Copy(KNullDesC);
-            newSampleEntry.iUnitTypeLong.Copy(KNullDesC);
-            newSampleEntry.iDriveNumber = -1;
-            newSampleEntry.iGraphColor = KRgbYellow;
-            }
-
-        else if (i == ESourceRAM)
-            {
-            newSampleEntry.iDescription.Copy(_L("RAM"));
-            newSampleEntry.iUnitTypeShort.Copy(_L("b"));
-            newSampleEntry.iUnitTypeLong.Copy(_L("bytes"));
-            newSampleEntry.iDriveNumber = -1;
-            newSampleEntry.iGraphColor = KRgbGreen;
-            }
-
-        else //drives
-            {
-            TChar driveLetter = 'C' + i - ESourceC; // C is the first drive
-
-            newSampleEntry.iDescription.Append(driveLetter);
-            newSampleEntry.iDescription.Append(_L(":"));
-            newSampleEntry.iUnitTypeShort.Copy(_L("b"));
-            newSampleEntry.iUnitTypeLong.Copy(_L("bytes"));
-
-            iEnv->FsSession().CharToDrive(driveLetter,
-                    newSampleEntry.iDriveNumber);
-
-            newSampleEntry.iGraphColor = KRgbCyan;
-            newSampleEntry.iGraphColor.SetGreen(255 - (i - ESourceC) * 30);
-            newSampleEntry.iGraphColor.SetRed(i * 30);
-            }
-
-        newSampleEntry.iSampleDataArray = new (ELeave) CSampleDataArray(
-                maxSamples);
-
-        iSampleEntryArray->AppendL(newSampleEntry);
-        }
-
-    // save current time as start time
-    iStartTime.HomeTime();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::UpdateSamplesDataL()
-    {
-    // reset inactivity timers
-    if (iSettings.iKeepBacklightOn)
-        User::ResetInactivityTime();
-
-    // get current time
-    TTime currentTime;
-    currentTime.HomeTime();
-
-    // calculate time difference
-    TTimeIntervalMicroSeconds timeDeltaFromPreviousSample =
-            currentTime.MicroSecondsFrom(iPreviousTime);
-
-    // remember current time as previous
-    iPreviousTime = currentTime;
-
-    // get CPU
-    TInt64 cpuLoadDelta(0);
-    TInt64 cpuLoadFree(0);
-    TInt64 cpuLoadSize(0);
-    TInt64 currentCPUValue(0);
-
-    if (iCurrentCPUMode == ECPUModeCPUTime || iCurrentCPUMode == ECPUModeNOPs)
-        {
-        if (iCurrentCPUMode == ECPUModeCPUTime)
-            {
-            TTimeIntervalMicroSeconds time;
-            iNullThread.GetCpuTime(time);
-            currentCPUValue = time.Int64();
-            }
-        else if (iCurrentCPUMode == ECPUModeNOPs)
-            {
-            currentCPUValue = iCPULoadCounter;
-            }
-
-        // get delta and store the previous value
-        cpuLoadDelta = currentCPUValue - iCPULoadPreviousValue;
-        iCPULoadPreviousValue = currentCPUValue;
-
-        // velocity = distance / time
-        cpuLoadFree = cpuLoadDelta * KCPUTimeMultiplier
-                / timeDeltaFromPreviousSample.Int64();
-
-        // detect maximum value
-        if (cpuLoadFree > iCPULoadMaxValue)
-            iCPULoadMaxValue = cpuLoadFree;
-
-        // check calibration status      
-        if (iCPULoadCalibrating)
-            {
-            iCPULoadCalibrationCounter++;
-            cpuLoadSize = cpuLoadFree;
-
-            // check if need to calibrate anymore
-            if (iCPULoadCalibrationCounter > KCalibrationLength)
-                {
-                iCPULoadCalibrating = EFalse;
-
-                // from the samples, get the minimum value, and let it be the max value 
-                for (TInt i = 0; i
-                        < iSampleEntryArray->At(0).iSampleDataArray->Count(); i++)
-                    {
-                    TInt64 newCPULoadMaxValue = iCPULoadMaxValue;
-
-                    if (iSampleEntryArray->At(0).iSampleDataArray->At(i).iFree
-                            < newCPULoadMaxValue)
-                        {
-                        newCPULoadMaxValue
-                                = iSampleEntryArray->At(0).iSampleDataArray->At(
-                                        i).iFree;
-                        }
-
-                    iCPULoadMaxValue = newCPULoadMaxValue;
-                    }
-
-                // adjust priority of the poller thread
-                if (iCurrentCPUMode == ECPUModeNOPs)
-                    {
-                    iCPULoadThread.SetPriority(EPriorityAbsoluteVeryLow);
-                    }
-                }
-
-            }
-        else
-            {
-            cpuLoadSize = iCPULoadMaxValue;
-            }
-        }
-
-    // save cpu sample data    
-    TSampleData cpuSample;
-    cpuSample.iFree = cpuLoadFree;
-    cpuSample.iSize = cpuLoadSize;
-    cpuSample.iTimeFromStart = currentTime.MicroSecondsFrom(iStartTime);
-
-    iSampleEntryArray->At(0).iSampleDataArray->InsertL(0, cpuSample);
-
-    // get ram memory
-    TMemoryInfoV1Buf ramMemory;
-    UserHal::MemoryInfo(ramMemory);
-
-    TSampleData memorySample;
-    memorySample.iFree = ramMemory().iFreeRamInBytes;
-    memorySample.iSize = ramMemory().iMaxFreeRamInBytes;
-    memorySample.iTimeFromStart = currentTime.MicroSecondsFrom(iStartTime);
-
-    iSampleEntryArray->At(1).iSampleDataArray->InsertL(0, memorySample);
-
-    // all drives
-    for (TInt i = 2; i < iSampleEntryArray->Count(); i++)
-        {
-        TSampleData driveSample;
-
-        // get volume info from RFs
-        TVolumeInfo volumeInfo;
-        if (iEnv->FsSession().Volume(volumeInfo,
-                iSampleEntryArray->At(i).iDriveNumber) == KErrNone)
-            {
-            driveSample.iFree = volumeInfo.iFree;
-            driveSample.iSize = volumeInfo.iSize;
-            }
-        else
-            {
-            driveSample.iFree = 0;
-            driveSample.iSize = 0;
-            }
-
-        driveSample.iTimeFromStart = currentTime.MicroSecondsFrom(iStartTime);
-
-        iSampleEntryArray->At(i).iSampleDataArray->InsertL(0, driveSample);
-        }
-
-    // compress sample data arrays to save memory
-    TInt curLength(iSampleEntryArray->At(0).iSampleDataArray->Count());
-
-    TInt
-            maxSamples =
-                    iSettings.iMaxSamples >= KMinimumSamplesLength ? iSettings.iMaxSamples
-                            : KMinimumSamplesLength;
-
-    if (curLength > maxSamples && curLength % 5 == 0)
-        {
-        for (TInt i = 0; i < iSampleEntryArray->Count(); i++)
-            {
-            iSampleEntryArray->At(i).iSampleDataArray->ResizeL(maxSamples); // looses old samples
-            iSampleEntryArray->At(i).iSampleDataArray->Compress();
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::AppendLatestSamplesToLogsL()
-    {
-    if (iSettings.iLoggingEnabled && SampleEntryArray())
-        {
-        // loop all sources
-        for (TInt i = 0; i < SampleEntryArray()->Count(); i++)
-            {
-            // check if this setting has been enabled and it has some data
-            if (iSettings.iLoggingSources.iSrcEnabled[i]
-                    && SampleEntryArray()->At(i).iSampleDataArray->Count() > 0)
-                {
-                // get current sample
-                TSampleData& currentSample =
-                        SampleEntryArray()->At(i).iSampleDataArray->At(0);
-
-                TBuf<128> buf;
-                buf.Append(_L("PERFMON;"));
-                buf.Append(SampleEntryArray()->At(i).iDescription);
-                buf.Append(_L(";"));
-                buf.AppendNum(currentSample.iTimeFromStart.Int64());
-                buf.Append(_L(";"));
-                buf.AppendNum(currentSample.iFree);
-                buf.Append(_L(";"));
-                buf.AppendNum(currentSample.iSize);
-
-                // print to RDebug
-                if (iSettings.iLoggingMode == ELoggingModeRDebug
-                        || iSettings.iLoggingMode == ELoggingModeRDebugLogFile)
-                    {
-                    RDebug::Print(buf);
-                    }
-
-                // print to log file
-                if (iSettings.iLoggingMode == ELoggingModeLogFile
-                        || iSettings.iLoggingMode == ELoggingModeRDebugLogFile)
-                    {
-                    buf.Append(_L("\r\n"));
-
-                    TBuf8<128> buf8;
-                    buf8.Copy(buf);
-
-                    iLogFile.Write(buf8);
-                    }
-                }
-            }
-        }
-    }
-
-void CPerfMonEngine::LoadSettingsL()
-    {
-    // set defaults
-    iSettings.iHeartBeat = 600;
-    iSettings.iMaxSamples = 64;
-    iSettings.iPriority = EThreadPriorityTypeNormal;
-    iSettings.iCPUMode = ECPUModeCPUTime;
-    iSettings.iKeepBacklightOn = ETrue;
-
-    iSettings.iDataPopupVisibility = EDataPopupVisbilityAlwaysOn;
-    // TODO: remove the next line once data popup is working
-    iSettings.iDataPopupVisibility = EDataPopupVisbilityAlwaysAlwaysOff;
-    iSettings.iDataPopupLocation = EDataPopupLocationTopRight;
-    iSettings.iDataPopupSources.SetDefaults1();
-
-    iSettings.iGraphsVerticalBarPeriod = 5;
-    iSettings.iGraphsSources.SetDefaults2();
-
-    iSettings.iLoggingMode = ELoggingModeRDebug;
-    iSettings.iLoggingFilePath.Copy(KDefaultLogFilePath);
-    iSettings.iLoggingSources.SetDefaults2();
-
-    iSettings.iLoggingEnabled = EFalse;
-
-    // make sure that the private path of this app in c-drive exists
-    iEnv->FsSession().CreatePrivatePath(KSettingsDrive); // c:\\private\\20011385\\
-    
-    // handle settings always in the private directory 
-    if (iEnv->FsSession().SetSessionToPrivate(KSettingsDrive) == KErrNone)
-        {
-        const TUid KUidPerfMon =
-            {
-            0x20011385
-            };
-        // open or create a dictionary file store
-        CDictionaryFileStore* settingsStore = CDictionaryFileStore::OpenLC(
-                iEnv->FsSession(), KSettingsFileName, KUidPerfMon);
-
-        LoadDFSValueL(settingsStore, KPMSettingHeartBeat, iSettings.iHeartBeat);
-        LoadDFSValueL(settingsStore, KPMSettingMaxSamples,
-                iSettings.iMaxSamples);
-        LoadDFSValueL(settingsStore, KPMSettingPriority, iSettings.iPriority);
-        
-        LoadDFSValueL(settingsStore, KPMSettingCPUMode, iSettings.iCPUMode);
-        
-        LoadDFSValueL(settingsStore, KPMSettingKeepBackLightOn,
-                iSettings.iKeepBacklightOn);
-
-        LoadDFSValueL(settingsStore, KPMSettingDataPopupVisbility,
-                iSettings.iDataPopupVisibility);
-        LoadDFSValueL(settingsStore, KPMSettingDataPopupLocation,
-                iSettings.iDataPopupLocation);
-        LoadDFSValueL(settingsStore, KPMSettingDataPopupSources,
-                iSettings.iDataPopupSources);
-
-        LoadDFSValueL(settingsStore, KPMSettingGraphsVerticalBarPeriod,
-                iSettings.iGraphsVerticalBarPeriod);
-        LoadDFSValueL(settingsStore, KPMSettingGraphsSources,
-                iSettings.iGraphsSources);
-
-        LoadDFSValueL(settingsStore, KPMSettingLoggingMode,
-                iSettings.iLoggingMode);
-        LoadDFSValueL(settingsStore, KPMSettingLoggingFilePath,
-                iSettings.iLoggingFilePath);
-        LoadDFSValueL(settingsStore, KPMSettingLoggingSources,
-                iSettings.iLoggingSources);
-
-        CleanupStack::PopAndDestroy(); // settingsStore         
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonEngine::SaveSettingsL()
-    {
-    // handle settings always in c:\\private\\20011385\\
-    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);
-            }
-
-        const TUid KUidPerfMon =
-            {
-            0x20011385
-            };
-        // create a dictionary file store
-        CDictionaryFileStore* settingsStore = CDictionaryFileStore::OpenLC(
-                iEnv->FsSession(), KSettingsFileName, KUidPerfMon);
-
-        SaveDFSValueL(settingsStore, KPMSettingHeartBeat, iSettings.iHeartBeat);
-        SaveDFSValueL(settingsStore, KPMSettingMaxSamples,
-                iSettings.iMaxSamples);
-        SaveDFSValueL(settingsStore, KPMSettingPriority, iSettings.iPriority);
-        SaveDFSValueL(settingsStore, KPMSettingCPUMode, iSettings.iCPUMode);
-        SaveDFSValueL(settingsStore, KPMSettingKeepBackLightOn,
-                iSettings.iKeepBacklightOn);
-
-        SaveDFSValueL(settingsStore, KPMSettingDataPopupVisbility,
-                iSettings.iDataPopupVisibility);
-        SaveDFSValueL(settingsStore, KPMSettingDataPopupLocation,
-                iSettings.iDataPopupLocation);
-        SaveDFSValueL(settingsStore, KPMSettingDataPopupSources,
-                iSettings.iDataPopupSources);
-
-        SaveDFSValueL(settingsStore, KPMSettingGraphsVerticalBarPeriod,
-                iSettings.iGraphsVerticalBarPeriod);
-        SaveDFSValueL(settingsStore, KPMSettingGraphsSources,
-                iSettings.iGraphsSources);
-
-        SaveDFSValueL(settingsStore, KPMSettingLoggingMode,
-                iSettings.iLoggingMode);
-        SaveDFSValueL(settingsStore, KPMSettingLoggingFilePath,
-                iSettings.iLoggingFilePath);
-        SaveDFSValueL(settingsStore, KPMSettingLoggingSources,
-                iSettings.iLoggingSources);
-
-        settingsStore->CommitL();
-        CleanupStack::PopAndDestroy(); // settingsStore             
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CPerfMonEngine::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 CPerfMonEngine::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 CPerfMonEngine::LoadDFSValueL(CDictionaryFileStore* aDicFS,
-        const TUid& aUid, TPerfMonSources& aValue)
-    {
-    if (aDicFS->IsPresentL(aUid))
-        {
-        RDictionaryReadStream in;
-        in.OpenLC(*aDicFS, aUid);
-        TInt bufLength = in.ReadInt16L(); // get length of the array
-
-        if (bufLength < 0 || bufLength > ESourcesLength) // check for validaty
-            User::Leave(KErrNotSupported);
-
-        for (TInt i = 0; i < bufLength; i++) // get all items
-            aValue.iSrcEnabled[i] = in.ReadInt16L();
-
-        CleanupStack::PopAndDestroy(); // in
-        }
-    }
-
-// ---------------------------------------------------------------------------
-
-void CPerfMonEngine::SaveDFSValueL(CDictionaryFileStore* aDicFS,
-        const TUid& aUid, const TInt& aValue)
-    {
-    RDictionaryWriteStream out;
-    out.AssignLC(*aDicFS, aUid);
-    out.WriteInt16L(aValue);
-    out.CommitL();
-    CleanupStack::PopAndDestroy(); // out
-    }
-
-// ---------------------------------------------------------------------------
-
-void CPerfMonEngine::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(); // out
-    }
-
-// ---------------------------------------------------------------------------
-
-void CPerfMonEngine::SaveDFSValueL(CDictionaryFileStore* aDicFS,
-        const TUid& aUid, const TPerfMonSources& aValue)
-    {
-    RDictionaryWriteStream out;
-    out.AssignLC(*aDicFS, aUid);
-
-    out.WriteInt16L(ESourcesLength); // write length of the array
-
-    for (TInt i = 0; i < ESourcesLength; i++) // write all items
-        out.WriteInt16L(aValue.iSrcEnabled[i]);
-
-    out.CommitL();
-    CleanupStack::PopAndDestroy(); // out
-    }
-
-// ---------------------------------------------------------------------------
-
-// End of File
--- a/perfmon/group/ReleaseNotes_PerfMon.txt	Tue Aug 31 15:15:20 2010 +0300
+++ b/perfmon/group/ReleaseNotes_PerfMon.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -1,9 +1,9 @@
 ===============================================================================
 
-RELEASE NOTES - PERFORMANCE MONITOR v1.1.1
-RELEASED 21st May 2010 
+RELEASE NOTES - PERFORMANCE MONITOR v1.0.0
+RELEASED 6th March 2008 
 
-SUPPORTS S60 5.2+
+SUPPORTS S60 3.0+
 
 ===============================================================================
 
@@ -26,10 +26,9 @@
 
 ===============================================================================
 
-What's New in v1.1.1
+What's New in v1.0.0
 ====================
-- Improved Orbit UI
-- Error corrections
+- Initial version
 
 ===============================================================================
 
--- a/perfmon/group/bld.inf	Tue Aug 31 15:15:20 2010 +0300
+++ b/perfmon/group/bld.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -15,16 +15,38 @@
 *
 */
 
+
 #include <platform_paths.hrh>
 
-prj_platforms
+PRJ_EXPORTS
+../group/backup_registration.xml    Z:/private/20011385/backup_registration.xml
+../rom/perfmon.iby CORE_IBY_EXPORT_PATH(tools,perfmon.iby)
+
 
-WINSCW GCCE ARMV5 ARMV6
+PRJ_MMPFILES
+#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
+  gnumakefile perfmon_icons_aif.mk
 
-#include "bld_generic.inf"
+  #ifdef MARM
+  gnumakefile perfmon_stub_sis.mk
+  #endif
+#endif
+
+perfmon.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 perfmon_aif.mif
+  OPTION SOURCEDIR ../icons
+  OPTION SOURCES -c8,8 qgn_menu_perfmon
+  END
 
-prj_extensions
\ No newline at end of file
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME PerfMon_stub
+  END
+  #endif  
+#endif
--- a/perfmon/group/bld_generic.inf	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* 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/20011385/backup_registration.xml
-../rom/perfmon.iby CORE_IBY_EXPORT_PATH(tools,perfmon.iby)
-
-PRJ_MMPFILES
-#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
-  gnumakefile perfmon_icons_aif.mk
-
-  #ifdef MARM
-  gnumakefile perfmon_stub_sis.mk
-  #endif
-#endif
-
-#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
-  PRJ_EXTENSIONS
-  START EXTENSION s60/mifconv
-  OPTION TARGETFILE perfmon_aif.mif
-  OPTION SOURCEDIR ../icons
-  OPTION SOURCES -c8,8 qgn_menu_perfmon
-  END
-
-  #ifdef MARM
-  START EXTENSION app-services/buildstubsis
-  OPTION SRCDIR ../sis
-  OPTION SISNAME PerfMon_stub
-  END
-  #endif  
-#endif
--- a/perfmon/group/group.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-#
-# 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\""
-BLD_INF_RULES.prj_exports += "../rom/perfmon_datapopup.iby CORE_IBY_EXPORT_PATH(tools,perfmon_datapopup.iby)"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/group/perfmon.mmp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET            PerfMon.exe
+TARGETTYPE        exe
+EPOCSTACKSIZE     0x5000
+EPOCHEAPSIZE      0x10000 0x1000000  // Min 64Kb, Max 16Mb
+
+UID               0x100039CE 0x20011385
+
+VENDORID          VID_DEFAULT
+CAPABILITY        WriteDeviceData
+
+SMPSAFE
+
+LANG              SC
+
+
+START RESOURCE    ../data/perfmon.rss
+HEADER
+TARGETPATH        APP_RESOURCE_DIR
+END
+
+START RESOURCE    ../data/perfmon_reg.rss
+DEPENDS           perfmon.rsg
+TARGETPATH        /private/10003a3f/apps
+END
+
+APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE       ../inc
+SOURCEPATH        ../src
+
+
+SOURCE            perfmon_app.cpp
+SOURCE            perfmon_document.cpp 
+SOURCE            perfmon_appui.cpp
+SOURCE            perfmon_model.cpp
+SOURCE            perfmon_valuesview.cpp 
+SOURCE            perfmon_valuescontainer.cpp 
+SOURCE            perfmon_graphsview.cpp 
+SOURCE            perfmon_graphscontainer.cpp 
+SOURCE            perfmon_settingsviewdlg.cpp
+SOURCE            perfmon_datapopupcontainer.cpp 
+
+LIBRARY           euser.lib
+LIBRARY           commonengine.lib
+LIBRARY           apparc.lib
+LIBRARY           cone.lib 
+LIBRARY           eikcore.lib
+LIBRARY           eikcoctl.lib
+LIBRARY           eikdlg.lib  
+LIBRARY           avkon.lib 
+LIBRARY           ws32.lib 
+LIBRARY           apgrfx.lib
+LIBRARY           efsrv.lib
+LIBRARY           bafl.lib
+LIBRARY           gdi.lib
+LIBRARY           estor.lib
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon.hrh	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#ifndef PERFMON_HRH
+#define PERFMON_HRH
+
+enum TPerfMonCommandIds
+    {
+    EPerfMonCmdEnableLogging = 1,
+    EPerfMonCmdDisableLogging,
+    EPerfMonCmdSettings,
+    EPerfMonCmdAbout,
+
+    EPerfMonCmdSettingsChange,
+    EPerfMonCmdSettingsExit,
+    EPerfMonCmdSettingsBack,
+    
+    EPerfMonSettingItemList = 1000
+    };
+
+enum TPerfMonMainViewTabs
+    {
+    ETabMainViewValues = 1,
+    ETabMainViewGraphs    
+    };
+               
+enum TPerfMonSettingListTabs
+    {
+    ETabSettingsGeneral = 0,
+    ETabSettingsDataPopup,    
+    ETabSettingsGraphs,    
+    ETabSettingsLogging    
+    };
+    
+enum TPerfMonSettingListIds
+    {
+    ESettingListItemHeartBeat = 0,
+    ESettingListItemMaxSamples,
+    ESettingListItemPriority,
+    ESettingListItemCPUMode,
+    ESettingListItemKeepBackLightOn,
+
+    ESettingListItemDataPopupVisbility,
+    ESettingListItemDataPopupLocation,
+    ESettingListItemDataPopupSources,
+
+    ESettingListItemGraphsVerticalBarPeriod,
+    ESettingListItemGraphsSources,
+
+    ESettingListItemLoggingMode,
+    ESettingListItemLoggingFilePath,
+    ESettingListItemLoggingSources
+    };
+
+enum TPerfMonSettingThreadPriorityTypes
+    {
+    EThreadPriorityTypeMuchLess = 0,    
+    EThreadPriorityTypeLess,    
+    EThreadPriorityTypeNormal,    
+    EThreadPriorityTypeMore,    
+    EThreadPriorityTypeMuchMore,    
+    EThreadPriorityTypeRealTime,    
+    EThreadPriorityTypeAbsoluteVeryLow,    
+    EThreadPriorityTypeAbsoluteLow,    
+    EThreadPriorityTypeAbsoluteBackground,    
+    EThreadPriorityTypeAbsoluteForeground,    
+    EThreadPriorityTypeAbsoluteHigh
+    };
+
+enum TPerfMonSettingCPUModes
+    {
+    ECPUModeNotSet = -1,
+    ECPUModeCPUTime,
+    ECPUModeNOPs
+    };
+
+enum TPerfMonSettingDataPopupVisbilities
+    {
+    EDataPopupVisbilityAlwaysOn = 0,
+    EDataPopupVisbilityBackgroundOnly,
+    EDataPopupVisbilityAlwaysAlwaysOff
+    };
+
+enum TPerfMonSettingDataPopupLocations
+    {
+    EDataPopupLocationTopRight = 0,
+    EDataPopupLocationBottomMiddle
+    };
+        
+enum TPerfMonSettingSources
+    {
+    ESourceCPU = 0,
+    ESourceRAM,
+    ESourceC,
+    ESourceD,
+    ESourceE,
+    ESourceF,
+    ESourceG,
+    ESourceH,
+    ESourceI,
+    ESourcesLength // this should be always the last!
+    };
+    
+enum TPerfMonSettingLoggingMode
+    {
+    ELoggingModeRDebug = 0,
+    ELoggingModeLogFile,
+    ELoggingModeRDebugLogFile
+    };
+
+#endif      // PERFMON_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_app.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#ifndef PERFMON_APP_H
+#define PERFMON_APP_H
+
+
+// INCLUDES
+#include <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidPerfMon = { 0x20011385 };
+
+// CLASS DECLARATION
+
+/**
+* CPerfMonApp application class.
+* Provides factory to create concrete document object.
+* 
+*/
+class CPerfMonApp : 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 CPerfMonDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidPerfMon).
+        * @return The value of KUidPerfMon.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_appui.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#ifndef PERFMON_APPUI_H
+#define PERFMON_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 "perfmon_std.h"
+
+// FORWARD DECLARATIONS
+class CPerfMonModel;
+class CAknNavigationControlContainer;
+class CAknTabGroup;
+class CAknNavigationDecorator;
+
+
+// CLASS DECLARATIONS
+
+class CPerfMonAppUi : public CAknViewAppUi
+    {
+    public: // // Constructors and destructor
+
+        void ConstructL();
+
+        ~CPerfMonAppUi();
+        
+    public: // New functions
+
+    private:
+        // From MEikMenuObserver
+        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
+
+    private:
+        void HandleForegroundEventL(TBool aForeground); 
+
+        void HandleCommandL(TInt aCommand);
+
+        void HandleResourceChangeL(TInt aType);
+
+        virtual TKeyResponse HandleKeyEventL(
+            const TKeyEvent& aKeyEvent,TEventCode aType);
+
+    private: //Data
+        CPerfMonModel*                  iModel;
+        CAknNavigationControlContainer* iNaviPane;
+        CAknTabGroup*                   iTabGroup;
+        CAknNavigationDecorator*        iDecoratedTabGroup;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_datapopupcontainer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 PERFMON_DATAPOPUPCONTAINER_H
+#define PERFMON_DATAPOPUPCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+
+#include "perfmon_drawcallback.h"
+
+
+// FORWARD DECLARATIONS
+class CPerfMonModel;
+
+
+// CLASS DECLARATIONS
+
+class CPerfMonDataPopupContainer : public CCoeControl, public MDrawUpdateCallback
+    {
+public:
+    void ConstructL(const TRect& aRect);
+    ~CPerfMonDataPopupContainer();
+
+protected:
+    void Draw(const TRect& aRect) const;
+    virtual void SizeChanged();    
+
+public:
+    void SetPositionAndSize();
+    void UpdateVisibility(TBool aForeground=ETrue);
+
+public: // from MDrawUpdateCallback
+    void DrawUpdate();
+
+private:
+    CPerfMonModel*                      iModel;
+    RWindowGroup                        iWindowGroup;
+    const CFont*                        iFont; 
+    TInt                                iFontSize;
+    };
+    
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_document.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#ifndef PERFMON_DOCUMENT_H
+#define PERFMON_DOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+   
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CPerfMonModel;
+
+
+// CLASS DECLARATION
+
+/**
+*  CPerfMonDocument application class.
+*/
+class CPerfMonDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+        static CPerfMonDocument* NewL(CEikApplication& aApp);
+        virtual ~CPerfMonDocument();
+
+    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.
+        */
+        CPerfMonDocument(CEikApplication& aApp);
+        void ConstructL();
+
+    private:
+
+        /**
+        * From CEikDocument, create CPerfMonAppUi "App UI" object.
+        */
+        CEikAppUi* CreateAppUiL();
+
+    public:
+        inline CPerfMonModel* Model() { return iModel; }
+
+    private:
+        CPerfMonModel* iModel;
+
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_drawcallback.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#ifndef PERFMON_DRAWCALLBACK_H
+#define PERFMON_DRAWCALLBACK_H
+
+class MDrawUpdateCallback
+    {
+public:
+    virtual void DrawUpdate() = 0;    
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_graphscontainer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#ifndef PERFMON_GRAPHSCONTAINER_H
+#define PERFMON_GRAPHSCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+
+#include "perfmon_drawcallback.h"
+
+
+// FORWARD DECLARATIONS
+class CPerfMonModel;
+
+
+// CLASS DECLARATIONS
+
+class CPerfMonGraphsContainer : public CCoeControl, public MDrawUpdateCallback
+    {
+public:
+    void ConstructL(const TRect& aRect);
+    ~CPerfMonGraphsContainer();
+
+private:
+    void Draw(const TRect& aRect) const;
+    void HandleResourceChange(TInt aType);
+
+public:
+	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/);
+
+public: // from MDrawUpdateCallback
+    void DrawUpdate();
+
+private:
+    CPerfMonModel*                      iModel;
+    const CFont*                        iFont;
+    };
+    
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_graphsview.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 PERFMON_GRAPHSVIEW_H
+#define PERFMON_GRAPHSVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+
+#include "perfmon_std.h"
+
+
+
+// CONSTANTS
+// UID of view
+const TUid KGraphsViewUID = {2};
+
+
+// FORWARD DECLARATIONS
+class CPerfMonGraphsContainer;
+class CPerfMonModel;
+
+
+// CLASS DECLARATION
+
+/**
+*  CPerfMonGraphsView view class.
+* 
+*/
+class CPerfMonGraphsView : public CAknView
+    {
+    public: // Constructors and destructor
+        void ConstructL();
+        ~CPerfMonGraphsView();
+
+    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
+        CPerfMonGraphsContainer*        iContainer;
+        CPerfMonModel*                  iModel;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_model.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 PERFMON_MODEL_H
+#define PERFMON_MODEL_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+#include <apgcli.h>
+#include <gdi.h>
+
+#include "perfmon.hrh"
+
+
+// setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
+const TUid KPMSettingHeartBeat                              = { 0x00 };
+const TUid KPMSettingMaxSamples                             = { 0x01 };
+const TUid KPMSettingPriority                               = { 0x02 };
+const TUid KPMSettingCPUMode                                = { 0x03 };
+const TUid KPMSettingKeepBackLightOn                        = { 0x04 };
+
+const TUid KPMSettingDataPopupVisbility                     = { 0x05 };
+const TUid KPMSettingDataPopupLocation                      = { 0x06 };
+const TUid KPMSettingDataPopupSources                       = { 0x07 };
+
+const TUid KPMSettingGraphsVerticalBarPeriod                = { 0x08 };
+const TUid KPMSettingGraphsSources                          = { 0x09 };
+
+const TUid KPMSettingLoggingMode                            = { 0x0A };
+const TUid KPMSettingLoggingFilePath                        = { 0x0B };
+const TUid KPMSettingLoggingSources                         = { 0x0C };
+
+
+
+// FORWARD DECLARATIONS
+class CPerfMonValuesContainer;
+class CPerfMonGraphsContainer;
+class CPerfMonDataPopupContainer;
+class CEikonEnv;
+class CCoeControl;
+class CDictionaryFileStore;
+
+
+// CLASS DECLARATIONS
+
+
+class TPerfMonSources
+    {
+public:
+    TBool iSrcEnabled[ESourcesLength];
+
+public:
+    inline void SetDefaults1()
+        {
+        iSrcEnabled[ESourceCPU] = ETrue;
+        iSrcEnabled[ESourceRAM] = ETrue;
+        iSrcEnabled[ESourceC]   = ETrue;
+        iSrcEnabled[ESourceD]   = EFalse;
+        iSrcEnabled[ESourceE]   = EFalse;
+        iSrcEnabled[ESourceF]   = EFalse;
+        iSrcEnabled[ESourceG]   = EFalse;
+        iSrcEnabled[ESourceH]   = EFalse;
+        iSrcEnabled[ESourceI]   = EFalse;        
+        }
+    inline void SetDefaults2()
+        {
+        iSrcEnabled[ESourceCPU] = ETrue;
+        iSrcEnabled[ESourceRAM] = ETrue;
+        iSrcEnabled[ESourceC]   = EFalse;
+        iSrcEnabled[ESourceD]   = EFalse;
+        iSrcEnabled[ESourceE]   = EFalse;
+        iSrcEnabled[ESourceF]   = EFalse;
+        iSrcEnabled[ESourceG]   = EFalse;
+        iSrcEnabled[ESourceH]   = EFalse;
+        iSrcEnabled[ESourceI]   = EFalse;        
+        }
+    TInt EnabledSourcesCount()
+        {
+        TInt srcCount(0);
+        
+        for (TInt i=0; i<ESourcesLength; i++)
+            {
+            if (iSrcEnabled[i])
+                srcCount++;
+            }
+        
+        return srcCount;
+        }
+    };
+    
+
+class TPerfMonSettings
+    {
+public:
+    TInt                iHeartBeat;
+    TInt                iMaxSamples;
+    TInt                iPriority;
+    TInt                iCPUMode;
+    TBool               iKeepBacklightOn;
+
+    TInt                iDataPopupVisibility;
+    TInt                iDataPopupLocation;
+    TPerfMonSources     iDataPopupSources;
+
+    TInt                iGraphsVerticalBarPeriod;
+    TPerfMonSources     iGraphsSources;
+
+    TInt                iLoggingMode;
+    TFileName           iLoggingFilePath;
+    TPerfMonSources     iLoggingSources;
+    
+    TBool               iLoggingEnabled;
+    };
+
+
+class TSampleData
+	{
+public:
+    TInt64                          iFree;
+    TInt64                          iSize;
+    TTimeIntervalMicroSeconds       iTimeFromStart;
+	}; 
+
+typedef CArrayFixSeg<TSampleData> CSampleDataArray;
+
+
+class TSampleEntry
+	{
+public:
+    TBuf<16>            iDescription;
+    TBuf<16>            iUnitTypeShort; //eg. b
+    TBuf<16>            iUnitTypeLong;  //eg. bytes
+    TInt                iDriveNumber;   //used only for disk drives
+    TRgb                iGraphColor;
+    CSampleDataArray*   iSampleDataArray;
+	}; 
+	
+typedef CArrayFixSeg<TSampleEntry> CSampleEntryArray;
+
+
+
+class CPerfMonModel : public CActive
+	{
+private:
+    enum TContainerDrawState
+    	{
+    	EDrawStateInvalid = -1,
+    	EDrawStateValues,
+    	EDrawStateGraphs
+    	};
+
+public:
+	static CPerfMonModel* NewL();
+	~CPerfMonModel();
+	void ActivateModelL();
+	void DeActivateModelL();
+    void EnableLogging(TBool aEnable);
+
+private:
+	void RunL();
+	void DoCancel();
+
+private:
+	CPerfMonModel();
+	void ConstructL();
+    void LoadSettingsL();
+    void SaveSettingsL();
+    void HandleSettingsChangeL();
+    void OpenLogFile(TBool aOpen);
+    void SendDrawEventToContainersL();
+    void CreateSamplesDataArrayL();
+    void UpdateSamplesDataL();
+    void AppendLatestSamplesToLogsL();
+    void ActivateCPUMonitoringL();
+    TBool OpenHandleToNullThread();
+    void DeActivateCPUMonitoring();
+    TBool CPUTimeSupported();
+    TThreadPriority SettingItemToThreadPriority(TInt aIndex);
+    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue);
+    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue);
+    void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TPerfMonSources& aValue);
+    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue);
+    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue);
+    void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TPerfMonSources& aValue);
+    
+public:
+    void SetValuesContainer(CPerfMonValuesContainer* aValuesContainer);
+    void SetGraphsContainer(CPerfMonGraphsContainer* aGraphsContainer);
+    TInt LaunchSettingsDialogL();
+
+    inline TPerfMonSettings& Settings() { return iSettings; }
+    inline CEikonEnv* EikonEnv() { return iEnv; }
+    inline RApaLsSession& LsSession() { return iLs; }
+
+    inline CPerfMonValuesContainer*     ValuesContainer()       { return iValuesContainer; }
+    inline CPerfMonGraphsContainer*     GraphsContainer()       { return iGraphsContainer; }
+    inline CPerfMonDataPopupContainer*  DataPopupContainer()    { return iDataPopupContainer; }
+
+
+    inline CSampleEntryArray* SampleEntryArray() { return iSampleEntryArray; } 
+
+private:
+    RTimer                          iTimer;
+    CPerfMonValuesContainer*        iValuesContainer;
+    CPerfMonGraphsContainer*        iGraphsContainer;
+    CPerfMonDataPopupContainer*     iDataPopupContainer;
+    CEikonEnv*                      iEnv;
+    TPerfMonSettings                iSettings;
+    RApaLsSession                   iLs;
+    TInt                            iDrawState;
+    CSampleEntryArray*              iSampleEntryArray;
+    TTime                           iStartTime;
+
+    TInt                            iCurrentCPUMode;
+
+    RThread                         iNullThread;
+    RThread                         iCPULoadThread;
+	TBool                           iCPULoadCalibrating;
+	TInt                            iCPULoadCalibrationCounter;
+	TInt64                          iCPULoadMaxValue;
+	TInt64                          iCPULoadPreviousValue;    
+	TInt64                          iCPULoadCounter;
+    TTime                           iPreviousTime;
+    
+    TBool                           iLogFileInitialized;
+    RFile                           iLogFile;
+    };
+ 
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_settingsviewdlg.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,121 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#ifndef PERFMON_SETTINGSVIEWDLG_H
+#define PERFMON_SETTINGSVIEWDLG_H
+
+//  INCLUDES
+#include <AknDialog.h>
+#include <eiklbo.h>
+#include <AknTabObserver.h> 
+#include <akntabgrp.h>
+#include <aknsettingitemlist.h> 
+#include <akncheckboxsettingpage.h> 
+
+#include "perfmon_model.h"
+
+
+//  FORWARD DECLARATIONS
+class CAknSettingItemArray;
+class CAknSettingStyleListBox;
+class CAknNavigationControlContainer;
+class CAknNavigationDecorator;
+class CAknTabGroup; 
+class TPerfMonSettings;
+class CSelectionItemList;
+
+
+//  CLASS DEFINITIONS
+
+class CPerfMonSettingsViewDlg : public CAknDialog, public MEikListBoxObserver, public MAknTabObserver
+    {
+public:
+    static CPerfMonSettingsViewDlg* NewL(TPerfMonSettings& aSettings);
+    virtual ~CPerfMonSettingsViewDlg();
+
+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
+    CPerfMonSettingsViewDlg(TPerfMonSettings& aSettings);
+    void ConstructL();        
+
+private: // Data
+    CAknSettingItemArray*               iSettingItemArray;
+    CAknSettingStyleListBox*            iListBox;
+    CAknNavigationControlContainer*     iNaviContainer;
+    CAknNavigationDecorator*            iDecoratedTabGroup;
+    CAknTabGroup*                       iTabGroup;
+    TPerfMonSettings&               iSettings;
+    };
+
+
+class CSourceSelectionCheckBoxSettingItem : public CAknSettingItem
+    {
+public:
+    CSourceSelectionCheckBoxSettingItem( TInt aIdentifier, TPerfMonSources& aMemoryInUse );
+	virtual ~CSourceSelectionCheckBoxSettingItem();
+
+protected:
+	void CompleteConstructionL();
+	void StoreL();
+	void LoadL();
+	const TDesC& SettingTextL();
+	void EditItemL( TBool aCalledFromMenu );
+    void HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType );
+
+private:
+    void AddNewItemToArrayL(const TDesC& aLabel); 
+
+private:
+    CSelectionItemList*     iItemArray;
+    HBufC*                  iSettingText;
+    TPerfMonSources&        iExternalSources;
+    };
+
+
+class CSourceSelectionCheckBoxSettingPage : public CAknCheckBoxSettingPage
+	{
+	public:
+        CSourceSelectionCheckBoxSettingPage( TInt aResourceID, CSelectionItemList* aItemArray );
+	public:		// New functions
+		void UpdateCba();
+	};
+	
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_std.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+#ifndef PERFMON_STD_H
+#define PERFMON_STD_H
+
+
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_valuescontainer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#ifndef PERFMON_VALUESCONTAINER_H
+#define PERFMON_VALUESCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+
+#include "perfmon_drawcallback.h"
+
+
+// FORWARD DECLARATIONS
+class CPerfMonModel;
+
+
+// CLASS DECLARATIONS
+
+class CPerfMonValuesContainer : public CCoeControl, public MDrawUpdateCallback
+    {
+public:
+    void ConstructL(const TRect& aRect);
+    ~CPerfMonValuesContainer();
+
+private:
+    void Draw(const TRect& aRect) const;
+    void HandleResourceChange(TInt aType);
+
+public:
+	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/);
+
+public: // from MDrawUpdateCallback
+    void DrawUpdate();
+    
+private:
+    CPerfMonModel*                      iModel;
+    const CFont*                        iFont; 
+    };
+    
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/inc/perfmon_valuesview.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 PERFMON_VALUESVIEW_H
+#define PERFMON_VALUESVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+
+#include "perfmon_std.h"
+
+
+
+// CONSTANTS
+// UID of view
+const TUid KValuesViewUID = {1};
+
+
+// FORWARD DECLARATIONS
+class CPerfMonValuesContainer;
+class CPerfMonModel;
+
+
+// CLASS DECLARATION
+
+/**
+*  CPerfMonValuesView view class.
+* 
+*/
+class CPerfMonValuesView : public CAknView
+    {
+    public: // Constructors and destructor
+        void ConstructL();
+        ~CPerfMonValuesView();
+
+    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
+        CPerfMonValuesContainer*        iContainer;
+        CPerfMonModel*                  iModel;
+    };
+
+#endif
+
+// End of File
--- a/perfmon/perfmon.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#
-# 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/datapopup \
-          ui/hb/app
--- a/perfmon/rom/perfmon.iby	Tue Aug 31 15:15:20 2010 +0300
+++ b/perfmon/rom/perfmon.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -22,8 +22,11 @@
 S60_APP_EXE(PerfMon)
 S60_APP_AIF_ICONS(PerfMon)
 S60_APP_RESOURCE(PerfMon)
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,PerfMon)
-data=ZPRIVATE\10003a3f\import\APPS\PerfMon_reg.RSC Private\10003a3f\import\Apps\PerfMon_reg.rsc
+#ifdef S60_UPGRADABLE_APP_REG_RSC
+  S60_UPGRADABLE_APP_REG_RSC(PerfMon)
+#else
+  S60_APP_AIF_RSC(PerfMon)
+#endif
 
 data=ZPRIVATE\20011385\backup_registration.xml        	private\20011385\backup_registration.xml
 data=ZSYSTEM\Install\PerfMon_stub.sis                   \system\install\PerfMon_stub.sis
--- a/perfmon/rom/perfmon_datapopup.iby	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef __PERFMON_DATAPOPUP_IBY__
-#define __PERFMON_DATAPOPUP_IBY__
-
-file=ABI_DIR\BUILD_DIR\PerfMonDataPopupPlugin.dll       SHARED_LIB_DIR\PerfMonDataPopupPlugin.dll
-data=DATAZ_\PRIVATE\20011385\PerfMonDataPopupPlugin.qtplugin PRIVATE\20011385\PerfMonDataPopupPlugin.qtplugin
-
-#endif // __PERFMON_DATAPOPUP_IBY__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/src/perfmon_app.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 FILES
+#include "perfmon_app.h"
+#include "perfmon_document.h"
+
+#include <eikstart.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPerfMonApp::AppDllUid()
+// Returns application UID
+// ---------------------------------------------------------
+//
+TUid CPerfMonApp::AppDllUid() const
+    {
+    return KUidPerfMon;
+    }
+
+// ---------------------------------------------------------
+// CDictionaryStore* CPerfMonApp::OpenIniFileLC(RFs& aFs) const
+// overrides CAknApplication::OpenIniFileLC to enable INI file support
+// ---------------------------------------------------------
+//
+CDictionaryStore* CPerfMonApp::OpenIniFileLC(RFs& aFs) const
+    {
+    return CEikApplication::OpenIniFileLC(aFs);
+    }
+   
+// ---------------------------------------------------------
+// CPerfMonApp::CreateDocumentL()
+// Creates CPerfMonDocument object
+// ---------------------------------------------------------
+//
+CApaDocument* CPerfMonApp::CreateDocumentL()
+    {
+    return CPerfMonDocument::NewL( *this );
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CPerfMonApp;
+    }
+
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+   
+
+// End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/src/perfmon_appui.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,228 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "perfmon_appui.h"
+#include "perfmon_valuesview.h"
+#include "perfmon_graphsview.h"
+#include "perfmon_datapopupcontainer.h"
+#include "perfmon.hrh"
+#include "perfmon_model.h"
+#include "perfmon_document.h"
+#include <perfmon.rsg>
+
+#include <avkon.hrh>
+#include <AknQueryDialog.h>
+#include <aknmessagequerydialog.h> 
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonAppUi::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<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+
+    // 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();
+        }
+        
+    CPerfMonValuesView* valuesView = new(ELeave) CPerfMonValuesView;
+    CleanupStack::PushL(valuesView);
+    valuesView->ConstructL();
+    AddViewL(valuesView);           // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();            // valuesView
+
+    CPerfMonGraphsView* graphsView = new(ELeave) CPerfMonGraphsView;
+    CleanupStack::PushL(graphsView);
+    graphsView->ConstructL();
+    AddViewL(graphsView);           // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();            // graphsView
+    
+    // set the default view
+    SetDefaultViewL(*valuesView);
+
+    // notify the model that everything has been constructed
+    iModel->ActivateModelL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPerfMonAppUi::~CPerfMonAppUi()
+    {
+    // notify the model that the application is closing
+    if (iModel)    
+        TRAP_IGNORE(iModel->DeActivateModelL());
+    
+    delete iDecoratedTabGroup;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    if (aResourceId == R_PERFMON_APP_MENU)
+        {
+        aMenuPane->SetItemDimmed(EPerfMonCmdEnableLogging, iModel->Settings().iLoggingEnabled);
+        aMenuPane->SetItemDimmed(EPerfMonCmdDisableLogging, !iModel->Settings().iLoggingEnabled);
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CPerfMonAppUi::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;
+    }
+
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonAppUi::HandleCommandL(TInt aCommand)
+    {
+    switch ( aCommand )
+        {
+        case EPerfMonCmdEnableLogging:
+            {
+            iModel->EnableLogging(ETrue);
+            break;
+            }
+
+        case EPerfMonCmdDisableLogging:
+            {
+            iModel->EnableLogging(EFalse);
+            break;
+            }
+                        
+        case EPerfMonCmdSettings:
+            {
+            if (iModel->LaunchSettingsDialogL() == EAknCmdExit)
+                Exit();
+            break;
+            }
+
+        case EPerfMonCmdAbout:
+            {
+	        CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
+            dialog->ExecuteLD(R_PERFMON_ABOUT_DIALOG);
+            }
+            break;
+            
+        // a normal way to close an application
+        case EAknCmdExit:
+        case EEikCmdExit:
+        case EAknSoftkeyExit: 
+			{
+            Exit();
+			}
+            break;
+
+        default:
+            break;      
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonAppUi::HandleForegroundEventL(TBool aForeground)
+    {
+    // handle visibility of the data popup container
+    if (iModel && iModel->DataPopupContainer())
+        {
+        iModel->DataPopupContainer()->UpdateVisibility(aForeground);
+        }
+    
+    // call the base class
+    CAknAppUi::HandleForegroundEventL(aForeground); 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonAppUi::HandleResourceChangeL(TInt aType)
+    {
+    CAknAppUi::HandleResourceChangeL(aType);
+
+    // update size of the data popup container (implemented here because data popup container
+    // does not get HandleResourceChangeL events)
+    if (aType == KEikDynamicLayoutVariantSwitch)
+        {
+        if (iModel)
+            {
+            if (iModel->DataPopupContainer())
+                {
+                iModel->DataPopupContainer()->SetPositionAndSize();
+                }
+            
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/src/perfmon_datapopupcontainer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+// INCLUDE FILES
+#include "perfmon_datapopupcontainer.h"
+#include "perfmon.hrh"
+#include "perfmon_document.h"
+#include "perfmon_appui.h"
+#include "perfmon_model.h"
+
+#include <AknUtils.h>
+
+_LIT(KPercentageFormat,"%S %d%%");
+_LIT(KFreeFormat,"%S free %S%S");
+
+const TInt KLeftMargin = 2;
+ 
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+void CPerfMonDataPopupContainer::ConstructL(const TRect& /*aRect*/)
+    {
+    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    iFont = LatinPlain12();
+    iFontSize = iFont->FontMaxHeight();
+ 
+    // set windowgroup so that it always on top and does not receive focus
+    iWindowGroup = RWindowGroup(iCoeEnv->WsSession());
+    User::LeaveIfError(iWindowGroup.Construct((TUint32)&iWindowGroup));
+    iWindowGroup.SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
+    iWindowGroup.EnableReceiptOfFocus(EFalse);
+    
+    CreateWindowL(&iWindowGroup);
+    //SetRect(aRect);
+    SetPositionAndSize();
+    SetBlank();
+
+    ActivateL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPerfMonDataPopupContainer::~CPerfMonDataPopupContainer()
+    {
+    iWindowGroup.Close();    
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonDataPopupContainer::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+    gc.SetBrushColor(KRgbWhite);
+    gc.Clear(aRect);
+    
+    // check if sample array has been constructed
+    if (iModel->SampleEntryArray())
+        {
+        // init font
+        gc.SetPenColor(KRgbBlack);
+        gc.UseFont( iFont );
+        
+        // draw a rect around the popup
+        gc.DrawRect(aRect);
+        
+        TInt posCounter(1);
+        
+        for (TInt i=0; i<iModel->SampleEntryArray()->Count(); i++)
+            {
+            // check if this setting has been enabled and it has some data
+            if (iModel->Settings().iDataPopupSources.iSrcEnabled[i] && iModel->SampleEntryArray()->At(i).iSampleDataArray->Count() > 0)
+                {
+                TSampleData& currentSample = iModel->SampleEntryArray()->At(i).iSampleDataArray->At(0);    
+                TBuf<32> buf;
+
+                // for CPU draw %, other amount of free memory
+                if (i == ESourceCPU)
+                    {
+                    buf.Format(KPercentageFormat, &iModel->SampleEntryArray()->At(i).iDescription, currentSample.iSize > 0 ? TInt( (1 - ((TReal)(currentSample.iFree) / (TReal)currentSample.iSize)) * 100) : 0 );
+                    gc.DrawText(buf, TPoint(KLeftMargin, iFontSize*posCounter));
+                    }
+                else
+                    {
+                    TBuf<32> freeBuf;
+                    freeBuf.AppendNum(currentSample.iFree, TRealFormat(KDefaultRealWidth, 0));
+
+                    TBuf<32> buf;
+                    buf.Format(KFreeFormat, &iModel->SampleEntryArray()->At(i).iDescription, &freeBuf, &iModel->SampleEntryArray()->At(i).iUnitTypeShort);
+                    gc.DrawText(buf, TPoint(KLeftMargin, iFontSize*posCounter));                    
+                    }    
+                
+                posCounter++;
+                }
+            }
+            
+        gc.DiscardFont();        
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonDataPopupContainer::SizeChanged()
+    {
+    DrawNow();
+    }   
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonDataPopupContainer::SetPositionAndSize()
+    {
+    CWsScreenDevice* screenDevice = iEikonEnv->ScreenDevice();
+
+    // top right
+    if (iModel->Settings().iDataPopupLocation == EDataPopupLocationTopRight)
+        {
+        // screen orientation is landscape with softkeys on right
+        if (AknLayoutUtils::CbaLocation()==AknLayoutUtils::EAknCbaLocationRight)
+            {
+            SetRect(
+                TRect(
+                    screenDevice->SizeInPixels().iWidth-102-15,
+                    0,
+                    screenDevice->SizeInPixels().iWidth-15,
+                    iModel->Settings().iDataPopupSources.EnabledSourcesCount()*iFontSize + 3
+                    ));
+            }
+
+        // any other orientation
+        else
+            {
+            SetRect(
+                TRect(
+                    screenDevice->SizeInPixels().iWidth-102,
+                    0,
+                    screenDevice->SizeInPixels().iWidth,
+                    iModel->Settings().iDataPopupSources.EnabledSourcesCount()*iFontSize + 3
+                    ));
+            }        
+        }
+
+    // bottom middle
+    else if (iModel->Settings().iDataPopupLocation == EDataPopupLocationBottomMiddle)
+        {
+        SetRect(
+            TRect(
+                screenDevice->SizeInPixels().iWidth/2-102/2,
+                screenDevice->SizeInPixels().iHeight - iModel->Settings().iDataPopupSources.EnabledSourcesCount()*iFontSize - 3,
+                screenDevice->SizeInPixels().iWidth/2+102/2,
+                screenDevice->SizeInPixels().iHeight
+                ));
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonDataPopupContainer::UpdateVisibility(TBool aForeground)
+    {
+    // application has been brought to foregound
+    if (aForeground)
+        {
+        if (iModel->Settings().iDataPopupVisibility==EDataPopupVisbilityAlwaysOn)
+            {
+            MakeVisible(ETrue);
+            }
+        else
+            {
+            MakeVisible(EFalse);
+            }    
+        }
+    
+    // application has been sent to background
+    else
+        {
+        if (iModel->Settings().iDataPopupVisibility==EDataPopupVisbilityAlwaysOn
+            || iModel->Settings().iDataPopupVisibility==EDataPopupVisbilityBackgroundOnly)
+            {
+            MakeVisible(ETrue);
+            }
+        else
+            {
+            MakeVisible(EFalse);
+            }              
+        }    
+    }
+            
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonDataPopupContainer::DrawUpdate()
+    {
+    DrawDeferred(); 
+    }
+    
+// --------------------------------------------------------------------------------------------
+       
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/src/perfmon_document.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "perfmon_document.h"
+#include "perfmon_appui.h"
+#include "perfmon_model.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// constructor
+CPerfMonDocument::CPerfMonDocument(CEikApplication& aApp)
+: CAknDocument(aApp)    
+    {
+    }
+
+// ----------------------------------------------------
+
+// destructor
+CPerfMonDocument::~CPerfMonDocument()
+    {
+    delete iModel;
+    }
+
+// ----------------------------------------------------
+
+// EPOC default constructor can leave.
+void CPerfMonDocument::ConstructL()
+    {
+    iModel = CPerfMonModel::NewL();
+    }
+
+// ----------------------------------------------------
+
+// Two-phased constructor.
+CPerfMonDocument* CPerfMonDocument::NewL(CEikApplication& aApp)
+    {
+    CPerfMonDocument* self = new(ELeave) CPerfMonDocument(aApp);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+    
+// ----------------------------------------------------
+// CPerfMonDocument::CreateAppUiL()
+// constructs CPerfMonAppUi
+// ----------------------------------------------------
+//
+CEikAppUi* CPerfMonDocument::CreateAppUiL()
+    {
+    return new (ELeave) CPerfMonAppUi;
+    }
+
+// ----------------------------------------------------
+// CPerfMonDocument::OpenFileL
+// Overrides CAknDocument::OpenFileL to support document file
+// ----------------------------------------------------
+//
+CFileStore* CPerfMonDocument::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/perfmon/src/perfmon_graphscontainer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,233 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "perfmon_graphscontainer.h"
+#include "perfmon.hrh"
+#include "perfmon_document.h"
+#include "perfmon_appui.h"
+#include "perfmon_model.h"
+
+#include <AknUtils.h>
+
+const TInt KAmountOfMicroSecondsFitsScreen = 20 * 1000000;
+#define KRgbCustomGrey TRgb(0x808080)
+
+_LIT(K100p, "100%"); 
+_LIT(K50p, "50%"); 
+_LIT(K0p, "0%"); 
+
+_LIT(KPercentageFormat,"%S %d%%");
+
+const TInt KMicroToSecondMultiplier = 1000000;
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+void CPerfMonGraphsContainer::ConstructL(const TRect& aRect)
+    {
+    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    //iFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
+    iFont = LatinBold12();
+
+    CreateWindowL();
+    SetRect(aRect);
+    SetBlank();
+
+    ActivateL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPerfMonGraphsContainer::~CPerfMonGraphsContainer()
+    {
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonGraphsContainer::Draw(const TRect& aRect) const
+    {
+    // draw black background
+    CWindowGc& gc = SystemGc();
+    gc.SetBrushColor(KRgbBlack);
+    gc.Clear(aRect);
+    
+    // activate font and get size
+    gc.UseFont(iFont);
+    TUint fontSize = iFont->FontMaxHeight();
+    //TInt fontBaseOffset = iFont->DescentInPixels();
+    
+
+    // calculate time factor
+    TReal scaleFactor = (TReal) aRect.Width() / (TReal) KAmountOfMicroSecondsFitsScreen;
+
+    // calculate area height which is used to draw the grpahs
+    TInt drawAreaHeight = aRect.Height() - fontSize - fontSize;
+        
+    
+    // check if sample array has been constructed
+    if (iModel->SampleEntryArray())
+        {
+        
+        // draw vertical time lines first
+        TInt verticalBarPeriodInSecs = iModel->Settings().iGraphsVerticalBarPeriod;
+        
+        if (verticalBarPeriodInSecs >= 1 && iModel->SampleEntryArray()->At(0).iSampleDataArray->Count() > 0)
+            {
+            // get time from the first sample
+            TSampleData& firstSample = iModel->SampleEntryArray()->At(0).iSampleDataArray->At(0);
+            TInt64 currentMicroSeconds = firstSample.iTimeFromStart.Int64();
+            
+            // calculate amount of microseconds exceeding value by using the modulo operator
+            TInt remainderInMicroSeconds = currentMicroSeconds % (verticalBarPeriodInSecs * 1000000); 
+            
+            // calculate first x pos
+            TInt vbarXpos = aRect.Width() - (remainderInMicroSeconds * scaleFactor);
+            
+            // calculate the amount in seconds
+            TInt barSeconds = (currentMicroSeconds - remainderInMicroSeconds) / KMicroToSecondMultiplier;
+
+            
+            // continue drawing periodically the vertical lines
+            while (vbarXpos >= 0 && barSeconds >= 0)
+                {
+                // draw vertical line    
+                gc.SetPenColor(KRgbDarkRed);
+                gc.DrawLine(TPoint(vbarXpos,fontSize+1), TPoint(vbarXpos,aRect.Height()-fontSize));
+                
+                // draw seconds value
+                gc.SetPenColor(KRgbCustomGrey);
+                TBuf<16> secsBuf;
+                secsBuf.AppendNum(barSeconds);    
+                secsBuf.Append(_L("s"));
+                gc.DrawText(secsBuf, TPoint(vbarXpos-(iFont->TextWidthInPixels(secsBuf)/2), aRect.Height()));    
+
+                // calculate new position
+                vbarXpos -= verticalBarPeriodInSecs * 1000000 * scaleFactor;
+                barSeconds -= verticalBarPeriodInSecs;
+                }
+            }
+        
+        // draw the basic grid
+        gc.SetPenColor(KRgbCustomGrey);
+    
+        gc.DrawLine(TPoint(0,fontSize), TPoint(aRect.Width(),fontSize));  // upper line
+        gc.DrawText(K100p, TPoint(0,fontSize));
+    
+        gc.DrawLine(TPoint(0,aRect.Height()/2), TPoint(aRect.Width(),aRect.Height()/2));  // mid line
+        gc.DrawText(K50p, TPoint(0,aRect.Height()/2));
+    
+        gc.DrawLine(TPoint(0,aRect.Height()-fontSize), TPoint(aRect.Width(),aRect.Height()-fontSize));  // bottom line
+        gc.DrawText(K0p, TPoint(0,aRect.Height()-fontSize));
+
+        TInt c(0);
+            
+        // draw graphs for each sampled type
+        for (TInt i=0; i<iModel->SampleEntryArray()->Count(); i++)
+            {
+            // check if this setting has been enabled and it has some data
+            if (iModel->Settings().iGraphsSources.iSrcEnabled[i] && iModel->SampleEntryArray()->At(i).iSampleDataArray->Count() > 0)
+                {
+                // set pen color for the graph
+                gc.SetPenColor(iModel->SampleEntryArray()->At(i).iGraphColor);
+                
+                // remember the position where drawing started
+                /*TReal*/TInt currentXPos(aRect.Width()); // start drawing from right            
+                /*TReal*/TInt currentYPos(0);
+                
+                // draw samples
+                for (TInt j=0; j<iModel->SampleEntryArray()->At(i).iSampleDataArray->Count() - 1; j++)
+                    {
+                    TSampleData& currentSample = iModel->SampleEntryArray()->At(i).iSampleDataArray->At(j);
+                    TSampleData& previousSample = iModel->SampleEntryArray()->At(i).iSampleDataArray->At(j+1);
+                    
+                    // calculate X position for previous (j+1)
+                    /*TReal*/TInt previousXPos = currentXPos -
+                        ( (Abs(previousSample.iTimeFromStart.Int64() - currentSample.iTimeFromStart.Int64())) * scaleFactor );
+                    
+
+                    // calculate initial Y position
+                    if (j==0)
+                        {
+                        currentYPos = currentSample.iSize > 0 ? (TReal)(currentSample.iFree) / (TReal)currentSample.iSize * drawAreaHeight + fontSize : aRect.Height()-fontSize;
+                        }
+
+                    // calculate Y position for previous (j+1)
+                    /*TReal*/TInt previousYPos = previousSample.iSize > 0 ? (TReal)(previousSample.iFree) / (TReal)previousSample.iSize * drawAreaHeight + fontSize : aRect.Height()-fontSize; 
+                    
+                    
+                    // draw a line between the previous and current
+                    gc.DrawLine(TPoint((TInt)previousXPos,(TInt)previousYPos), TPoint((TInt)currentXPos,(TInt)currentYPos));
+                    
+                    
+                    // draw current value in %
+                    if (j==0) // draw the value of first sample
+                        {
+                        TBuf<16> buf;
+                        buf.Format(KPercentageFormat, &iModel->SampleEntryArray()->At(i).iDescription, currentSample.iSize > 0 ? TInt( (1 - ((TReal)(currentSample.iFree) / (TReal)currentSample.iSize)) * 100) : 0 );
+      
+                        gc.DrawText(buf, TPoint(0,fontSize+fontSize+c*fontSize));
+                        c++;                    
+                        }
+                    
+                    
+                    // stop drawing if we have run out of space
+                    if (previousXPos < 0)
+                        break;
+                    
+                    // remeber previous values
+                    currentXPos = previousXPos;
+                    currentYPos = previousYPos;
+                    }
+                }
+            }
+        }
+
+    gc.DiscardFont();        
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CPerfMonGraphsContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    return CCoeControl::OfferKeyEventL(aKeyEvent, aType);
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonGraphsContainer::HandleResourceChange(TInt aType)
+    {
+    if (aType == KEikDynamicLayoutVariantSwitch)
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        }
+    else
+        CCoeControl::HandleResourceChange(aType);    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonGraphsContainer::DrawUpdate()
+    {
+    DrawDeferred();    
+    }
+    
+// --------------------------------------------------------------------------------------------
+            
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/src/perfmon_graphsview.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "perfmon.hrh"
+#include "perfmon_graphsview.h"
+#include "perfmon_graphscontainer.h"
+#include "perfmon_document.h" 
+#include "perfmon_model.h"
+#include <perfmon.rsg>
+
+#include <eikenv.h>
+#include <aknViewAppUi.h> 
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPerfMonGraphsView::ConstructL(const TRect& aRect)
+// EPOC two-phased constructor
+// ---------------------------------------------------------
+//
+void CPerfMonGraphsView::ConstructL()
+    {
+    BaseConstructL( R_PERFMON_VIEW_GRAPHS );
+    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    }
+
+// ---------------------------------------------------------
+// CPerfMonGraphsView::~CPerfMonGraphsView()
+// ---------------------------------------------------------
+//
+CPerfMonGraphsView::~CPerfMonGraphsView()
+    {
+    if (iContainer)
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// TUid CPerfMonGraphsView::Id()
+// ---------------------------------------------------------
+//
+TUid CPerfMonGraphsView::Id() const
+    {
+    return KGraphsViewUID;
+    }
+
+// ---------------------------------------------------------
+// TUid CPerfMonGraphsView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+// ---------------------------------------------------------
+//
+void CPerfMonGraphsView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
+    }
+
+  
+// ---------------------------------------------------------
+// CPerfMonGraphsView::HandleCommandL(TInt aCommand)
+// ---------------------------------------------------------
+//
+void CPerfMonGraphsView::HandleCommandL(TInt aCommand)
+    {   
+/*
+    switch ( aCommand )
+        {
+        case EPerfMonCmdFileBack:
+            {
+            iModel->FileUtils()->MoveUpOneLevelL();
+            break;
+            }
+
+        default:
+            {
+*/
+            AppUi()->HandleCommandL( aCommand );
+/*
+            break;
+            }
+        }
+*/
+    }
+
+// ---------------------------------------------------------
+// CPerfMonGraphsView::HandleClientRectChange()
+// ---------------------------------------------------------
+//
+void CPerfMonGraphsView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPerfMonGraphsView::DoActivateL(...)
+// ---------------------------------------------------------
+//
+void CPerfMonGraphsView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CPerfMonGraphsContainer;
+        iModel->SetGraphsContainer(iContainer);
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+   }
+
+// ---------------------------------------------------------
+// CPerfMonGraphsView::DoDeactivate()
+// ---------------------------------------------------------
+//
+void CPerfMonGraphsView::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/perfmon/src/perfmon_model.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,951 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "perfmon_model.h"
+#include "perfmon_app.h"
+#include "perfmon_settingsviewdlg.h"
+#include "perfmon.hrh"
+#include "perfmon_valuescontainer.h"
+#include "perfmon_graphscontainer.h"
+#include "perfmon_datapopupcontainer.h"
+#include <perfmon.rsg>
+
+#include <coeutils.h>
+#include <bautils.h>
+#include <eikenv.h>
+#include <e32hal.h>
+#include <u32std.h>
+#include <s32file.h>
+#include <akntitle.h> 
+#include <eikspane.h>
+#include <aknnotewrappers.h>  
+
+_LIT(KAppName, "PerfMon");
+_LIT(KDefaultLogFilePath, "c:\\data\\PerfMon.log");
+
+const TInt KCalibrationLength = 2;
+const TInt KMinimumSamplesLength = 16;
+const TInt KCPUTimeMultiplier = 1000000; // used to avoid TReal conversions
+
+const TInt KSettingsDrive = EDriveC;
+_LIT(KSettingsFileName, "perfmon_settings.ini");
+
+
+// --------------------------------------------------------------------------------------------
+
+TInt CPULoadCount(TAny* aInt)
+	{
+	// increase the counter
+	(*(TUint*)aInt)++;
+	return 1;
+	}
+
+TInt CPULoadNOPThread(TAny* aParam)
+	{
+	CTrapCleanup* pC = CTrapCleanup::New();
+	CActiveScheduler* pS = new CActiveScheduler;
+	CActiveScheduler::Install(pS);
+
+	CIdle* idle = CIdle::NewL(CActive::EPriorityStandard);
+	TCallBack cb(CPULoadCount, aParam);
+	idle->Start(cb);
+
+	pS->Start();
+
+	delete idle;
+	delete pS;
+	delete pC;
+
+	return 0;
+	}
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+CPerfMonModel* CPerfMonModel::NewL()
+	{
+	CPerfMonModel* self = new(ELeave) CPerfMonModel;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+// --------------------------------------------------------------------------------------------
+
+CPerfMonModel::CPerfMonModel() : CActive(EPriorityUserInput)
+	{
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::ConstructL()
+	{
+	iDrawState = EDrawStateInvalid;
+	iCurrentCPUMode = ECPUModeNotSet;
+	iLogFileInitialized = EFalse;
+	
+    iEnv = CEikonEnv::Static();
+    User::LeaveIfError(iLs.Connect());
+
+    User::LeaveIfError(iTimer.CreateLocal());
+	CActiveScheduler::Add(this);
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::ActivateModelL()
+	{
+    // load settings
+    TRAP_IGNORE(LoadSettingsL());
+
+	// create data storages for the samples
+	CreateSamplesDataArrayL();
+	
+	// initialize the data popup container in top-right corner
+	iDataPopupContainer = new(ELeave) CPerfMonDataPopupContainer;
+	iDataPopupContainer->ConstructL(TRect(0,0,1,1));
+	
+	// set default modes
+	HandleSettingsChangeL();
+
+    // start sampling data immediately (jump to RunL)    
+    iTimer.After(iStatus, 100);
+    SetActive();
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::DeActivateModelL()
+	{
+	Cancel();
+	
+	DeActivateCPUMonitoring();
+
+	if (iDataPopupContainer)
+	    {
+	    delete iDataPopupContainer;
+	    iDataPopupContainer = NULL;
+	    }
+
+    // close log file
+	OpenLogFile(EFalse);
+	}
+	
+// --------------------------------------------------------------------------------------------
+
+CPerfMonModel::~CPerfMonModel()
+	{
+	iTimer.Close();
+
+    // clear data storages
+	if (iSampleEntryArray)
+	    {
+        for (TInt i=0; i<iSampleEntryArray->Count(); i++)
+            {
+            delete iSampleEntryArray->At(i).iSampleDataArray;
+            }
+	    
+	    delete iSampleEntryArray;
+	    }
+
+	    
+	iLs.Close();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::DoCancel()
+	{
+    iTimer.Cancel();
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::RunL()
+	{
+	// calculate new values 
+	UpdateSamplesDataL();
+	
+	// log changes
+	AppendLatestSamplesToLogsL();
+	
+	// redraw views
+	SendDrawEventToContainersL();  
+
+    // continue
+    iTimer.After(iStatus, iSettings.iHeartBeat * 1000); // convert from milliseconds to microseconds
+    SetActive();
+	}
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::HandleSettingsChangeL()
+    {
+    // set priority of the thread
+    RThread().SetPriority(SettingItemToThreadPriority(iSettings.iPriority));
+    
+    // set visibility and location of the data popup
+    iDataPopupContainer->UpdateVisibility();
+    iDataPopupContainer->SetPositionAndSize();
+    
+    // init cpu monitor if setting has been changed
+    if (iCurrentCPUMode != iSettings.iCPUMode)
+        {
+        DeActivateCPUMonitoring();
+        ActivateCPUMonitoringL();
+        }
+    
+    // close log file
+    OpenLogFile(EFalse);
+    
+    // enable log file
+    if (iSettings.iLoggingEnabled && (iSettings.iLoggingMode == ELoggingModeLogFile || iSettings.iLoggingMode == ELoggingModeRDebugLogFile))
+        OpenLogFile(ETrue);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::EnableLogging(TBool aEnable)
+    {
+    if (aEnable)
+        {
+        if (iSettings.iLoggingMode == ELoggingModeLogFile || iSettings.iLoggingMode == ELoggingModeRDebugLogFile)
+            OpenLogFile(ETrue);
+        
+        iSettings.iLoggingEnabled = ETrue;
+        }
+    else // disable
+        {
+        iSettings.iLoggingEnabled = EFalse;
+        OpenLogFile(EFalse);
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::OpenLogFile(TBool aOpen)
+    {
+    // open log file for writing
+    if (aOpen)
+        {
+        if (!iLogFileInitialized)
+            {
+            TInt err(KErrNone);
+            
+            // open the log file for writing
+            if (iLogFile.Open(iEnv->FsSession(), iSettings.iLoggingFilePath, EFileWrite) != KErrNone)
+                {
+                iEnv->FsSession().MkDirAll(iSettings.iLoggingFilePath);
+                err = iLogFile.Replace(iEnv->FsSession(), iSettings.iLoggingFilePath, EFileWrite);
+                }
+            else
+                {
+                // file opens correctly, seek to the end
+                TInt fileSize=0;
+                iLogFile.Size(fileSize);
+                err = iLogFile.Seek(ESeekCurrent, fileSize);
+                }
+            
+            if (err == KErrNone)
+                {
+                iLogFileInitialized = ETrue;
+                }
+            else
+                {
+                // show error
+                CAknErrorNote* note = new(ELeave) CAknErrorNote();
+                note->ExecuteLD(_L("Unable to create log file, check settings"));                
+                }
+            }        
+        }
+
+    // close handle to log file
+    else 
+        {
+        if (iLogFileInitialized)
+            {
+            iLogFile.Flush();
+            iLogFile.Close();
+            
+            iLogFileInitialized = EFalse;
+            }
+        }
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::ActivateCPUMonitoringL()
+    {
+    // reset counter variables
+	iCPULoadCalibrating = ETrue;
+	iCPULoadCalibrationCounter = 0;
+	iCPULoadMaxValue = 999999999;
+	iCPULoadPreviousValue = 1;
+	iCPULoadCounter = 0;
+
+    // use null thread is cpu time is supported and the setting is on
+    if (CPUTimeSupported() && iSettings.iCPUMode == ECPUModeCPUTime) 
+        {
+        // try to open handle to null thread
+        if (OpenHandleToNullThread())
+            {
+            // handle is open, get initial value
+            TTimeIntervalMicroSeconds time;
+            iNullThread.GetCpuTime(time);
+            iCPULoadPreviousValue = time.Int64();
+            iPreviousTime.HomeTime();
+            
+            iCurrentCPUMode = ECPUModeCPUTime;
+            return; // cpu time is succesfully in use           
+            }
+        }
+
+    // otherwise use normal sampling with nops    
+    iCurrentCPUMode = ECPUModeNotSet;
+
+    // show a warning if cpu time cannot be taken in use
+    if (iSettings.iCPUMode == ECPUModeCPUTime)
+        {
+        CAknInformationNote* note = new(ELeave) CAknInformationNote();
+        note->ExecuteLD(_L("CPU Time not supported in this system, using NOPs sampling"));
+        }
+        
+    // create a thread for CPU load monitoring
+    User::LeaveIfError(iCPULoadThread.Create(_L("PerfMonCPULoad"), CPULoadNOPThread, 0x1000, 0x1000, 0x100000, &iCPULoadCounter));
+    iCPULoadThread.SetPriority(EPriorityLess);
+    iCPULoadThread.Resume();    
+    
+    iCurrentCPUMode = ECPUModeNOPs; // NOPs taken succesfully in use
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CPerfMonModel::OpenHandleToNullThread()
+    {
+    // find the kernel process and then the null thread
+    TFindProcess fp(_L("ekern.exe*"));
+    
+    TFullName kernelName;
+    if (fp.Next(kernelName) == KErrNone)
+        {
+        // process found, append null thread identifier
+        kernelName.Append(_L("::Null"));
+        
+        // find the thread
+        TFindThread ft(kernelName);
+
+        TFullName threadName;
+        if (ft.Next(threadName) == KErrNone)
+            {
+            // open instance to the thread
+            if (iNullThread.Open(threadName) != KErrNone)
+                return EFalse;                
+            }
+        }
+    
+    // process not found
+    else
+        return EFalse;
+    
+    // success!
+    return ETrue;        
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::DeActivateCPUMonitoring()
+    {
+    if (iCurrentCPUMode == ECPUModeCPUTime)
+        {
+        iNullThread.Close();
+        }
+    
+    else if (iCurrentCPUMode == ECPUModeNOPs)    
+        {
+        // kill the cpu load thread
+        iCPULoadThread.Kill(0);
+        iCPULoadThread.Close();        
+        } 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TBool CPerfMonModel::CPUTimeSupported()
+    {
+    TTimeIntervalMicroSeconds time;
+    TInt err = RThread().GetCpuTime(time);
+    
+    if (err == KErrNone && time.Int64() > 0)
+        return ETrue;
+    else
+        return EFalse;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TThreadPriority CPerfMonModel::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 CPerfMonModel::CreateSamplesDataArrayL()
+    {
+    TInt maxSamples = iSettings.iMaxSamples >= KMinimumSamplesLength ? iSettings.iMaxSamples : KMinimumSamplesLength;
+
+    // create the data structure to store all samples
+    iSampleEntryArray = new(ELeave) CSampleEntryArray(16);
+
+    // add all source entries
+    for (TInt i=0; i<ESourcesLength; i++)
+        {
+        TSampleEntry newSampleEntry;
+        
+        if (i == ESourceCPU)
+            {
+            newSampleEntry.iDescription.Copy(_L("CPU"));
+            newSampleEntry.iUnitTypeShort.Copy(KNullDesC);
+            newSampleEntry.iUnitTypeLong.Copy(KNullDesC);
+            newSampleEntry.iDriveNumber = -1;
+            newSampleEntry.iGraphColor = KRgbYellow;            
+            }
+        
+        else if (i == ESourceRAM)
+            {
+            newSampleEntry.iDescription.Copy(_L("RAM"));
+            newSampleEntry.iUnitTypeShort.Copy(_L("b"));
+            newSampleEntry.iUnitTypeLong.Copy(_L("bytes"));
+            newSampleEntry.iDriveNumber = -1;
+            newSampleEntry.iGraphColor = KRgbGreen;            
+            }        
+        
+        else //drives
+            {
+            TChar driveLetter = 'C' + i-ESourceC; // C is the first drive
+
+            newSampleEntry.iDescription.Append(driveLetter);
+            newSampleEntry.iDescription.Append(_L(":"));
+            newSampleEntry.iUnitTypeShort.Copy(_L("b"));
+            newSampleEntry.iUnitTypeLong.Copy(_L("bytes"));
+            
+            iEnv->FsSession().CharToDrive(driveLetter, newSampleEntry.iDriveNumber);
+            
+            newSampleEntry.iGraphColor = KRgbCyan;
+            newSampleEntry.iGraphColor.SetGreen(255-(i-ESourceC)*30);
+            newSampleEntry.iGraphColor.SetRed(i*30);
+            }
+        
+        newSampleEntry.iSampleDataArray = new(ELeave) CSampleDataArray(maxSamples); 
+        
+        iSampleEntryArray->AppendL(newSampleEntry);        
+        }
+
+    // save current time as start time
+    iStartTime.HomeTime();
+    }
+	
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::UpdateSamplesDataL()
+    {
+    // reset inactivity timers
+    if (iSettings.iKeepBacklightOn)
+        User::ResetInactivityTime();
+   
+    // get current time
+    TTime currentTime;
+    currentTime.HomeTime();
+    
+    // calculate time difference
+    TTimeIntervalMicroSeconds timeDeltaFromPreviousSample = currentTime.MicroSecondsFrom(iPreviousTime);
+    
+    // remember current time as previous
+    iPreviousTime = currentTime;
+    
+    
+    // get CPU
+    TInt64 cpuLoadDelta(0);
+    TInt64 cpuLoadFree(0);
+    TInt64 cpuLoadSize(0);
+    TInt64 currentCPUValue(0);
+    
+    if (iCurrentCPUMode == ECPUModeCPUTime || iCurrentCPUMode == ECPUModeNOPs)
+        {
+        if (iCurrentCPUMode == ECPUModeCPUTime)
+            {
+            TTimeIntervalMicroSeconds time;
+            iNullThread.GetCpuTime(time);
+            currentCPUValue = time.Int64();
+            }
+        else if (iCurrentCPUMode == ECPUModeNOPs)
+            {
+            currentCPUValue = iCPULoadCounter;
+            }    
+            
+        // get delta and store the previous value
+        cpuLoadDelta = currentCPUValue - iCPULoadPreviousValue;
+        iCPULoadPreviousValue = currentCPUValue;
+        
+        // velocity = distance / time
+        cpuLoadFree = cpuLoadDelta * KCPUTimeMultiplier / timeDeltaFromPreviousSample.Int64();
+        
+
+        // detect maximum value
+        if (cpuLoadFree > iCPULoadMaxValue)
+            iCPULoadMaxValue = cpuLoadFree;
+     
+        
+        // check calibration status      
+    	if (iCPULoadCalibrating)
+    	    {
+    	    iCPULoadCalibrationCounter++;        
+            cpuLoadSize = cpuLoadFree;
+            
+            // check if need to calibrate anymore
+     	    if (iCPULoadCalibrationCounter > KCalibrationLength)
+    	        {
+    	        iCPULoadCalibrating = EFalse;
+    	        
+                // from the samples, get the minimum value, and let it be the max value 
+        		for (TInt i=0; i<iSampleEntryArray->At(0).iSampleDataArray->Count(); i++)
+        		    {
+        		    TInt64 newCPULoadMaxValue = iCPULoadMaxValue;
+        		    
+        		    if (iSampleEntryArray->At(0).iSampleDataArray->At(i).iFree < newCPULoadMaxValue)
+        		        {
+        		        newCPULoadMaxValue = iSampleEntryArray->At(0).iSampleDataArray->At(i).iFree;
+        		        }
+        		    
+        		    iCPULoadMaxValue = newCPULoadMaxValue;     		    
+        		    }	        
+    	        
+    	        // adjust priority of the poller thread
+                if (iCurrentCPUMode == ECPUModeNOPs)
+                    {
+                    iCPULoadThread.SetPriority(EPriorityAbsoluteVeryLow);
+                    }    	        
+    	        }
+
+    	    }
+    	else
+    	    {
+            cpuLoadSize = iCPULoadMaxValue;
+    	    }            
+        }
+
+	
+	// save cpu sample data    
+    TSampleData cpuSample;
+    cpuSample.iFree = cpuLoadFree;
+    cpuSample.iSize = cpuLoadSize;
+    cpuSample.iTimeFromStart = currentTime.MicroSecondsFrom(iStartTime);
+
+    iSampleEntryArray->At(0).iSampleDataArray->InsertL(0, cpuSample);
+    
+ 
+    
+    // get ram memory
+    TMemoryInfoV1Buf ramMemory;
+    UserHal::MemoryInfo(ramMemory);
+    
+    TSampleData memorySample;
+    memorySample.iFree = ramMemory().iFreeRamInBytes;
+    memorySample.iSize = ramMemory().iMaxFreeRamInBytes;
+    memorySample.iTimeFromStart = currentTime.MicroSecondsFrom(iStartTime);
+
+    iSampleEntryArray->At(1).iSampleDataArray->InsertL(0, memorySample); 
+    
+    
+    // all drives
+    for (TInt i=2; i<iSampleEntryArray->Count(); i++)
+        {
+        TSampleData driveSample;
+        
+        // get volume info from RFs
+        TVolumeInfo volumeInfo;
+        if (iEnv->FsSession().Volume(volumeInfo, iSampleEntryArray->At(i).iDriveNumber) == KErrNone)
+            {
+            driveSample.iFree = volumeInfo.iFree;
+            driveSample.iSize = volumeInfo.iSize;
+            }
+        else
+            {
+            driveSample.iFree = 0;
+            driveSample.iSize = 0;
+            }    
+
+        driveSample.iTimeFromStart = currentTime.MicroSecondsFrom(iStartTime);
+    
+        iSampleEntryArray->At(i).iSampleDataArray->InsertL(0, driveSample); 
+        }
+    
+    
+    // compress sample data arrays to save memory
+    TInt curLength(iSampleEntryArray->At(0).iSampleDataArray->Count());
+    
+    TInt maxSamples = iSettings.iMaxSamples >= KMinimumSamplesLength ? iSettings.iMaxSamples : KMinimumSamplesLength;
+    
+    if (curLength > maxSamples && curLength % 5 == 0)
+        {
+        for (TInt i=0; i<iSampleEntryArray->Count(); i++)
+            {
+            iSampleEntryArray->At(i).iSampleDataArray->ResizeL(maxSamples); // looses old samples
+            iSampleEntryArray->At(i).iSampleDataArray->Compress();
+            }         
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+    
+void CPerfMonModel::AppendLatestSamplesToLogsL()
+    {
+    if (iSettings.iLoggingEnabled && SampleEntryArray())
+        {
+        // loop all sources
+        for (TInt i=0; i<SampleEntryArray()->Count(); i++)
+            {
+            // check if this setting has been enabled and it has some data
+            if (iSettings.iLoggingSources.iSrcEnabled[i] && SampleEntryArray()->At(i).iSampleDataArray->Count() > 0)
+                {
+                // get current sample
+                TSampleData& currentSample = SampleEntryArray()->At(i).iSampleDataArray->At(0);
+                
+                TBuf<128> buf;
+                buf.Append(_L("PERFMON;"));
+                buf.Append(SampleEntryArray()->At(i).iDescription);
+                buf.Append(_L(";"));
+                buf.AppendNum(currentSample.iTimeFromStart.Int64());
+                buf.Append(_L(";"));
+                buf.AppendNum(currentSample.iFree);
+                buf.Append(_L(";"));
+                buf.AppendNum(currentSample.iSize);
+
+                // print to RDebug
+                if (iSettings.iLoggingMode == ELoggingModeRDebug || iSettings.iLoggingMode == ELoggingModeRDebugLogFile)
+                    {
+                    RDebug::Print(buf);
+                    }
+                
+                // print to log file
+                if (iSettings.iLoggingMode == ELoggingModeLogFile || iSettings.iLoggingMode == ELoggingModeRDebugLogFile)
+                    {
+                    buf.Append(_L("\r\n"));
+                    
+                    TBuf8<128> buf8;
+                    buf8.Copy(buf);
+                    
+                    iLogFile.Write(buf8);
+                    }        
+                }
+            }
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::SetValuesContainer(CPerfMonValuesContainer* aContainer)
+    {
+    iValuesContainer = aContainer;
+    iDrawState = EDrawStateValues;
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::SetGraphsContainer(CPerfMonGraphsContainer* aContainer)
+    {
+    iGraphsContainer = aContainer;
+    iDrawState = EDrawStateGraphs;
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::SendDrawEventToContainersL()
+    {
+    if (iDrawState == EDrawStateValues && iValuesContainer)
+        iValuesContainer->DrawUpdate();
+    else if (iDrawState == EDrawStateGraphs && iGraphsContainer)
+        iGraphsContainer->DrawUpdate();
+           
+    if (iDataPopupContainer)
+        iDataPopupContainer->DrawUpdate();
+    }
+            
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::LoadSettingsL()
+    {
+    // set defaults
+    iSettings.iHeartBeat = 600;
+    iSettings.iMaxSamples = 64;
+    iSettings.iPriority = EThreadPriorityTypeNormal;
+    iSettings.iCPUMode = ECPUModeCPUTime;
+    iSettings.iKeepBacklightOn = ETrue;
+
+    iSettings.iDataPopupVisibility = EDataPopupVisbilityAlwaysOn;
+    iSettings.iDataPopupLocation = EDataPopupLocationTopRight;
+    iSettings.iDataPopupSources.SetDefaults1();
+
+    iSettings.iGraphsVerticalBarPeriod = 5;
+    iSettings.iGraphsSources.SetDefaults2();
+
+    iSettings.iLoggingMode = ELoggingModeRDebug;
+    iSettings.iLoggingFilePath.Copy(KDefaultLogFilePath);
+    iSettings.iLoggingSources.SetDefaults2();
+    
+    iSettings.iLoggingEnabled = EFalse;
+
+
+    // make sure that the private path of this app in c-drive exists
+    iEnv->FsSession().CreatePrivatePath( KSettingsDrive ); // c:\\private\\20011385\\
+    
+    // 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, KUidPerfMon);
+
+        LoadDFSValueL(settingsStore, KPMSettingHeartBeat,                   iSettings.iHeartBeat);
+        LoadDFSValueL(settingsStore, KPMSettingMaxSamples,                  iSettings.iMaxSamples);
+        LoadDFSValueL(settingsStore, KPMSettingPriority,                    iSettings.iPriority);
+        LoadDFSValueL(settingsStore, KPMSettingCPUMode,                     iSettings.iCPUMode);
+        LoadDFSValueL(settingsStore, KPMSettingKeepBackLightOn,             iSettings.iKeepBacklightOn);
+
+        LoadDFSValueL(settingsStore, KPMSettingDataPopupVisbility,          iSettings.iDataPopupVisibility);
+        LoadDFSValueL(settingsStore, KPMSettingDataPopupLocation,           iSettings.iDataPopupLocation);
+        LoadDFSValueL(settingsStore, KPMSettingDataPopupSources,            iSettings.iDataPopupSources);
+
+        LoadDFSValueL(settingsStore, KPMSettingGraphsVerticalBarPeriod,     iSettings.iGraphsVerticalBarPeriod);
+        LoadDFSValueL(settingsStore, KPMSettingGraphsSources,               iSettings.iGraphsSources);
+
+        LoadDFSValueL(settingsStore, KPMSettingLoggingMode,                 iSettings.iLoggingMode);
+        LoadDFSValueL(settingsStore, KPMSettingLoggingFilePath,             iSettings.iLoggingFilePath);
+        LoadDFSValueL(settingsStore, KPMSettingLoggingSources,              iSettings.iLoggingSources);
+
+        CleanupStack::PopAndDestroy(); // settingsStore         
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonModel::SaveSettingsL()
+    {
+    // handle settings always in c:\\private\\20011385\\
+    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, KUidPerfMon);
+
+        SaveDFSValueL(settingsStore, KPMSettingHeartBeat,                   iSettings.iHeartBeat);
+        SaveDFSValueL(settingsStore, KPMSettingMaxSamples,                  iSettings.iMaxSamples);
+        SaveDFSValueL(settingsStore, KPMSettingPriority,                    iSettings.iPriority);
+        SaveDFSValueL(settingsStore, KPMSettingCPUMode,                     iSettings.iCPUMode);
+        SaveDFSValueL(settingsStore, KPMSettingKeepBackLightOn,             iSettings.iKeepBacklightOn);
+
+        SaveDFSValueL(settingsStore, KPMSettingDataPopupVisbility,          iSettings.iDataPopupVisibility);
+        SaveDFSValueL(settingsStore, KPMSettingDataPopupLocation,           iSettings.iDataPopupLocation);
+        SaveDFSValueL(settingsStore, KPMSettingDataPopupSources,            iSettings.iDataPopupSources);
+
+        SaveDFSValueL(settingsStore, KPMSettingGraphsVerticalBarPeriod,     iSettings.iGraphsVerticalBarPeriod);
+        SaveDFSValueL(settingsStore, KPMSettingGraphsSources,               iSettings.iGraphsSources);
+
+        SaveDFSValueL(settingsStore, KPMSettingLoggingMode,                 iSettings.iLoggingMode);
+        SaveDFSValueL(settingsStore, KPMSettingLoggingFilePath,             iSettings.iLoggingFilePath);
+        SaveDFSValueL(settingsStore, KPMSettingLoggingSources,              iSettings.iLoggingSources);
+       
+        settingsStore->CommitL();
+        CleanupStack::PopAndDestroy(); // settingsStore             
+        }
+    }
+    	
+// --------------------------------------------------------------------------------------------
+
+TInt CPerfMonModel::LaunchSettingsDialogL()
+    {
+    // launch the settings dialog
+    TPerfMonSettings newSettings = iSettings;
+    
+    CPerfMonSettingsViewDlg* dlg = CPerfMonSettingsViewDlg::NewL(newSettings);
+    TInt returnValue = dlg->ExecuteLD(R_PERFMON_SETTINGS_DIALOG);
+    
+    // always save settings since the settings dialog does not provide a possibility to cancel
+    iSettings = newSettings;
+    SaveSettingsL();
+    HandleSettingsChangeL();
+
+    // make sure that the title of the application is correct
+    CEikStatusPane* sp = iEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL(KAppName);
+    
+    return returnValue;
+    }
+	
+// ---------------------------------------------------------------------------
+
+void CPerfMonModel::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 CPerfMonModel::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 CPerfMonModel::LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TPerfMonSources& aValue)
+    {
+    if (aDicFS->IsPresentL(aUid))
+        {
+        RDictionaryReadStream in;
+        in.OpenLC(*aDicFS, aUid);
+        TInt bufLength = in.ReadInt16L();   // get length of the array
+        
+        if (bufLength < 0 || bufLength > ESourcesLength)     // check for validaty
+            User::Leave(KErrNotSupported);
+        
+        for (TInt i=0; i<bufLength; i++)    // get all items
+            aValue.iSrcEnabled[i] = in.ReadInt16L();
+        
+        CleanupStack::PopAndDestroy(); // in
+        }
+    }
+    
+// ---------------------------------------------------------------------------
+
+void CPerfMonModel::SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue)
+    {
+    RDictionaryWriteStream out;
+    out.AssignLC(*aDicFS, aUid);
+    out.WriteInt16L(aValue);
+    out.CommitL(); 	
+    CleanupStack::PopAndDestroy(); // out
+    }
+
+// ---------------------------------------------------------------------------
+
+void CPerfMonModel::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(); // out
+    }
+
+// ---------------------------------------------------------------------------
+
+void CPerfMonModel::SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TPerfMonSources& aValue)
+    {
+    RDictionaryWriteStream out;
+    out.AssignLC(*aDicFS, aUid);
+    
+    out.WriteInt16L(ESourcesLength);        // write length of the array
+    
+    for (TInt i=0; i<ESourcesLength; i++)   // write all items
+        out.WriteInt16L(aValue.iSrcEnabled[i]);
+    
+    out.CommitL(); 	
+    CleanupStack::PopAndDestroy(); // out
+    }
+    
+// ---------------------------------------------------------------------------
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/src/perfmon_settingsviewdlg.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,681 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "perfmon_settingsviewdlg.h"
+#include "perfmon_model.h"
+#include "perfmon.hrh"
+#include "perfmon_std.h"
+#include <perfmon.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 =====================================
+
+CPerfMonSettingsViewDlg* CPerfMonSettingsViewDlg::NewL(TPerfMonSettings& aSettings)
+    {
+    CPerfMonSettingsViewDlg* self = new(ELeave) CPerfMonSettingsViewDlg(aSettings);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPerfMonSettingsViewDlg::~CPerfMonSettingsViewDlg()
+    {
+    // restore default navi pane by popping the tab group from stack
+    if (iNaviContainer)
+        iNaviContainer->Pop();
+    
+    if (iSettingItemArray)
+        {
+        iSettingItemArray->ResetAndDestroy();
+        delete iSettingItemArray; 
+        }
+    
+    delete iDecoratedTabGroup;   
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPerfMonSettingsViewDlg::CPerfMonSettingsViewDlg(TPerfMonSettings& aSettings) : iSettings(aSettings)
+    {
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonSettingsViewDlg::ConstructL()
+    {
+    // construct a menu bar
+    CAknDialog::ConstructL(R_PERFMON_SETTINGS_MENUBAR);
+
+    // get pointer to status pane   
+    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
+    
+    // set title text
+    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    tp->SetTextL( _L("Settings") );
+    
+    // create a new tab group
+    iNaviContainer = static_cast<CAknNavigationControlContainer*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
+    iDecoratedTabGroup = iNaviContainer->CreateTabGroupL(this);
+    iTabGroup = static_cast<CAknTabGroup*>(iDecoratedTabGroup->DecoratedControl());
+    iTabGroup->SetTabFixedWidthL(KTabWidthWithTwoLongTabs); 
+    
+    // add tabs
+    iTabGroup->AddTabL(ETabSettingsGeneral, _L("General"));
+    iTabGroup->AddTabL(ETabSettingsDataPopup, _L("Data popup"));
+    iTabGroup->AddTabL(ETabSettingsGraphs, _L("Graphs"));
+    iTabGroup->AddTabL(ETabSettingsLogging, _L("Logging"));
+    iTabGroup->SetActiveTabByIndex(ETabSettingsGeneral);
+    
+    // add new tab group to stack
+    iNaviContainer->PushL( *iDecoratedTabGroup );
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonSettingsViewDlg::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+    {
+    switch (aEventType)
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemDoubleClicked:
+            ShowSettingPageL(EFalse);
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonSettingsViewDlg::TabChangedL(TInt /*aIndex*/)
+    {
+    iListBox->SetCurrentItemIndex(0);
+
+    SetVisibilitiesOfSettingItemsL();   
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonSettingsViewDlg::ProcessCommandL(TInt aCommandId)
+    {
+    CAknDialog::ProcessCommandL(aCommandId);
+
+    switch (aCommandId)
+        {
+        case EPerfMonCmdSettingsChange:
+            ShowSettingPageL(ETrue);
+            break;
+        case EPerfMonCmdSettingsExit:
+            TryExitL(EAknCmdExit);
+            break;
+        default:
+            break;
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CPerfMonSettingsViewDlg::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 CPerfMonSettingsViewDlg::PreLayoutDynInitL()
+    {
+    iListBox = static_cast<CAknSettingStyleListBox*>( Control(EPerfMonSettingItemList) );
+    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 CPerfMonSettingsViewDlg::OkToExitL(TInt aButtonId)
+    {
+    return CAknDialog::OkToExitL(aButtonId);
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonSettingsViewDlg::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 CPerfMonSettingsViewDlg::SetVisibilitiesOfSettingItemsL()
+    {
+    if (iSettingItemArray->Count() > 0)
+        {
+        switch (iTabGroup->ActiveTabIndex())
+            {
+            case ETabSettingsGeneral:
+                {
+                ((*iSettingItemArray)[ESettingListItemHeartBeat])->SetHidden(EFalse);
+                ((*iSettingItemArray)[ESettingListItemMaxSamples])->SetHidden(EFalse);
+                ((*iSettingItemArray)[ESettingListItemPriority])->SetHidden(EFalse);
+                ((*iSettingItemArray)[ESettingListItemCPUMode])->SetHidden(EFalse);
+                ((*iSettingItemArray)[ESettingListItemKeepBackLightOn])->SetHidden(EFalse);
+
+                ((*iSettingItemArray)[ESettingListItemDataPopupVisbility])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemDataPopupLocation])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemDataPopupSources])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemGraphsVerticalBarPeriod])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemGraphsSources])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemLoggingMode])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemLoggingSources])->SetHidden(ETrue);
+
+                break;
+                }
+            
+            case ETabSettingsDataPopup:
+                {
+                ((*iSettingItemArray)[ESettingListItemHeartBeat])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemMaxSamples])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemPriority])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemCPUMode])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemKeepBackLightOn])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemDataPopupVisbility])->SetHidden(EFalse);
+                ((*iSettingItemArray)[ESettingListItemDataPopupLocation])->SetHidden(EFalse);
+                ((*iSettingItemArray)[ESettingListItemDataPopupSources])->SetHidden(EFalse);
+
+                ((*iSettingItemArray)[ESettingListItemGraphsVerticalBarPeriod])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemGraphsSources])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemLoggingMode])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemLoggingSources])->SetHidden(ETrue);
+
+                break;
+                }
+
+            case ETabSettingsGraphs:
+                {
+                ((*iSettingItemArray)[ESettingListItemHeartBeat])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemMaxSamples])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemPriority])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemCPUMode])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemKeepBackLightOn])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemDataPopupVisbility])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemDataPopupLocation])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemDataPopupSources])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemGraphsVerticalBarPeriod])->SetHidden(EFalse);
+                ((*iSettingItemArray)[ESettingListItemGraphsSources])->SetHidden(EFalse);
+
+                ((*iSettingItemArray)[ESettingListItemLoggingMode])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemLoggingSources])->SetHidden(ETrue);
+
+                break;
+                }
+
+            case ETabSettingsLogging:
+                {
+                ((*iSettingItemArray)[ESettingListItemHeartBeat])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemMaxSamples])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemPriority])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemCPUMode])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemKeepBackLightOn])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemDataPopupVisbility])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemDataPopupLocation])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemDataPopupSources])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemGraphsVerticalBarPeriod])->SetHidden(ETrue);
+                ((*iSettingItemArray)[ESettingListItemGraphsSources])->SetHidden(ETrue);
+
+                ((*iSettingItemArray)[ESettingListItemLoggingMode])->SetHidden(EFalse);
+                
+                if (iSettings.iLoggingMode == ELoggingModeLogFile || iSettings.iLoggingMode == ELoggingModeRDebugLogFile)
+                    ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(EFalse);
+                else
+                    ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(ETrue);
+                
+                ((*iSettingItemArray)[ESettingListItemLoggingSources])->SetHidden(EFalse);
+
+                break;
+                }                
+
+            default:
+                User::Panic(_L("TabIOOB"), 50);
+                break;
+            }
+
+        iSettingItemArray->RecalculateVisibleIndicesL();
+        iListBox->HandleItemAdditionL();
+        iListBox->UpdateScrollBarsL();
+        }
+    }   
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonSettingsViewDlg::UpdateListBoxL()
+    {
+    iSettingItemArray->ResetAndDestroy();
+
+    // create items
+    TInt ordinal(0);
+
+    AddSettingItemL(ESettingListItemHeartBeat,
+                    R_HEARTBEAT_SETTING_TITLE,
+                    R_HEARTBEAT_SETTING_PAGE,
+                    NULL,
+                    ordinal++);    
+    
+    AddSettingItemL(ESettingListItemMaxSamples,
+                    R_MAXSAMPLES_SETTING_TITLE,
+                    R_MAXSAMPLES_SETTING_PAGE,
+                    NULL,
+                    ordinal++);
+
+    AddSettingItemL(ESettingListItemPriority,
+                    R_PRIORITY_SETTING_TITLE,
+                    R_PRIORITY_SETTING_PAGE,
+                    R_PRIORITY_SETTING_TEXTS,
+                    ordinal++);
+
+    AddSettingItemL(ESettingListItemCPUMode,
+                    R_CPUMODE_SETTING_TITLE,
+                    R_CPUMODE_SETTING_PAGE,
+                    R_CPUMODE_SETTING_TEXTS,
+                    ordinal++);
+
+    AddSettingItemL(ESettingListItemKeepBackLightOn,
+                    R_KEEPBACKLIGHTON_SETTING_TITLE,
+                    R_BINARY_SETTING_PAGE,
+                    R_YESNO_BINARYSELECTION_TEXTS,
+                    ordinal++);
+//
+    AddSettingItemL(ESettingListItemDataPopupVisbility,
+                    R_DATAPOPUPVISIBILITY_SETTING_TITLE,
+                    R_DATAPOPUPVISIBILITY_SETTING_PAGE,
+                    R_DATAPOPUPVISIBILITY_SETTING_TEXTS,
+                    ordinal++);
+
+    AddSettingItemL(ESettingListItemDataPopupLocation,
+                    R_DATAPOPUPLOCATION_SETTING_TITLE,
+                    R_DATAPOPUPLOCATION_SETTING_PAGE,
+                    R_DATAPOPUPLOCATION_SETTING_TEXTS,
+                    ordinal++);
+
+    AddSettingItemL(ESettingListItemDataPopupSources,
+                    R_SOURCES_SETTING_TITLE,
+                    R_SOURCES_SETTING_PAGE,
+                    NULL,
+                    ordinal++);                    
+//
+    AddSettingItemL(ESettingListItemGraphsVerticalBarPeriod,
+                    R_GRAPHSVERTICALBAR_SETTING_TITLE,
+                    R_GRAPHSVERTICALBAR_SETTING_PAGE,
+                    NULL,
+                    ordinal++);
+    
+    AddSettingItemL(ESettingListItemGraphsSources,
+                    R_SOURCES_SETTING_TITLE,
+                    R_SOURCES_SETTING_PAGE,
+                    NULL,
+                    ordinal++);                    
+//
+    AddSettingItemL(ESettingListItemLoggingMode,
+                    R_LOGGINGMODE_SETTING_TITLE,
+                    R_LOGGINGMODE_SETTING_PAGE,
+                    R_LOGGINGMODE_SETTING_TEXTS,
+                    ordinal++);
+
+     AddSettingItemL(ESettingListItemLoggingFilePath,
+                    R_LOGGINGFILEPATH_SETTING_TITLE,
+                    R_LOGGINGFILEPATH_SETTING_PAGE,
+                    NULL,
+                    ordinal++);
+    
+    AddSettingItemL(ESettingListItemLoggingSources,
+                    R_SOURCES_SETTING_TITLE,
+                    R_SOURCES_SETTING_PAGE,
+                    NULL,
+                    ordinal++);                    
+                                                             
+    SetVisibilitiesOfSettingItemsL(); 
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonSettingsViewDlg::AddSettingItemL(TInt aId,
+                                                 TInt aTitleResource,
+                                                 TInt aSettingPageResource,
+                                                 TInt aAssociatedResource,
+                                                 TInt aOrdinal)
+    {
+    // create a setting item
+    CAknSettingItem* settingItem = NULL;
+    
+    switch (aId)
+        {
+        case ESettingListItemHeartBeat:
+            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aId, iSettings.iHeartBeat);
+            break;
+
+        case ESettingListItemMaxSamples:
+            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aId, iSettings.iMaxSamples);
+            break;
+
+        case ESettingListItemPriority:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iPriority);
+            break;
+
+        case ESettingListItemCPUMode:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iCPUMode);
+            break;
+
+        case ESettingListItemKeepBackLightOn:
+            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iKeepBacklightOn);
+            break;
+
+        case ESettingListItemDataPopupVisbility:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iDataPopupVisibility);
+            break;
+
+        case ESettingListItemDataPopupLocation:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iDataPopupLocation);
+            break;
+
+        case ESettingListItemDataPopupSources:
+            settingItem = new(ELeave) CSourceSelectionCheckBoxSettingItem(aId, iSettings.iDataPopupSources);
+            break;
+
+        case ESettingListItemGraphsVerticalBarPeriod:
+            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aId, iSettings.iGraphsVerticalBarPeriod);
+            break;
+
+        case ESettingListItemGraphsSources:
+            settingItem = new(ELeave) CSourceSelectionCheckBoxSettingItem(aId, iSettings.iGraphsSources);
+            break;
+
+        case ESettingListItemLoggingMode:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iLoggingMode);
+            break;
+
+        case ESettingListItemLoggingFilePath:
+            settingItem = new(ELeave) CAknTextSettingItem(aId, iSettings.iLoggingFilePath);
+            break;
+
+        case ESettingListItemLoggingSources:
+            settingItem = new(ELeave) CSourceSelectionCheckBoxSettingItem(aId, iSettings.iLoggingSources);
+            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
+    }
+
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+	
+CSourceSelectionCheckBoxSettingItem::CSourceSelectionCheckBoxSettingItem( TInt aIdentifier, TPerfMonSources& aMemoryInUse ): 
+	CAknSettingItem(aIdentifier), iExternalSources( aMemoryInUse ) 
+	{
+	}	
+
+CSourceSelectionCheckBoxSettingItem::~CSourceSelectionCheckBoxSettingItem()
+	{
+	delete iSettingText;
+
+    if( iItemArray )
+        {
+        iItemArray->ResetAndDestroy();
+        delete iItemArray;
+        }
+	}
+
+void CSourceSelectionCheckBoxSettingItem::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 CSourceSelectionCheckBoxSettingItem::CompleteConstructionL()
+	{
+    SetEmptyItemTextL(_L("Nothing selected"));
+
+    iItemArray = new(ELeave) CSelectionItemList(16);
+    AddNewItemToArrayL(_L("CPU"));
+    AddNewItemToArrayL(_L("RAM"));
+    AddNewItemToArrayL(_L("C:"));
+    AddNewItemToArrayL(_L("D:"));
+    AddNewItemToArrayL(_L("E:"));
+    AddNewItemToArrayL(_L("F:"));
+    AddNewItemToArrayL(_L("G:"));
+    AddNewItemToArrayL(_L("H:"));
+    AddNewItemToArrayL(_L("I:"));
+
+	__ASSERT_ALWAYS(ESourcesLength==iItemArray->Count(), User::Panic(_L("Src.mismatch"),443));
+    }
+
+// transfer settings to the variables defined in the constructor    	
+void CSourceSelectionCheckBoxSettingItem::StoreL()
+	{
+	for (TInt i=0; i<ESourcesLength; i++)
+	    {
+        iExternalSources.iSrcEnabled[i] = iItemArray->At(i)->SelectionStatus();
+	    }
+	}
+
+// load settings from the variables defined in the constructor to our internal variables
+void CSourceSelectionCheckBoxSettingItem::LoadL()
+	{
+	for (TInt i=0; i<ESourcesLength; i++)
+	    {
+        iItemArray->At(i)->SetSelectionStatus( iExternalSources.iSrcEnabled[i] );
+	    }
+	}
+
+// returns the text shown in the setting item list
+const TDesC& CSourceSelectionCheckBoxSettingItem::SettingTextL()
+	{
+    TBuf<32> settingText;
+
+    if (iItemArray->At(ESourceCPU)->SelectionStatus())
+        settingText.Append(_L("CPU "));
+    if (iItemArray->At(ESourceRAM)->SelectionStatus())
+        settingText.Append(_L("RAM "));
+    if (iItemArray->At(ESourceC)->SelectionStatus())
+        settingText.Append(_L("C: "));
+    if (iItemArray->At(ESourceD)->SelectionStatus())
+        settingText.Append(_L("D: "));
+    if (iItemArray->At(ESourceE)->SelectionStatus())
+        settingText.Append(_L("E: "));
+    if (iItemArray->At(ESourceF)->SelectionStatus())
+        settingText.Append(_L("F: "));
+    if (iItemArray->At(ESourceG)->SelectionStatus())
+        settingText.Append(_L("G: "));
+    if (iItemArray->At(ESourceH)->SelectionStatus())
+        settingText.Append(_L("H: "));
+    if (iItemArray->At(ESourceI)->SelectionStatus())
+        settingText.Append(_L("I: "));
+    settingText.TrimAll();
+
+    if (iSettingText)
+        {
+        delete iSettingText;
+        iSettingText = NULL;
+        }
+
+    iSettingText = HBufC::NewL(settingText.Length());
+    iSettingText->Des().Copy(settingText);
+
+	if ( iSettingText->Length() > 0 )
+		return *iSettingText;
+	else
+		return EmptyItemText();
+	}
+
+
+// launches the setting page
+void CSourceSelectionCheckBoxSettingItem::EditItemL(TBool /*aCalledFromMenu*/)
+	{
+	CSourceSelectionCheckBoxSettingPage* dlg = new(ELeave) CSourceSelectionCheckBoxSettingPage(SettingPageResourceId(), iItemArray);
+
+	SetSettingPage( dlg );
+	SettingPage()->SetSettingPageObserver(this);
+
+	SettingPage()->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
+	SetSettingPage(0); // it is deleted now
+	}
+
+
+// handles setting page events
+void CSourceSelectionCheckBoxSettingItem::HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType )
+    {
+    switch( aEventType )
+        {
+        case EEventSettingCancelled:
+            {
+            // If setting is cancelled, load old values
+            LoadL();
+            break;
+            }
+        case EEventSettingChanged:
+            {
+            // If setting has changed, update CBA visibility
+            static_cast<CSourceSelectionCheckBoxSettingPage*>( aSettingPage )->UpdateCba();
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    CAknSettingItem::HandleSettingPageEventL( aSettingPage, aEventType );
+    }
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+
+CSourceSelectionCheckBoxSettingPage::CSourceSelectionCheckBoxSettingPage(TInt aResourceID, CSelectionItemList* aItemArray )
+    : CAknCheckBoxSettingPage( aResourceID, aItemArray )
+	{
+	}
+
+void CSourceSelectionCheckBoxSettingPage::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 );
+		}
+	}
+
+// --------------------------------------------------------------------------------------------
+// --------------------------------------------------------------------------------------------
+    
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/src/perfmon_valuescontainer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "perfmon_valuescontainer.h"
+#include "perfmon.hrh"
+#include "perfmon_document.h"
+#include "perfmon_appui.h"
+#include "perfmon_model.h"
+
+#include <AknUtils.h>
+
+_LIT(KPercentageFormat,"%S %d%%");
+_LIT(KFreeFormat,"%S free %S%S"); 
+_LIT(KSizeFormat,"%S size %S%S"); 
+
+const TInt KLeftMargin = 2;
+
+
+// ===================================== MEMBER FUNCTIONS =====================================
+
+void CPerfMonValuesContainer::ConstructL(const TRect& aRect)
+    {
+    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    iFont = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);
+ 
+    CreateWindowL();
+    SetRect(aRect);
+    SetBlank();
+
+    ActivateL();
+    }
+
+// --------------------------------------------------------------------------------------------
+
+CPerfMonValuesContainer::~CPerfMonValuesContainer()
+    {
+    }
+    
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonValuesContainer::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+    gc.SetBrushColor(KRgbWhite);
+    gc.Clear(aRect);
+    
+    // check if sample array has been constructed
+    if (iModel->SampleEntryArray())
+        {
+        // init font
+        gc.SetPenColor(KRgbBlack);
+        gc.UseFont( iFont );
+        TUint separator = iFont->HeightInPixels()-2;
+
+        TInt c(1);
+
+        // draw all entries
+        for (TInt i=0; i<iModel->SampleEntryArray()->Count(); i++)
+            {
+            // check if data available
+            if (iModel->SampleEntryArray()->At(i).iSampleDataArray->Count() > 0)
+                {
+                TSampleData& currentSample = iModel->SampleEntryArray()->At(i).iSampleDataArray->At(0);
+                
+                if (i == ESourceCPU) // for CPU draw %
+                    {
+                    TBuf<16> buf;
+                    buf.Format(KPercentageFormat, &iModel->SampleEntryArray()->At(i).iDescription, currentSample.iSize > 0 ? TInt( (1 - ((TReal)(currentSample.iFree) / (TReal)currentSample.iSize)) * 100) : 0 );
+                    gc.DrawText(buf, TPoint(KLeftMargin,separator*c));
+                    c++;
+                    }
+                
+                else if (currentSample.iSize > 0) // ram+drives, ignore absent drives
+                    {
+                    TBuf<32> amountBuf;
+                    amountBuf.AppendNum(currentSample.iFree, TRealFormat(KDefaultRealWidth, 0));
+        
+                    TBuf<32> buf;
+                    buf.Format(KFreeFormat, &iModel->SampleEntryArray()->At(i).iDescription, &amountBuf, &iModel->SampleEntryArray()->At(i).iUnitTypeShort);
+                    gc.DrawText(buf, TPoint(KLeftMargin,separator*c));
+                    c++;
+                    
+                    amountBuf.Copy(KNullDesC);
+                    amountBuf.AppendNum(currentSample.iSize, TRealFormat(KDefaultRealWidth, 0));
+        
+                    buf.Format(KSizeFormat, &iModel->SampleEntryArray()->At(i).iDescription, &amountBuf, &iModel->SampleEntryArray()->At(i).iUnitTypeShort);
+                    gc.DrawText(buf, TPoint(KLeftMargin,separator*c));
+                    c++;            
+                    }                    
+                }
+            }
+           
+        gc.DiscardFont();        
+        }
+    }
+
+// --------------------------------------------------------------------------------------------
+
+TKeyResponse CPerfMonValuesContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
+    {
+    return CCoeControl::OfferKeyEventL(aKeyEvent, aType);
+    }
+        
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonValuesContainer::HandleResourceChange(TInt aType)
+    {
+    if (aType == KEikDynamicLayoutVariantSwitch)
+        {
+        TRect mainPaneRect;
+        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
+        SetRect(mainPaneRect);
+        }
+    else
+        CCoeControl::HandleResourceChange(aType);    
+    }
+
+// --------------------------------------------------------------------------------------------
+
+void CPerfMonValuesContainer::DrawUpdate()
+    {
+    DrawDeferred(); 
+    }
+    
+// --------------------------------------------------------------------------------------------
+       
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/perfmon/src/perfmon_valuesview.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,147 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "perfmon.hrh"
+#include "perfmon_valuesview.h"
+#include "perfmon_valuescontainer.h"
+#include "perfmon_document.h" 
+#include "perfmon_model.h"
+#include <perfmon.rsg>
+
+#include <eikenv.h>
+#include <aknViewAppUi.h> 
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CPerfMonValuesView::ConstructL(const TRect& aRect)
+// EPOC two-phased constructor
+// ---------------------------------------------------------
+//
+void CPerfMonValuesView::ConstructL()
+    {
+    BaseConstructL( R_PERFMON_VIEW_VALUES );
+    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+    }
+
+// ---------------------------------------------------------
+// CPerfMonValuesView::~CPerfMonValuesView()
+// ---------------------------------------------------------
+//
+CPerfMonValuesView::~CPerfMonValuesView()
+    {
+    if (iContainer)
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// ---------------------------------------------------------
+// TUid CPerfMonValuesView::Id()
+// ---------------------------------------------------------
+//
+TUid CPerfMonValuesView::Id() const
+    {
+    return KValuesViewUID;
+    }
+
+// ---------------------------------------------------------
+// TUid CPerfMonValuesView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+// ---------------------------------------------------------
+//
+void CPerfMonValuesView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
+    }
+
+  
+// ---------------------------------------------------------
+// CPerfMonValuesView::HandleCommandL(TInt aCommand)
+// ---------------------------------------------------------
+//
+void CPerfMonValuesView::HandleCommandL(TInt aCommand)
+    {   
+/*
+    switch ( aCommand )
+        {
+        case EPerfMonCmdFileBack:
+            {
+            iModel->FileUtils()->MoveUpOneLevelL();
+            break;
+            }
+
+        default:
+            {
+*/
+            AppUi()->HandleCommandL( aCommand );
+/*
+            break;
+            }
+        }
+*/
+    }
+
+// ---------------------------------------------------------
+// CPerfMonValuesView::HandleClientRectChange()
+// ---------------------------------------------------------
+//
+void CPerfMonValuesView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CPerfMonValuesView::DoActivateL(...)
+// ---------------------------------------------------------
+//
+void CPerfMonValuesView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CPerfMonValuesContainer;
+        iModel->SetValuesContainer(iContainer);
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+   }
+
+// ---------------------------------------------------------
+// CPerfMonValuesView::DoDeactivate()
+// ---------------------------------------------------------
+//
+void CPerfMonValuesView::DoDeactivate()
+    {
+    if (iContainer)
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        delete iContainer;
+        iContainer = NULL;
+        }
+    }
+
+// End of File
--- a/perfmon/ui/avkon/group/bld.inf	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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
-perfmon.mmp
--- a/perfmon/ui/avkon/group/perfmon.mmp	Tue Aug 31 15:15:20 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:  
-*
-*/
-
-
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-
-
-TARGET            PerfMon.exe
-TARGETTYPE        exe
-EPOCSTACKSIZE     0x5000
-EPOCHEAPSIZE      0x10000 0x1000000  // Min 64Kb, Max 16Mb
-
-UID               0x100039CE 0x20011385
-
-VENDORID          VID_DEFAULT
-CAPABILITY        WriteDeviceData
-
-SMPSAFE
-
-LANG              SC
-
-
-START RESOURCE    ../../../data/perfmon.rss
-HEADER
-TARGETPATH        APP_RESOURCE_DIR
-END
-
-START RESOURCE    ../../../data/perfmon_reg.rss
-DEPENDS           perfmon.rsg
-TARGETPATH        /private/10003a3f/apps
-END
-
-APP_LAYER_SYSTEMINCLUDE
-USERINCLUDE       ../inc
-SOURCEPATH        ../src
-
-SOURCE            perfmon_app.cpp
-SOURCE            perfmon_document.cpp 
-SOURCE            perfmon_appui.cpp
-SOURCE            perfmon_model.cpp
-SOURCE            perfmon_valuesview.cpp 
-SOURCE            perfmon_valuescontainer.cpp 
-SOURCE            perfmon_graphsview.cpp 
-SOURCE            perfmon_graphscontainer.cpp 
-SOURCE            perfmon_settingsviewdlg.cpp
-SOURCE            perfmon_datapopupcontainer.cpp 
-
-USERINCLUDE       ../../../engine/inc
-SOURCEPATH        ../../../engine/src
-SOURCE            perfmon_engine.cpp
-
-LIBRARY           euser.lib
-LIBRARY           commonengine.lib
-LIBRARY           apparc.lib
-LIBRARY           cone.lib 
-LIBRARY           eikcore.lib
-LIBRARY           eikcoctl.lib
-LIBRARY           eikdlg.lib  
-LIBRARY           avkon.lib 
-LIBRARY           ws32.lib 
-LIBRARY           apgrfx.lib
-LIBRARY           efsrv.lib
-LIBRARY           bafl.lib
-LIBRARY           gdi.lib
-LIBRARY           estor.lib
-
-// End of File
--- a/perfmon/ui/avkon/inc/perfmon_app.h	Tue Aug 31 15:15:20 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 PERFMON_APP_H
-#define PERFMON_APP_H
-
-
-// INCLUDES
-#include <aknapp.h>
-
-// CONSTANTS
-// UID of the application
-const TUid KUidPerfMon = { 0x20011385 };
-
-// CLASS DECLARATION
-
-/**
-* CPerfMonApp application class.
-* Provides factory to create concrete document object.
-* 
-*/
-class CPerfMonApp : 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 CPerfMonDocument document object.
-        * @return A pointer to the created document object.
-        */
-        CApaDocument* CreateDocumentL();
-        
-        /**
-        * From CApaApplication, returns application's UID (KUidPerfMon).
-        * @return The value of KUidPerfMon.
-        */
-        TUid AppDllUid() const;
-    };
-
-#endif
-
-// End of File
-
--- a/perfmon/ui/avkon/inc/perfmon_appui.h	Tue Aug 31 15:15:20 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 PERFMON_APPUI_H
-#define PERFMON_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 "perfmon_std.h"
-
-// FORWARD DECLARATIONS
-class CPerfMonModel;
-class CAknNavigationControlContainer;
-class CAknTabGroup;
-class CAknNavigationDecorator;
-
-
-// CLASS DECLARATIONS
-
-class CPerfMonAppUi : public CAknViewAppUi
-    {
-    public: // // Constructors and destructor
-
-        void ConstructL();
-
-        ~CPerfMonAppUi();
-        
-    public: // New functions
-
-    private:
-        // From MEikMenuObserver
-        void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
-
-    private:
-        void HandleForegroundEventL(TBool aForeground); 
-
-        void HandleCommandL(TInt aCommand);
-
-        void HandleResourceChangeL(TInt aType);
-
-        virtual TKeyResponse HandleKeyEventL(
-            const TKeyEvent& aKeyEvent,TEventCode aType);
-
-    private: //Data
-        CPerfMonModel*                  iModel;
-        CAknNavigationControlContainer* iNaviPane;
-        CAknTabGroup*                   iTabGroup;
-        CAknNavigationDecorator*        iDecoratedTabGroup;
-    };
-
-#endif
-
-// End of File
--- a/perfmon/ui/avkon/inc/perfmon_datapopupcontainer.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef PERFMON_DATAPOPUPCONTAINER_H
-#define PERFMON_DATAPOPUPCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-
-#include "perfmon_drawcallback.h"
-
-
-// FORWARD DECLARATIONS
-class CPerfMonModel;
-
-
-// CLASS DECLARATIONS
-
-class CPerfMonDataPopupContainer : public CCoeControl, public MDrawUpdateCallback
-    {
-public:
-    void ConstructL(const TRect& aRect);
-    ~CPerfMonDataPopupContainer();
-
-protected:
-    void Draw(const TRect& aRect) const;
-    virtual void SizeChanged();    
-
-public:
-    void SetPositionAndSize();
-    void UpdateVisibility(TBool aForeground=ETrue);
-
-public: // from MDrawUpdateCallback
-    void DrawUpdate();
-
-private:
-    CPerfMonModel*                      iModel;
-    RWindowGroup                        iWindowGroup;
-    const CFont*                        iFont; 
-    TInt                                iFontSize;
-    };
-    
-#endif
-
-// End of File
--- a/perfmon/ui/avkon/inc/perfmon_document.h	Tue Aug 31 15:15:20 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 PERFMON_DOCUMENT_H
-#define PERFMON_DOCUMENT_H
-
-// INCLUDES
-#include <AknDoc.h>
-   
-// CONSTANTS
-
-// FORWARD DECLARATIONS
-class CEikAppUi;
-class CPerfMonModel;
-
-
-// CLASS DECLARATION
-
-/**
-*  CPerfMonDocument application class.
-*/
-class CPerfMonDocument : public CAknDocument
-    {
-    public: // Constructors and destructor
-        static CPerfMonDocument* NewL(CEikApplication& aApp);
-        virtual ~CPerfMonDocument();
-
-    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.
-        */
-        CPerfMonDocument(CEikApplication& aApp);
-        void ConstructL();
-
-    private:
-
-        /**
-        * From CEikDocument, create CPerfMonAppUi "App UI" object.
-        */
-        CEikAppUi* CreateAppUiL();
-
-    public:
-        inline CPerfMonModel* Model() { return iModel; }
-
-    private:
-        CPerfMonModel* iModel;
-
-    };
-
-#endif
-
-// End of File
-
--- a/perfmon/ui/avkon/inc/perfmon_drawcallback.h	Tue Aug 31 15:15:20 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 PERFMON_DRAWCALLBACK_H
-#define PERFMON_DRAWCALLBACK_H
-
-class MDrawUpdateCallback
-    {
-public:
-    virtual void DrawUpdate() = 0;    
-    };
-
-#endif
-
-// End of File
-
--- a/perfmon/ui/avkon/inc/perfmon_graphscontainer.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef PERFMON_GRAPHSCONTAINER_H
-#define PERFMON_GRAPHSCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-
-#include "perfmon_drawcallback.h"
-
-
-// FORWARD DECLARATIONS
-class CPerfMonModel;
-
-
-// CLASS DECLARATIONS
-
-class CPerfMonGraphsContainer : public CCoeControl, public MDrawUpdateCallback
-    {
-public:
-    void ConstructL(const TRect& aRect);
-    ~CPerfMonGraphsContainer();
-
-private:
-    void Draw(const TRect& aRect) const;
-    void HandleResourceChange(TInt aType);
-
-public:
-	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/);
-
-public: // from MDrawUpdateCallback
-    void DrawUpdate();
-
-private:
-    CPerfMonModel*                      iModel;
-    const CFont*                        iFont;
-    };
-    
-#endif
-
-// End of File
--- a/perfmon/ui/avkon/inc/perfmon_graphsview.h	Tue Aug 31 15:15:20 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 PERFMON_GRAPHSVIEW_H
-#define PERFMON_GRAPHSVIEW_H
-
-// INCLUDES
-#include <aknview.h>
-
-#include "perfmon_std.h"
-
-
-
-// CONSTANTS
-// UID of view
-const TUid KGraphsViewUID = {2};
-
-
-// FORWARD DECLARATIONS
-class CPerfMonGraphsContainer;
-class CPerfMonModel;
-
-
-// CLASS DECLARATION
-
-/**
-*  CPerfMonGraphsView view class.
-* 
-*/
-class CPerfMonGraphsView : public CAknView
-    {
-    public: // Constructors and destructor
-        void ConstructL();
-        ~CPerfMonGraphsView();
-
-    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
-        CPerfMonGraphsContainer*        iContainer;
-        CPerfMonModel*                  iModel;
-    };
-
-#endif
-
-// End of File
--- a/perfmon/ui/avkon/inc/perfmon_model.h	Tue Aug 31 15:15:20 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 PERFMON_MODEL_H
-#define PERFMON_MODEL_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <apgcli.h>
-#include <gdi.h>
-
-#include "perfmon_engine.h"
-
-// FORWARD DECLARATIONS
-class CPerfMonValuesContainer;
-class CPerfMonGraphsContainer;
-class CPerfMonDataPopupContainer;
-
-class CPerfMonModel : public CPerfMonEngine
-	{
-private:
-    enum TContainerDrawState
-    	{
-    	EDrawStateInvalid = -1,
-    	EDrawStateValues,
-    	EDrawStateGraphs
-    	};
-
-public:
-	static CPerfMonModel* NewL();
-	void ActivateModelL();
-	void DeActivateModelL();
-
-private:
-	void ConstructL();
-	void SendDrawEventToContainersL();
-	void HandleSettingsChangeL();
-    
-public:
-    void SetValuesContainer(CPerfMonValuesContainer* aValuesContainer);
-    void SetGraphsContainer(CPerfMonGraphsContainer* aGraphsContainer);
-    TInt LaunchSettingsDialogL();
-
-    inline CPerfMonValuesContainer*     ValuesContainer()       { return iValuesContainer; }
-    inline CPerfMonGraphsContainer*     GraphsContainer()       { return iGraphsContainer; }
-    inline CPerfMonDataPopupContainer*  DataPopupContainer()    { return iDataPopupContainer; } 
-
-private:
-    CPerfMonValuesContainer*        iValuesContainer;
-    CPerfMonGraphsContainer*        iGraphsContainer;
-    CPerfMonDataPopupContainer*     iDataPopupContainer;
-    TInt                            iDrawState;
-    };
- 
-
-#endif
--- a/perfmon/ui/avkon/inc/perfmon_settingsviewdlg.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,121 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef PERFMON_SETTINGSVIEWDLG_H
-#define PERFMON_SETTINGSVIEWDLG_H
-
-//  INCLUDES
-#include <AknDialog.h>
-#include <eiklbo.h>
-#include <AknTabObserver.h> 
-#include <akntabgrp.h>
-#include <aknsettingitemlist.h> 
-#include <akncheckboxsettingpage.h> 
-
-#include "perfmon_model.h"
-
-
-//  FORWARD DECLARATIONS
-class CAknSettingItemArray;
-class CAknSettingStyleListBox;
-class CAknNavigationControlContainer;
-class CAknNavigationDecorator;
-class CAknTabGroup; 
-class TPerfMonSettings;
-class CSelectionItemList;
-
-
-//  CLASS DEFINITIONS
-
-class CPerfMonSettingsViewDlg : public CAknDialog, public MEikListBoxObserver, public MAknTabObserver
-    {
-public:
-    static CPerfMonSettingsViewDlg* NewL(TPerfMonSettings& aSettings);
-    virtual ~CPerfMonSettingsViewDlg();
-
-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
-    CPerfMonSettingsViewDlg(TPerfMonSettings& aSettings);
-    void ConstructL();        
-
-private: // Data
-    CAknSettingItemArray*               iSettingItemArray;
-    CAknSettingStyleListBox*            iListBox;
-    CAknNavigationControlContainer*     iNaviContainer;
-    CAknNavigationDecorator*            iDecoratedTabGroup;
-    CAknTabGroup*                       iTabGroup;
-    TPerfMonSettings&               iSettings;
-    };
-
-
-class CSourceSelectionCheckBoxSettingItem : public CAknSettingItem
-    {
-public:
-    CSourceSelectionCheckBoxSettingItem( TInt aIdentifier, TPerfMonSources& aMemoryInUse );
-	virtual ~CSourceSelectionCheckBoxSettingItem();
-
-protected:
-	void CompleteConstructionL();
-	void StoreL();
-	void LoadL();
-	const TDesC& SettingTextL();
-	void EditItemL( TBool aCalledFromMenu );
-    void HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType );
-
-private:
-    void AddNewItemToArrayL(const TDesC& aLabel); 
-
-private:
-    CSelectionItemList*     iItemArray;
-    HBufC*                  iSettingText;
-    TPerfMonSources&        iExternalSources;
-    };
-
-
-class CSourceSelectionCheckBoxSettingPage : public CAknCheckBoxSettingPage
-	{
-	public:
-        CSourceSelectionCheckBoxSettingPage( TInt aResourceID, CSelectionItemList* aItemArray );
-	public:		// New functions
-		void UpdateCba();
-	};
-	
-
-#endif
-
-// End of File
-
--- a/perfmon/ui/avkon/inc/perfmon_std.h	Tue Aug 31 15:15:20 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 PERFMON_STD_H
-#define PERFMON_STD_H
-
-
-
-#endif
-
-// End of File
-
--- a/perfmon/ui/avkon/inc/perfmon_valuescontainer.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-
-#ifndef PERFMON_VALUESCONTAINER_H
-#define PERFMON_VALUESCONTAINER_H
-
-// INCLUDES
-#include <coecntrl.h>
-
-#include "perfmon_drawcallback.h"
-
-
-// FORWARD DECLARATIONS
-class CPerfMonModel;
-
-
-// CLASS DECLARATIONS
-
-class CPerfMonValuesContainer : public CCoeControl, public MDrawUpdateCallback
-    {
-public:
-    void ConstructL(const TRect& aRect);
-    ~CPerfMonValuesContainer();
-
-private:
-    void Draw(const TRect& aRect) const;
-    void HandleResourceChange(TInt aType);
-
-public:
-	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/);
-
-public: // from MDrawUpdateCallback
-    void DrawUpdate();
-    
-private:
-    CPerfMonModel*                      iModel;
-    const CFont*                        iFont; 
-    };
-    
-#endif
-
-// End of File
--- a/perfmon/ui/avkon/inc/perfmon_valuesview.h	Tue Aug 31 15:15:20 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 PERFMON_VALUESVIEW_H
-#define PERFMON_VALUESVIEW_H
-
-// INCLUDES
-#include <aknview.h>
-
-#include "perfmon_std.h"
-
-
-
-// CONSTANTS
-// UID of view
-const TUid KValuesViewUID = {1};
-
-
-// FORWARD DECLARATIONS
-class CPerfMonValuesContainer;
-class CPerfMonModel;
-
-
-// CLASS DECLARATION
-
-/**
-*  CPerfMonValuesView view class.
-* 
-*/
-class CPerfMonValuesView : public CAknView
-    {
-    public: // Constructors and destructor
-        void ConstructL();
-        ~CPerfMonValuesView();
-
-    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
-        CPerfMonValuesContainer*        iContainer;
-        CPerfMonModel*                  iModel;
-    };
-
-#endif
-
-// End of File
--- a/perfmon/ui/avkon/src/perfmon_app.cpp	Tue Aug 31 15:15:20 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 "perfmon_app.h"
-#include "perfmon_document.h"
-
-#include <eikstart.h>
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CPerfMonApp::AppDllUid()
-// Returns application UID
-// ---------------------------------------------------------
-//
-TUid CPerfMonApp::AppDllUid() const
-    {
-    return KUidPerfMon;
-    }
-
-// ---------------------------------------------------------
-// CDictionaryStore* CPerfMonApp::OpenIniFileLC(RFs& aFs) const
-// overrides CAknApplication::OpenIniFileLC to enable INI file support
-// ---------------------------------------------------------
-//
-CDictionaryStore* CPerfMonApp::OpenIniFileLC(RFs& aFs) const
-    {
-    return CEikApplication::OpenIniFileLC(aFs);
-    }
-   
-// ---------------------------------------------------------
-// CPerfMonApp::CreateDocumentL()
-// Creates CPerfMonDocument object
-// ---------------------------------------------------------
-//
-CApaDocument* CPerfMonApp::CreateDocumentL()
-    {
-    return CPerfMonDocument::NewL( *this );
-    }
-
-// ================= OTHER EXPORTED FUNCTIONS ==============
-
-LOCAL_C CApaApplication* NewApplication()
-    {
-    return new CPerfMonApp;
-    }
-
-
-GLDEF_C TInt E32Main()
-    {
-    return EikStart::RunApplication(NewApplication);
-    }
-   
-
-// End of File  
-
--- a/perfmon/ui/avkon/src/perfmon_appui.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,228 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 "perfmon_appui.h"
-#include "perfmon_valuesview.h"
-#include "perfmon_graphsview.h"
-#include "perfmon_datapopupcontainer.h"
-#include "perfmon.hrh"
-#include "perfmon_model.h"
-#include "perfmon_document.h"
-#include <perfmon.rsg>
-
-#include <avkon.hrh>
-#include <AknQueryDialog.h>
-#include <aknmessagequerydialog.h> 
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonAppUi::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<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-
-    // 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();
-        }
-        
-    CPerfMonValuesView* valuesView = new(ELeave) CPerfMonValuesView;
-    CleanupStack::PushL(valuesView);
-    valuesView->ConstructL();
-    AddViewL(valuesView);           // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();            // valuesView
-
-    CPerfMonGraphsView* graphsView = new(ELeave) CPerfMonGraphsView;
-    CleanupStack::PushL(graphsView);
-    graphsView->ConstructL();
-    AddViewL(graphsView);           // transfer ownership to CAknViewAppUi
-    CleanupStack::Pop();            // graphsView
-    
-    // set the default view
-    SetDefaultViewL(*valuesView);
-
-    // notify the model that everything has been constructed
-    iModel->ActivateModelL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPerfMonAppUi::~CPerfMonAppUi()
-    {
-    // notify the model that the application is closing
-    if (iModel)    
-        TRAP_IGNORE(iModel->DeActivateModelL());
-    
-    delete iDecoratedTabGroup;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonAppUi::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    if (aResourceId == R_PERFMON_APP_MENU)
-        {
-        aMenuPane->SetItemDimmed(EPerfMonCmdEnableLogging, iModel->Settings().iLoggingEnabled);
-        aMenuPane->SetItemDimmed(EPerfMonCmdDisableLogging, !iModel->Settings().iLoggingEnabled);
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CPerfMonAppUi::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;
-    }
-
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonAppUi::HandleCommandL(TInt aCommand)
-    {
-    switch ( aCommand )
-        {
-        case EPerfMonCmdEnableLogging:
-            {
-            iModel->EnableLogging(ETrue);
-            break;
-            }
-
-        case EPerfMonCmdDisableLogging:
-            {
-            iModel->EnableLogging(EFalse);
-            break;
-            }
-                        
-        case EPerfMonCmdSettings:
-            {
-            if (iModel->LaunchSettingsDialogL() == EAknCmdExit)
-                Exit();
-            break;
-            }
-
-        case EPerfMonCmdAbout:
-            {
-	        CAknMessageQueryDialog* dialog = new(ELeave) CAknMessageQueryDialog;
-            dialog->ExecuteLD(R_PERFMON_ABOUT_DIALOG);
-            }
-            break;
-            
-        // a normal way to close an application
-        case EAknCmdExit:
-        case EEikCmdExit:
-        case EAknSoftkeyExit: 
-			{
-            Exit();
-			}
-            break;
-
-        default:
-            break;      
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonAppUi::HandleForegroundEventL(TBool aForeground)
-    {
-    // handle visibility of the data popup container
-    if (iModel && iModel->DataPopupContainer())
-        {
-        iModel->DataPopupContainer()->UpdateVisibility(aForeground);
-        }
-    
-    // call the base class
-    CAknAppUi::HandleForegroundEventL(aForeground); 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonAppUi::HandleResourceChangeL(TInt aType)
-    {
-    CAknAppUi::HandleResourceChangeL(aType);
-
-    // update size of the data popup container (implemented here because data popup container
-    // does not get HandleResourceChangeL events)
-    if (aType == KEikDynamicLayoutVariantSwitch)
-        {
-        if (iModel)
-            {
-            if (iModel->DataPopupContainer())
-                {
-                iModel->DataPopupContainer()->SetPositionAndSize();
-                }
-            
-            }
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-// End of File  
--- a/perfmon/ui/avkon/src/perfmon_datapopupcontainer.cpp	Tue Aug 31 15:15:20 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:  
-*
-*/
-
-
-// INCLUDE FILES
-#include "perfmon_datapopupcontainer.h"
-#include "perfmon.hrh"
-#include "perfmon_document.h"
-#include "perfmon_appui.h"
-#include "perfmon_model.h"
-
-#include <AknUtils.h>
-
-_LIT(KPercentageFormat,"%S %d%%");
-_LIT(KFreeFormat,"%S free %S%S");
-
-const TInt KLeftMargin = 2;
- 
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-void CPerfMonDataPopupContainer::ConstructL(const TRect& /*aRect*/)
-    {
-    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    iFont = LatinPlain12();
-    iFontSize = iFont->FontMaxHeight();
- 
-    // set windowgroup so that it always on top and does not receive focus
-    iWindowGroup = RWindowGroup(iCoeEnv->WsSession());
-    User::LeaveIfError(iWindowGroup.Construct((TUint32)&iWindowGroup));
-    iWindowGroup.SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront);
-    iWindowGroup.EnableReceiptOfFocus(EFalse);
-    
-    CreateWindowL(&iWindowGroup);
-    //SetRect(aRect);
-    SetPositionAndSize();
-    SetBlank();
-
-    ActivateL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPerfMonDataPopupContainer::~CPerfMonDataPopupContainer()
-    {
-    iWindowGroup.Close();    
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonDataPopupContainer::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc();
-    gc.SetBrushColor(KRgbWhite);
-    gc.Clear(aRect);
-    
-    // check if sample array has been constructed
-    if (iModel->SampleEntryArray())
-        {
-        // init font
-        gc.SetPenColor(KRgbBlack);
-        gc.UseFont( iFont );
-        
-        // draw a rect around the popup
-        gc.DrawRect(aRect);
-        
-        TInt posCounter(1);
-        
-        for (TInt i=0; i<iModel->SampleEntryArray()->Count(); i++)
-            {
-            // check if this setting has been enabled and it has some data
-            if (iModel->Settings().iDataPopupSources.iSrcEnabled[i] && iModel->SampleEntryArray()->At(i).iSampleDataArray->Count() > 0)
-                {
-                TSampleData& currentSample = iModel->SampleEntryArray()->At(i).iSampleDataArray->At(0);    
-                TBuf<32> buf;
-
-                // for CPU draw %, other amount of free memory
-                if (i == ESourceCPU)
-                    {
-                    buf.Format(KPercentageFormat, &iModel->SampleEntryArray()->At(i).iDescription, currentSample.iSize > 0 ? TInt( (1 - ((TReal)(currentSample.iFree) / (TReal)currentSample.iSize)) * 100) : 0 );
-                    gc.DrawText(buf, TPoint(KLeftMargin, iFontSize*posCounter));
-                    }
-                else
-                    {
-                    TBuf<32> freeBuf;
-                    freeBuf.AppendNum(currentSample.iFree, TRealFormat(KDefaultRealWidth, 0));
-
-                    TBuf<32> buf;
-                    buf.Format(KFreeFormat, &iModel->SampleEntryArray()->At(i).iDescription, &freeBuf, &iModel->SampleEntryArray()->At(i).iUnitTypeShort);
-                    gc.DrawText(buf, TPoint(KLeftMargin, iFontSize*posCounter));                    
-                    }    
-                
-                posCounter++;
-                }
-            }
-            
-        gc.DiscardFont();        
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonDataPopupContainer::SizeChanged()
-    {
-    DrawNow();
-    }   
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonDataPopupContainer::SetPositionAndSize()
-    {
-    CWsScreenDevice* screenDevice = iEikonEnv->ScreenDevice();
-
-    // top right
-    if (iModel->Settings().iDataPopupLocation == EDataPopupLocationTopRight)
-        {
-        // screen orientation is landscape with softkeys on right
-        if (AknLayoutUtils::CbaLocation()==AknLayoutUtils::EAknCbaLocationRight)
-            {
-            SetRect(
-                TRect(
-                    screenDevice->SizeInPixels().iWidth-102-15,
-                    0,
-                    screenDevice->SizeInPixels().iWidth-15,
-                    iModel->Settings().iDataPopupSources.EnabledSourcesCount()*iFontSize + 3
-                    ));
-            }
-
-        // any other orientation
-        else
-            {
-            SetRect(
-                TRect(
-                    screenDevice->SizeInPixels().iWidth-102,
-                    0,
-                    screenDevice->SizeInPixels().iWidth,
-                    iModel->Settings().iDataPopupSources.EnabledSourcesCount()*iFontSize + 3
-                    ));
-            }        
-        }
-
-    // bottom middle
-    else if (iModel->Settings().iDataPopupLocation == EDataPopupLocationBottomMiddle)
-        {
-        SetRect(
-            TRect(
-                screenDevice->SizeInPixels().iWidth/2-102/2,
-                screenDevice->SizeInPixels().iHeight - iModel->Settings().iDataPopupSources.EnabledSourcesCount()*iFontSize - 3,
-                screenDevice->SizeInPixels().iWidth/2+102/2,
-                screenDevice->SizeInPixels().iHeight
-                ));
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonDataPopupContainer::UpdateVisibility(TBool aForeground)
-    {
-    // application has been brought to foregound
-    if (aForeground)
-        {
-        if (iModel->Settings().iDataPopupVisibility==EDataPopupVisbilityAlwaysOn)
-            {
-            MakeVisible(ETrue);
-            }
-        else
-            {
-            MakeVisible(EFalse);
-            }    
-        }
-    
-    // application has been sent to background
-    else
-        {
-        if (iModel->Settings().iDataPopupVisibility==EDataPopupVisbilityAlwaysOn
-            || iModel->Settings().iDataPopupVisibility==EDataPopupVisbilityBackgroundOnly)
-            {
-            MakeVisible(ETrue);
-            }
-        else
-            {
-            MakeVisible(EFalse);
-            }              
-        }    
-    }
-            
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonDataPopupContainer::DrawUpdate()
-    {
-    DrawDeferred(); 
-    }
-    
-// --------------------------------------------------------------------------------------------
-       
-// End of File  
--- a/perfmon/ui/avkon/src/perfmon_document.cpp	Tue Aug 31 15:15:20 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 "perfmon_document.h"
-#include "perfmon_appui.h"
-#include "perfmon_model.h"
-
-// ================= MEMBER FUNCTIONS =======================
-
-// constructor
-CPerfMonDocument::CPerfMonDocument(CEikApplication& aApp)
-: CAknDocument(aApp)    
-    {
-    }
-
-// ----------------------------------------------------
-
-// destructor
-CPerfMonDocument::~CPerfMonDocument()
-    {
-    delete iModel;
-    }
-
-// ----------------------------------------------------
-
-// EPOC default constructor can leave.
-void CPerfMonDocument::ConstructL()
-    {
-    iModel = CPerfMonModel::NewL();
-    }
-
-// ----------------------------------------------------
-
-// Two-phased constructor.
-CPerfMonDocument* CPerfMonDocument::NewL(CEikApplication& aApp)
-    {
-    CPerfMonDocument* self = new(ELeave) CPerfMonDocument(aApp);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop();
-
-    return self;
-    }
-    
-// ----------------------------------------------------
-// CPerfMonDocument::CreateAppUiL()
-// constructs CPerfMonAppUi
-// ----------------------------------------------------
-//
-CEikAppUi* CPerfMonDocument::CreateAppUiL()
-    {
-    return new (ELeave) CPerfMonAppUi;
-    }
-
-// ----------------------------------------------------
-// CPerfMonDocument::OpenFileL
-// Overrides CAknDocument::OpenFileL to support document file
-// ----------------------------------------------------
-//
-CFileStore* CPerfMonDocument::OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs)
-    {
-    return CEikDocument::OpenFileL(aDoOpen, aFilename, aFs);
-    }
-
-// ----------------------------------------------------
-
-// End of File  
--- a/perfmon/ui/avkon/src/perfmon_graphscontainer.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 "perfmon_graphscontainer.h"
-#include "perfmon.hrh"
-#include "perfmon_document.h"
-#include "perfmon_appui.h"
-#include "perfmon_model.h"
-
-#include <AknUtils.h>
-
-const TInt KAmountOfMicroSecondsFitsScreen = 20 * 1000000;
-#define KRgbCustomGrey TRgb(0x808080)
-
-_LIT(K100p, "100%"); 
-_LIT(K50p, "50%"); 
-_LIT(K0p, "0%"); 
-
-_LIT(KPercentageFormat,"%S %d%%");
-
-const TInt KMicroToSecondMultiplier = 1000000;
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-void CPerfMonGraphsContainer::ConstructL(const TRect& aRect)
-    {
-    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    //iFont = AknLayoutUtils::FontFromId(EAknLogicalFontPrimarySmallFont);
-    iFont = LatinBold12();
-
-    CreateWindowL();
-    SetRect(aRect);
-    SetBlank();
-
-    ActivateL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPerfMonGraphsContainer::~CPerfMonGraphsContainer()
-    {
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonGraphsContainer::Draw(const TRect& aRect) const
-    {
-    // draw black background
-    CWindowGc& gc = SystemGc();
-    gc.SetBrushColor(KRgbBlack);
-    gc.Clear(aRect);
-    
-    // activate font and get size
-    gc.UseFont(iFont);
-    TUint fontSize = iFont->FontMaxHeight();
-    //TInt fontBaseOffset = iFont->DescentInPixels();
-    
-
-    // calculate time factor
-    TReal scaleFactor = (TReal) aRect.Width() / (TReal) KAmountOfMicroSecondsFitsScreen;
-
-    // calculate area height which is used to draw the grpahs
-    TInt drawAreaHeight = aRect.Height() - fontSize - fontSize;
-        
-    
-    // check if sample array has been constructed
-    if (iModel->SampleEntryArray())
-        {
-        
-        // draw vertical time lines first
-        TInt verticalBarPeriodInSecs = iModel->Settings().iGraphsVerticalBarPeriod;
-        
-        if (verticalBarPeriodInSecs >= 1 && iModel->SampleEntryArray()->At(0).iSampleDataArray->Count() > 0)
-            {
-            // get time from the first sample
-            TSampleData& firstSample = iModel->SampleEntryArray()->At(0).iSampleDataArray->At(0);
-            TInt64 currentMicroSeconds = firstSample.iTimeFromStart.Int64();
-            
-            // calculate amount of microseconds exceeding value by using the modulo operator
-            TInt remainderInMicroSeconds = currentMicroSeconds % (verticalBarPeriodInSecs * 1000000); 
-            
-            // calculate first x pos
-            TInt vbarXpos = aRect.Width() - (remainderInMicroSeconds * scaleFactor);
-            
-            // calculate the amount in seconds
-            TInt barSeconds = (currentMicroSeconds - remainderInMicroSeconds) / KMicroToSecondMultiplier;
-
-            
-            // continue drawing periodically the vertical lines
-            while (vbarXpos >= 0 && barSeconds >= 0)
-                {
-                // draw vertical line    
-                gc.SetPenColor(KRgbDarkRed);
-                gc.DrawLine(TPoint(vbarXpos,fontSize+1), TPoint(vbarXpos,aRect.Height()-fontSize));
-                
-                // draw seconds value
-                gc.SetPenColor(KRgbCustomGrey);
-                TBuf<16> secsBuf;
-                secsBuf.AppendNum(barSeconds);    
-                secsBuf.Append(_L("s"));
-                gc.DrawText(secsBuf, TPoint(vbarXpos-(iFont->TextWidthInPixels(secsBuf)/2), aRect.Height()));    
-
-                // calculate new position
-                vbarXpos -= verticalBarPeriodInSecs * 1000000 * scaleFactor;
-                barSeconds -= verticalBarPeriodInSecs;
-                }
-            }
-        
-        // draw the basic grid
-        gc.SetPenColor(KRgbCustomGrey);
-    
-        gc.DrawLine(TPoint(0,fontSize), TPoint(aRect.Width(),fontSize));  // upper line
-        gc.DrawText(K100p, TPoint(0,fontSize));
-    
-        gc.DrawLine(TPoint(0,aRect.Height()/2), TPoint(aRect.Width(),aRect.Height()/2));  // mid line
-        gc.DrawText(K50p, TPoint(0,aRect.Height()/2));
-    
-        gc.DrawLine(TPoint(0,aRect.Height()-fontSize), TPoint(aRect.Width(),aRect.Height()-fontSize));  // bottom line
-        gc.DrawText(K0p, TPoint(0,aRect.Height()-fontSize));
-
-        TInt c(0);
-            
-        // draw graphs for each sampled type
-        for (TInt i=0; i<iModel->SampleEntryArray()->Count(); i++)
-            {
-            // check if this setting has been enabled and it has some data
-            if (iModel->Settings().iGraphsSources.iSrcEnabled[i] && iModel->SampleEntryArray()->At(i).iSampleDataArray->Count() > 0)
-                {
-                // set pen color for the graph
-                gc.SetPenColor(iModel->SampleEntryArray()->At(i).iGraphColor);
-                
-                // remember the position where drawing started
-                /*TReal*/TInt currentXPos(aRect.Width()); // start drawing from right            
-                /*TReal*/TInt currentYPos(0);
-                
-                // draw samples
-                for (TInt j=0; j<iModel->SampleEntryArray()->At(i).iSampleDataArray->Count() - 1; j++)
-                    {
-                    TSampleData& currentSample = iModel->SampleEntryArray()->At(i).iSampleDataArray->At(j);
-                    TSampleData& previousSample = iModel->SampleEntryArray()->At(i).iSampleDataArray->At(j+1);
-                    
-                    // calculate X position for previous (j+1)
-                    /*TReal*/TInt previousXPos = currentXPos -
-                        ( (Abs(previousSample.iTimeFromStart.Int64() - currentSample.iTimeFromStart.Int64())) * scaleFactor );
-                    
-
-                    // calculate initial Y position
-                    if (j==0)
-                        {
-                        currentYPos = currentSample.iSize > 0 ? (TReal)(currentSample.iFree) / (TReal)currentSample.iSize * drawAreaHeight + fontSize : aRect.Height()-fontSize;
-                        }
-
-                    // calculate Y position for previous (j+1)
-                    /*TReal*/TInt previousYPos = previousSample.iSize > 0 ? (TReal)(previousSample.iFree) / (TReal)previousSample.iSize * drawAreaHeight + fontSize : aRect.Height()-fontSize; 
-                    
-                    
-                    // draw a line between the previous and current
-                    gc.DrawLine(TPoint((TInt)previousXPos,(TInt)previousYPos), TPoint((TInt)currentXPos,(TInt)currentYPos));
-                    
-                    
-                    // draw current value in %
-                    if (j==0) // draw the value of first sample
-                        {
-                        TBuf<16> buf;
-                        buf.Format(KPercentageFormat, &iModel->SampleEntryArray()->At(i).iDescription, currentSample.iSize > 0 ? TInt( (1 - ((TReal)(currentSample.iFree) / (TReal)currentSample.iSize)) * 100) : 0 );
-      
-                        gc.DrawText(buf, TPoint(0,fontSize+fontSize+c*fontSize));
-                        c++;                    
-                        }
-                    
-                    
-                    // stop drawing if we have run out of space
-                    if (previousXPos < 0)
-                        break;
-                    
-                    // remeber previous values
-                    currentXPos = previousXPos;
-                    currentYPos = previousYPos;
-                    }
-                }
-            }
-        }
-
-    gc.DiscardFont();        
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CPerfMonGraphsContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    return CCoeControl::OfferKeyEventL(aKeyEvent, aType);
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonGraphsContainer::HandleResourceChange(TInt aType)
-    {
-    if (aType == KEikDynamicLayoutVariantSwitch)
-        {
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        SetRect(mainPaneRect);
-        }
-    else
-        CCoeControl::HandleResourceChange(aType);    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonGraphsContainer::DrawUpdate()
-    {
-    DrawDeferred();    
-    }
-    
-// --------------------------------------------------------------------------------------------
-            
-// End of File  
--- a/perfmon/ui/avkon/src/perfmon_graphsview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 "perfmon.hrh"
-#include "perfmon_graphsview.h"
-#include "perfmon_graphscontainer.h"
-#include "perfmon_document.h" 
-#include "perfmon_model.h"
-#include <perfmon.rsg>
-
-#include <eikenv.h>
-#include <aknViewAppUi.h> 
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CPerfMonGraphsView::ConstructL(const TRect& aRect)
-// EPOC two-phased constructor
-// ---------------------------------------------------------
-//
-void CPerfMonGraphsView::ConstructL()
-    {
-    BaseConstructL( R_PERFMON_VIEW_GRAPHS );
-    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    }
-
-// ---------------------------------------------------------
-// CPerfMonGraphsView::~CPerfMonGraphsView()
-// ---------------------------------------------------------
-//
-CPerfMonGraphsView::~CPerfMonGraphsView()
-    {
-    if (iContainer)
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    }
-
-// ---------------------------------------------------------
-// TUid CPerfMonGraphsView::Id()
-// ---------------------------------------------------------
-//
-TUid CPerfMonGraphsView::Id() const
-    {
-    return KGraphsViewUID;
-    }
-
-// ---------------------------------------------------------
-// TUid CPerfMonGraphsView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-// ---------------------------------------------------------
-//
-void CPerfMonGraphsView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
-    }
-
-  
-// ---------------------------------------------------------
-// CPerfMonGraphsView::HandleCommandL(TInt aCommand)
-// ---------------------------------------------------------
-//
-void CPerfMonGraphsView::HandleCommandL(TInt aCommand)
-    {   
-/*
-    switch ( aCommand )
-        {
-        case EPerfMonCmdFileBack:
-            {
-            iModel->FileUtils()->MoveUpOneLevelL();
-            break;
-            }
-
-        default:
-            {
-*/
-            AppUi()->HandleCommandL( aCommand );
-/*
-            break;
-            }
-        }
-*/
-    }
-
-// ---------------------------------------------------------
-// CPerfMonGraphsView::HandleClientRectChange()
-// ---------------------------------------------------------
-//
-void CPerfMonGraphsView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ---------------------------------------------------------
-// CPerfMonGraphsView::DoActivateL(...)
-// ---------------------------------------------------------
-//
-void CPerfMonGraphsView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CPerfMonGraphsContainer;
-        iModel->SetGraphsContainer(iContainer);
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect() );
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-   }
-
-// ---------------------------------------------------------
-// CPerfMonGraphsView::DoDeactivate()
-// ---------------------------------------------------------
-//
-void CPerfMonGraphsView::DoDeactivate()
-    {
-    if (iContainer)
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    }
-
-// End of File
--- a/perfmon/ui/avkon/src/perfmon_model.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 "perfmon_model.h"
-#include "perfmon_app.h"
-#include "perfmon_settingsviewdlg.h"
-#include "perfmon.hrh"
-#include "perfmon_valuescontainer.h"
-#include "perfmon_graphscontainer.h"
-#include "perfmon_datapopupcontainer.h"
-#include <perfmon.rsg>
-
-#include <coeutils.h>
-#include <bautils.h>
-#include <eikenv.h>
-#include <e32hal.h>
-#include <u32std.h>
-#include <s32file.h>
-#include <akntitle.h> 
-#include <eikspane.h>
-#include <aknnotewrappers.h>  
-
-_LIT(KAppName, "PerfMon");
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-CPerfMonModel* CPerfMonModel::NewL()
-	{
-	CPerfMonModel* self = new(ELeave) CPerfMonModel;
-	CleanupStack::PushL(self);
-	self->ConstructL();
-	CleanupStack::Pop();
-	return self;
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonModel::ConstructL()
-	{
-	iDrawState = EDrawStateInvalid;
-	CPerfMonEngine::ConstructL();
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonModel::ActivateModelL()
-	{
-	// initialize the data popup container in top-right corner
-	iDataPopupContainer = new(ELeave) CPerfMonDataPopupContainer;
-	iDataPopupContainer->ConstructL(TRect(0,0,1,1));
-    
-	ActivateEngineL();
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonModel::DeActivateModelL()
-	{
-	DeActivateEngineL();
-	
-	if (iDataPopupContainer)
-		{
-		delete iDataPopupContainer;
-		iDataPopupContainer = NULL;
-		}
-	}
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonModel::SetValuesContainer(CPerfMonValuesContainer* aContainer)
-    {
-    iValuesContainer = aContainer;
-    iDrawState = EDrawStateValues;
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonModel::SetGraphsContainer(CPerfMonGraphsContainer* aContainer)
-    {
-    iGraphsContainer = aContainer;
-    iDrawState = EDrawStateGraphs;
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonModel::SendDrawEventToContainersL()
-    {
-    if (iDrawState == EDrawStateValues && iValuesContainer)
-        iValuesContainer->DrawUpdate();
-    else if (iDrawState == EDrawStateGraphs && iGraphsContainer)
-        iGraphsContainer->DrawUpdate();
-           
-    if (iDataPopupContainer)
-        iDataPopupContainer->DrawUpdate();
-    }
-
-void CPerfMonModel::HandleSettingsChangeL()
-    {
-    // set visibility and location of the data popup
-    iDataPopupContainer->UpdateVisibility();
-    iDataPopupContainer->SetPositionAndSize();
-    CPerfMonEngine::HandleSettingsChangeL();
-    }
-            
-// --------------------------------------------------------------------------------------------
-
-TInt CPerfMonModel::LaunchSettingsDialogL()
-    {
-    // launch the settings dialog
-    TPerfMonSettings newSettings = iSettings;
-    
-    CPerfMonSettingsViewDlg* dlg = CPerfMonSettingsViewDlg::NewL(newSettings);
-    TInt returnValue = dlg->ExecuteLD(R_PERFMON_SETTINGS_DIALOG);
-    
-    // always save settings since the settings dialog does not provide a possibility to cancel
-    iSettings = newSettings;
-    SaveSettingsL();
-    HandleSettingsChangeL();
-
-    // make sure that the title of the application is correct
-    CEikStatusPane* sp = iEnv->AppUiFactory()->StatusPane();
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL(KAppName);
-    
-    return returnValue;
-    }
-	
-// ---------------------------------------------------------------------------
-    
-// End of File
--- a/perfmon/ui/avkon/src/perfmon_settingsviewdlg.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,681 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 "perfmon_settingsviewdlg.h"
-#include "perfmon_model.h"
-#include "perfmon.hrh"
-#include "perfmon_std.h"
-#include <perfmon.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 =====================================
-
-CPerfMonSettingsViewDlg* CPerfMonSettingsViewDlg::NewL(TPerfMonSettings& aSettings)
-    {
-    CPerfMonSettingsViewDlg* self = new(ELeave) CPerfMonSettingsViewDlg(aSettings);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPerfMonSettingsViewDlg::~CPerfMonSettingsViewDlg()
-    {
-    // restore default navi pane by popping the tab group from stack
-    if (iNaviContainer)
-        iNaviContainer->Pop();
-    
-    if (iSettingItemArray)
-        {
-        iSettingItemArray->ResetAndDestroy();
-        delete iSettingItemArray; 
-        }
-    
-    delete iDecoratedTabGroup;   
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPerfMonSettingsViewDlg::CPerfMonSettingsViewDlg(TPerfMonSettings& aSettings) : iSettings(aSettings)
-    {
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonSettingsViewDlg::ConstructL()
-    {
-    // construct a menu bar
-    CAknDialog::ConstructL(R_PERFMON_SETTINGS_MENUBAR);
-
-    // get pointer to status pane   
-    CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
-    
-    // set title text
-    CAknTitlePane* tp = static_cast<CAknTitlePane*>( sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-    tp->SetTextL( _L("Settings") );
-    
-    // create a new tab group
-    iNaviContainer = static_cast<CAknNavigationControlContainer*>(sp->ControlL(TUid::Uid(EEikStatusPaneUidNavi)));
-    iDecoratedTabGroup = iNaviContainer->CreateTabGroupL(this);
-    iTabGroup = static_cast<CAknTabGroup*>(iDecoratedTabGroup->DecoratedControl());
-    iTabGroup->SetTabFixedWidthL(KTabWidthWithTwoLongTabs); 
-    
-    // add tabs
-    iTabGroup->AddTabL(ETabSettingsGeneral, _L("General"));
-    iTabGroup->AddTabL(ETabSettingsDataPopup, _L("Data popup"));
-    iTabGroup->AddTabL(ETabSettingsGraphs, _L("Graphs"));
-    iTabGroup->AddTabL(ETabSettingsLogging, _L("Logging"));
-    iTabGroup->SetActiveTabByIndex(ETabSettingsGeneral);
-    
-    // add new tab group to stack
-    iNaviContainer->PushL( *iDecoratedTabGroup );
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonSettingsViewDlg::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
-    {
-    switch (aEventType)
-        {
-        case EEventEnterKeyPressed:
-        case EEventItemDoubleClicked:
-            ShowSettingPageL(EFalse);
-            break;
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonSettingsViewDlg::TabChangedL(TInt /*aIndex*/)
-    {
-    iListBox->SetCurrentItemIndex(0);
-
-    SetVisibilitiesOfSettingItemsL();   
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonSettingsViewDlg::ProcessCommandL(TInt aCommandId)
-    {
-    CAknDialog::ProcessCommandL(aCommandId);
-
-    switch (aCommandId)
-        {
-        case EPerfMonCmdSettingsChange:
-            ShowSettingPageL(ETrue);
-            break;
-        case EPerfMonCmdSettingsExit:
-            TryExitL(EAknCmdExit);
-            break;
-        default:
-            break;
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CPerfMonSettingsViewDlg::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 CPerfMonSettingsViewDlg::PreLayoutDynInitL()
-    {
-    iListBox = static_cast<CAknSettingStyleListBox*>( Control(EPerfMonSettingItemList) );
-    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 CPerfMonSettingsViewDlg::OkToExitL(TInt aButtonId)
-    {
-    return CAknDialog::OkToExitL(aButtonId);
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonSettingsViewDlg::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 CPerfMonSettingsViewDlg::SetVisibilitiesOfSettingItemsL()
-    {
-    if (iSettingItemArray->Count() > 0)
-        {
-        switch (iTabGroup->ActiveTabIndex())
-            {
-            case ETabSettingsGeneral:
-                {
-                ((*iSettingItemArray)[ESettingListItemHeartBeat])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListItemMaxSamples])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListItemPriority])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListItemCPUMode])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListItemKeepBackLightOn])->SetHidden(EFalse);
-
-                ((*iSettingItemArray)[ESettingListItemDataPopupVisbility])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemDataPopupLocation])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemDataPopupSources])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemGraphsVerticalBarPeriod])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemGraphsSources])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemLoggingMode])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemLoggingSources])->SetHidden(ETrue);
-
-                break;
-                }
-            
-            case ETabSettingsDataPopup:
-                {
-                ((*iSettingItemArray)[ESettingListItemHeartBeat])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemMaxSamples])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemPriority])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemCPUMode])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemKeepBackLightOn])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemDataPopupVisbility])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListItemDataPopupLocation])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListItemDataPopupSources])->SetHidden(EFalse);
-
-                ((*iSettingItemArray)[ESettingListItemGraphsVerticalBarPeriod])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemGraphsSources])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemLoggingMode])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemLoggingSources])->SetHidden(ETrue);
-
-                break;
-                }
-
-            case ETabSettingsGraphs:
-                {
-                ((*iSettingItemArray)[ESettingListItemHeartBeat])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemMaxSamples])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemPriority])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemCPUMode])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemKeepBackLightOn])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemDataPopupVisbility])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemDataPopupLocation])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemDataPopupSources])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemGraphsVerticalBarPeriod])->SetHidden(EFalse);
-                ((*iSettingItemArray)[ESettingListItemGraphsSources])->SetHidden(EFalse);
-
-                ((*iSettingItemArray)[ESettingListItemLoggingMode])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemLoggingSources])->SetHidden(ETrue);
-
-                break;
-                }
-
-            case ETabSettingsLogging:
-                {
-                ((*iSettingItemArray)[ESettingListItemHeartBeat])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemMaxSamples])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemPriority])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemCPUMode])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemKeepBackLightOn])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemDataPopupVisbility])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemDataPopupLocation])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemDataPopupSources])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemGraphsVerticalBarPeriod])->SetHidden(ETrue);
-                ((*iSettingItemArray)[ESettingListItemGraphsSources])->SetHidden(ETrue);
-
-                ((*iSettingItemArray)[ESettingListItemLoggingMode])->SetHidden(EFalse);
-                
-                if (iSettings.iLoggingMode == ELoggingModeLogFile || iSettings.iLoggingMode == ELoggingModeRDebugLogFile)
-                    ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(EFalse);
-                else
-                    ((*iSettingItemArray)[ESettingListItemLoggingFilePath])->SetHidden(ETrue);
-                
-                ((*iSettingItemArray)[ESettingListItemLoggingSources])->SetHidden(EFalse);
-
-                break;
-                }                
-
-            default:
-                User::Panic(_L("TabIOOB"), 50);
-                break;
-            }
-
-        iSettingItemArray->RecalculateVisibleIndicesL();
-        iListBox->HandleItemAdditionL();
-        iListBox->UpdateScrollBarsL();
-        }
-    }   
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonSettingsViewDlg::UpdateListBoxL()
-    {
-    iSettingItemArray->ResetAndDestroy();
-
-    // create items
-    TInt ordinal(0);
-
-    AddSettingItemL(ESettingListItemHeartBeat,
-                    R_HEARTBEAT_SETTING_TITLE,
-                    R_HEARTBEAT_SETTING_PAGE,
-                    NULL,
-                    ordinal++);    
-    
-    AddSettingItemL(ESettingListItemMaxSamples,
-                    R_MAXSAMPLES_SETTING_TITLE,
-                    R_MAXSAMPLES_SETTING_PAGE,
-                    NULL,
-                    ordinal++);
-
-    AddSettingItemL(ESettingListItemPriority,
-                    R_PRIORITY_SETTING_TITLE,
-                    R_PRIORITY_SETTING_PAGE,
-                    R_PRIORITY_SETTING_TEXTS,
-                    ordinal++);
-
-    AddSettingItemL(ESettingListItemCPUMode,
-                    R_CPUMODE_SETTING_TITLE,
-                    R_CPUMODE_SETTING_PAGE,
-                    R_CPUMODE_SETTING_TEXTS,
-                    ordinal++);
-
-    AddSettingItemL(ESettingListItemKeepBackLightOn,
-                    R_KEEPBACKLIGHTON_SETTING_TITLE,
-                    R_BINARY_SETTING_PAGE,
-                    R_YESNO_BINARYSELECTION_TEXTS,
-                    ordinal++);
-//
-    AddSettingItemL(ESettingListItemDataPopupVisbility,
-                    R_DATAPOPUPVISIBILITY_SETTING_TITLE,
-                    R_DATAPOPUPVISIBILITY_SETTING_PAGE,
-                    R_DATAPOPUPVISIBILITY_SETTING_TEXTS,
-                    ordinal++);
-
-    AddSettingItemL(ESettingListItemDataPopupLocation,
-                    R_DATAPOPUPLOCATION_SETTING_TITLE,
-                    R_DATAPOPUPLOCATION_SETTING_PAGE,
-                    R_DATAPOPUPLOCATION_SETTING_TEXTS,
-                    ordinal++);
-
-    AddSettingItemL(ESettingListItemDataPopupSources,
-                    R_SOURCES_SETTING_TITLE,
-                    R_SOURCES_SETTING_PAGE,
-                    NULL,
-                    ordinal++);                    
-//
-    AddSettingItemL(ESettingListItemGraphsVerticalBarPeriod,
-                    R_GRAPHSVERTICALBAR_SETTING_TITLE,
-                    R_GRAPHSVERTICALBAR_SETTING_PAGE,
-                    NULL,
-                    ordinal++);
-    
-    AddSettingItemL(ESettingListItemGraphsSources,
-                    R_SOURCES_SETTING_TITLE,
-                    R_SOURCES_SETTING_PAGE,
-                    NULL,
-                    ordinal++);                    
-//
-    AddSettingItemL(ESettingListItemLoggingMode,
-                    R_LOGGINGMODE_SETTING_TITLE,
-                    R_LOGGINGMODE_SETTING_PAGE,
-                    R_LOGGINGMODE_SETTING_TEXTS,
-                    ordinal++);
-
-     AddSettingItemL(ESettingListItemLoggingFilePath,
-                    R_LOGGINGFILEPATH_SETTING_TITLE,
-                    R_LOGGINGFILEPATH_SETTING_PAGE,
-                    NULL,
-                    ordinal++);
-    
-    AddSettingItemL(ESettingListItemLoggingSources,
-                    R_SOURCES_SETTING_TITLE,
-                    R_SOURCES_SETTING_PAGE,
-                    NULL,
-                    ordinal++);                    
-                                                             
-    SetVisibilitiesOfSettingItemsL(); 
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonSettingsViewDlg::AddSettingItemL(TInt aId,
-                                                 TInt aTitleResource,
-                                                 TInt aSettingPageResource,
-                                                 TInt aAssociatedResource,
-                                                 TInt aOrdinal)
-    {
-    // create a setting item
-    CAknSettingItem* settingItem = NULL;
-    
-    switch (aId)
-        {
-        case ESettingListItemHeartBeat:
-            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aId, iSettings.iHeartBeat);
-            break;
-
-        case ESettingListItemMaxSamples:
-            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aId, iSettings.iMaxSamples);
-            break;
-
-        case ESettingListItemPriority:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iPriority);
-            break;
-
-        case ESettingListItemCPUMode:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iCPUMode);
-            break;
-
-        case ESettingListItemKeepBackLightOn:
-            settingItem = new(ELeave) CAknBinaryPopupSettingItem(aId, iSettings.iKeepBacklightOn);
-            break;
-
-        case ESettingListItemDataPopupVisbility:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iDataPopupVisibility);
-            break;
-
-        case ESettingListItemDataPopupLocation:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iDataPopupLocation);
-            break;
-
-        case ESettingListItemDataPopupSources:
-            settingItem = new(ELeave) CSourceSelectionCheckBoxSettingItem(aId, iSettings.iDataPopupSources);
-            break;
-
-        case ESettingListItemGraphsVerticalBarPeriod:
-            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aId, iSettings.iGraphsVerticalBarPeriod);
-            break;
-
-        case ESettingListItemGraphsSources:
-            settingItem = new(ELeave) CSourceSelectionCheckBoxSettingItem(aId, iSettings.iGraphsSources);
-            break;
-
-        case ESettingListItemLoggingMode:
-            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aId, iSettings.iLoggingMode);
-            break;
-
-        case ESettingListItemLoggingFilePath:
-            settingItem = new(ELeave) CAknTextSettingItem(aId, iSettings.iLoggingFilePath);
-            break;
-
-        case ESettingListItemLoggingSources:
-            settingItem = new(ELeave) CSourceSelectionCheckBoxSettingItem(aId, iSettings.iLoggingSources);
-            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
-    }
-
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-	
-CSourceSelectionCheckBoxSettingItem::CSourceSelectionCheckBoxSettingItem( TInt aIdentifier, TPerfMonSources& aMemoryInUse ): 
-	CAknSettingItem(aIdentifier), iExternalSources( aMemoryInUse ) 
-	{
-	}	
-
-CSourceSelectionCheckBoxSettingItem::~CSourceSelectionCheckBoxSettingItem()
-	{
-	delete iSettingText;
-
-    if( iItemArray )
-        {
-        iItemArray->ResetAndDestroy();
-        delete iItemArray;
-        }
-	}
-
-void CSourceSelectionCheckBoxSettingItem::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 CSourceSelectionCheckBoxSettingItem::CompleteConstructionL()
-	{
-    SetEmptyItemTextL(_L("Nothing selected"));
-
-    iItemArray = new(ELeave) CSelectionItemList(16);
-    AddNewItemToArrayL(_L("CPU"));
-    AddNewItemToArrayL(_L("RAM"));
-    AddNewItemToArrayL(_L("C:"));
-    AddNewItemToArrayL(_L("D:"));
-    AddNewItemToArrayL(_L("E:"));
-    AddNewItemToArrayL(_L("F:"));
-    AddNewItemToArrayL(_L("G:"));
-    AddNewItemToArrayL(_L("H:"));
-    AddNewItemToArrayL(_L("I:"));
-
-	__ASSERT_ALWAYS(ESourcesLength==iItemArray->Count(), User::Panic(_L("Src.mismatch"),443));
-    }
-
-// transfer settings to the variables defined in the constructor    	
-void CSourceSelectionCheckBoxSettingItem::StoreL()
-	{
-	for (TInt i=0; i<ESourcesLength; i++)
-	    {
-        iExternalSources.iSrcEnabled[i] = iItemArray->At(i)->SelectionStatus();
-	    }
-	}
-
-// load settings from the variables defined in the constructor to our internal variables
-void CSourceSelectionCheckBoxSettingItem::LoadL()
-	{
-	for (TInt i=0; i<ESourcesLength; i++)
-	    {
-        iItemArray->At(i)->SetSelectionStatus( iExternalSources.iSrcEnabled[i] );
-	    }
-	}
-
-// returns the text shown in the setting item list
-const TDesC& CSourceSelectionCheckBoxSettingItem::SettingTextL()
-	{
-    TBuf<32> settingText;
-
-    if (iItemArray->At(ESourceCPU)->SelectionStatus())
-        settingText.Append(_L("CPU "));
-    if (iItemArray->At(ESourceRAM)->SelectionStatus())
-        settingText.Append(_L("RAM "));
-    if (iItemArray->At(ESourceC)->SelectionStatus())
-        settingText.Append(_L("C: "));
-    if (iItemArray->At(ESourceD)->SelectionStatus())
-        settingText.Append(_L("D: "));
-    if (iItemArray->At(ESourceE)->SelectionStatus())
-        settingText.Append(_L("E: "));
-    if (iItemArray->At(ESourceF)->SelectionStatus())
-        settingText.Append(_L("F: "));
-    if (iItemArray->At(ESourceG)->SelectionStatus())
-        settingText.Append(_L("G: "));
-    if (iItemArray->At(ESourceH)->SelectionStatus())
-        settingText.Append(_L("H: "));
-    if (iItemArray->At(ESourceI)->SelectionStatus())
-        settingText.Append(_L("I: "));
-    settingText.TrimAll();
-
-    if (iSettingText)
-        {
-        delete iSettingText;
-        iSettingText = NULL;
-        }
-
-    iSettingText = HBufC::NewL(settingText.Length());
-    iSettingText->Des().Copy(settingText);
-
-	if ( iSettingText->Length() > 0 )
-		return *iSettingText;
-	else
-		return EmptyItemText();
-	}
-
-
-// launches the setting page
-void CSourceSelectionCheckBoxSettingItem::EditItemL(TBool /*aCalledFromMenu*/)
-	{
-	CSourceSelectionCheckBoxSettingPage* dlg = new(ELeave) CSourceSelectionCheckBoxSettingPage(SettingPageResourceId(), iItemArray);
-
-	SetSettingPage( dlg );
-	SettingPage()->SetSettingPageObserver(this);
-
-	SettingPage()->ExecuteLD(CAknSettingPage::EUpdateWhenChanged);
-	SetSettingPage(0); // it is deleted now
-	}
-
-
-// handles setting page events
-void CSourceSelectionCheckBoxSettingItem::HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType )
-    {
-    switch( aEventType )
-        {
-        case EEventSettingCancelled:
-            {
-            // If setting is cancelled, load old values
-            LoadL();
-            break;
-            }
-        case EEventSettingChanged:
-            {
-            // If setting has changed, update CBA visibility
-            static_cast<CSourceSelectionCheckBoxSettingPage*>( aSettingPage )->UpdateCba();
-            break;
-            }
-        default:
-            {
-            break;
-            }
-        }
-    CAknSettingItem::HandleSettingPageEventL( aSettingPage, aEventType );
-    }
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-
-CSourceSelectionCheckBoxSettingPage::CSourceSelectionCheckBoxSettingPage(TInt aResourceID, CSelectionItemList* aItemArray )
-    : CAknCheckBoxSettingPage( aResourceID, aItemArray )
-	{
-	}
-
-void CSourceSelectionCheckBoxSettingPage::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 );
-		}
-	}
-
-// --------------------------------------------------------------------------------------------
-// --------------------------------------------------------------------------------------------
-    
-// End of File
--- a/perfmon/ui/avkon/src/perfmon_valuescontainer.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 "perfmon_valuescontainer.h"
-#include "perfmon.hrh"
-#include "perfmon_document.h"
-#include "perfmon_appui.h"
-#include "perfmon_model.h"
-
-#include <AknUtils.h>
-
-_LIT(KPercentageFormat,"%S %d%%");
-_LIT(KFreeFormat,"%S free %S%S"); 
-_LIT(KSizeFormat,"%S size %S%S"); 
-
-const TInt KLeftMargin = 2;
-
-
-// ===================================== MEMBER FUNCTIONS =====================================
-
-void CPerfMonValuesContainer::ConstructL(const TRect& aRect)
-    {
-    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    iFont = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);
- 
-    CreateWindowL();
-    SetRect(aRect);
-    SetBlank();
-
-    ActivateL();
-    }
-
-// --------------------------------------------------------------------------------------------
-
-CPerfMonValuesContainer::~CPerfMonValuesContainer()
-    {
-    }
-    
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonValuesContainer::Draw(const TRect& aRect) const
-    {
-    CWindowGc& gc = SystemGc();
-    gc.SetBrushColor(KRgbWhite);
-    gc.Clear(aRect);
-    
-    // check if sample array has been constructed
-    if (iModel->SampleEntryArray())
-        {
-        // init font
-        gc.SetPenColor(KRgbBlack);
-        gc.UseFont( iFont );
-        TUint separator = iFont->HeightInPixels()-2;
-
-        TInt c(1);
-
-        // draw all entries
-        for (TInt i=0; i<iModel->SampleEntryArray()->Count(); i++)
-            {
-            // check if data available
-            if (iModel->SampleEntryArray()->At(i).iSampleDataArray->Count() > 0)
-                {
-                TSampleData& currentSample = iModel->SampleEntryArray()->At(i).iSampleDataArray->At(0);
-                
-                if (i == ESourceCPU) // for CPU draw %
-                    {
-                    TBuf<16> buf;
-                    buf.Format(KPercentageFormat, &iModel->SampleEntryArray()->At(i).iDescription, currentSample.iSize > 0 ? TInt( (1 - ((TReal)(currentSample.iFree) / (TReal)currentSample.iSize)) * 100) : 0 );
-                    gc.DrawText(buf, TPoint(KLeftMargin,separator*c));
-                    c++;
-                    }
-                
-                else if (currentSample.iSize > 0) // ram+drives, ignore absent drives
-                    {
-                    TBuf<32> amountBuf;
-                    amountBuf.AppendNum(currentSample.iFree, TRealFormat(KDefaultRealWidth, 0));
-        
-                    TBuf<32> buf;
-                    buf.Format(KFreeFormat, &iModel->SampleEntryArray()->At(i).iDescription, &amountBuf, &iModel->SampleEntryArray()->At(i).iUnitTypeShort);
-                    gc.DrawText(buf, TPoint(KLeftMargin,separator*c));
-                    c++;
-                    
-                    amountBuf.Copy(KNullDesC);
-                    amountBuf.AppendNum(currentSample.iSize, TRealFormat(KDefaultRealWidth, 0));
-        
-                    buf.Format(KSizeFormat, &iModel->SampleEntryArray()->At(i).iDescription, &amountBuf, &iModel->SampleEntryArray()->At(i).iUnitTypeShort);
-                    gc.DrawText(buf, TPoint(KLeftMargin,separator*c));
-                    c++;            
-                    }                    
-                }
-            }
-           
-        gc.DiscardFont();        
-        }
-    }
-
-// --------------------------------------------------------------------------------------------
-
-TKeyResponse CPerfMonValuesContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    return CCoeControl::OfferKeyEventL(aKeyEvent, aType);
-    }
-        
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonValuesContainer::HandleResourceChange(TInt aType)
-    {
-    if (aType == KEikDynamicLayoutVariantSwitch)
-        {
-        TRect mainPaneRect;
-        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
-        SetRect(mainPaneRect);
-        }
-    else
-        CCoeControl::HandleResourceChange(aType);    
-    }
-
-// --------------------------------------------------------------------------------------------
-
-void CPerfMonValuesContainer::DrawUpdate()
-    {
-    DrawDeferred(); 
-    }
-    
-// --------------------------------------------------------------------------------------------
-       
-// End of File  
--- a/perfmon/ui/avkon/src/perfmon_valuesview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,147 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 "perfmon.hrh"
-#include "perfmon_valuesview.h"
-#include "perfmon_valuescontainer.h"
-#include "perfmon_document.h" 
-#include "perfmon_model.h"
-#include <perfmon.rsg>
-
-#include <eikenv.h>
-#include <aknViewAppUi.h> 
-
-
-// ================= MEMBER FUNCTIONS =======================
-
-// ---------------------------------------------------------
-// CPerfMonValuesView::ConstructL(const TRect& aRect)
-// EPOC two-phased constructor
-// ---------------------------------------------------------
-//
-void CPerfMonValuesView::ConstructL()
-    {
-    BaseConstructL( R_PERFMON_VIEW_VALUES );
-    iModel = static_cast<CPerfMonDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
-    }
-
-// ---------------------------------------------------------
-// CPerfMonValuesView::~CPerfMonValuesView()
-// ---------------------------------------------------------
-//
-CPerfMonValuesView::~CPerfMonValuesView()
-    {
-    if (iContainer)
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    }
-
-// ---------------------------------------------------------
-// TUid CPerfMonValuesView::Id()
-// ---------------------------------------------------------
-//
-TUid CPerfMonValuesView::Id() const
-    {
-    return KValuesViewUID;
-    }
-
-// ---------------------------------------------------------
-// TUid CPerfMonValuesView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-// ---------------------------------------------------------
-//
-void CPerfMonValuesView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
-    {
-    AppUi()->DynInitMenuPaneL(aResourceId, aMenuPane);
-    }
-
-  
-// ---------------------------------------------------------
-// CPerfMonValuesView::HandleCommandL(TInt aCommand)
-// ---------------------------------------------------------
-//
-void CPerfMonValuesView::HandleCommandL(TInt aCommand)
-    {   
-/*
-    switch ( aCommand )
-        {
-        case EPerfMonCmdFileBack:
-            {
-            iModel->FileUtils()->MoveUpOneLevelL();
-            break;
-            }
-
-        default:
-            {
-*/
-            AppUi()->HandleCommandL( aCommand );
-/*
-            break;
-            }
-        }
-*/
-    }
-
-// ---------------------------------------------------------
-// CPerfMonValuesView::HandleClientRectChange()
-// ---------------------------------------------------------
-//
-void CPerfMonValuesView::HandleClientRectChange()
-    {
-    if ( iContainer )
-        {
-        iContainer->SetRect( ClientRect() );
-        }
-    }
-
-// ---------------------------------------------------------
-// CPerfMonValuesView::DoActivateL(...)
-// ---------------------------------------------------------
-//
-void CPerfMonValuesView::DoActivateL(
-   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
-   const TDesC8& /*aCustomMessage*/)
-    {
-    if (!iContainer)
-        {
-        iContainer = new (ELeave) CPerfMonValuesContainer;
-        iModel->SetValuesContainer(iContainer);
-        iContainer->SetMopParent(this);
-        iContainer->ConstructL( ClientRect() );
-        AppUi()->AddToStackL( *this, iContainer );
-        } 
-   }
-
-// ---------------------------------------------------------
-// CPerfMonValuesView::DoDeactivate()
-// ---------------------------------------------------------
-//
-void CPerfMonValuesView::DoDeactivate()
-    {
-    if (iContainer)
-        {
-        AppUi()->RemoveFromViewStack( *this, iContainer );
-        delete iContainer;
-        iContainer = NULL;
-        }
-    }
-
-// End of File
--- a/perfmon/ui/hb/app/app.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-#
-# 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 = PerfMon
-DEPENDPATH += .
-INCLUDEPATH += inc
-
-load(hb.prf)
-symbian:CONFIG -= symbian_i18n
-
-HEADERS += inc/application.h \
-    inc/mainwindow.h \
-    inc/mainview.h \
-    inc/datacontainer.h \
-    inc/valuedatacontainer.h \
-    inc/graphdatacontainer.h \
-    inc/settingsview.h \
-    inc/datapopup.h \
-    inc/enginewrapper.h
-
-SOURCES += src/main.cpp \
-    src/application.cpp \
-    src/mainwindow.cpp \
-    src/mainview.cpp \
-    src/valuedatacontainer.cpp \
-    src/graphdatacontainer.cpp \
-    src/settingsview.cpp \
-    src/datapopup.cpp \
-    src/enginewrapper.cpp
-
-RESOURCES +=
-
-symbian: {
-    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE 
-    INCLUDEPATH += ../../../engine/inc
-    HEADERS += ../../../engine/inc/perfmon_engine.h
-
-    SOURCES += ../../../engine/src/perfmon_engine.cpp
-
-    LIBS += -lestor \
-        -lbafl \
-        -lefsrv \
-        -lavkon \
-        -lapparc \
-        -lapgrfx \
-        -lgdi \
-        -lcone
-
-    TARGET.CAPABILITY = WriteDeviceData
-
-    TARGET.UID2 = 0x100039CE
-    TARGET.UID3 = 0x20011385
-    TARGET.SID = 0x20011385
-    TARGET.VID = 0x101FB657 // Nokia
-
-    TARGET.EPOCHEAPSIZE = 0x10000 0x2000000  // Min 64Kb, Max 32Mb
-
-    ICON = ../../../icons/qgn_menu_perfmon.svg
-
-    RSS_RULES += "group_name = \"RnD Tools\"";
-}
--- a/perfmon/ui/hb/app/inc/application.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* 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 APPLICATION_H
-#define APPLICATION_H
-
-#include <HbApplication>
-
-
-class QSymbianEvent;
-
-class Application : public HbApplication
-{
-    Q_OBJECT
-
-public:
-    Application(int &argc, char *argv[]);
-
-signals:
-    void foregroundEvent(bool foreground);
-
-protected:
-#ifdef Q_OS_SYMBIAN
-    bool symbianEventFilter(const QSymbianEvent * event);
-#endif
-};
-
-#endif // APPLICATION_H
--- a/perfmon/ui/hb/app/inc/datacontainer.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-/*
-* 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 DATACONTAINER_H
-#define DATACONTAINER_H
-
-#include <hbwidget.h>
-#include <enginewrapper.h>
-
-class DataContainer : public HbWidget
-{
-    Q_OBJECT
-
-public:
-    DataContainer(const EngineWrapper& engine, QGraphicsItem *parent = 0) :
-            HbWidget(parent),
-            mEngine(engine)
-    {
-    }
-
-    void hideContainer()
-        {
-        disconnect(&mEngine, SIGNAL(samplesUpdated()), this, SLOT(samplesUpdated()));
-        hide();
-        }
-    
-    void showContainer()
-        {
-        connect(&mEngine, SIGNAL(samplesUpdated()),this, SLOT(samplesUpdated()));
-        show();
-        }
-    
-    inline const EngineWrapper& engine() const { return mEngine; }
-
-public slots:
-    virtual void samplesUpdated()
-    {
-    update();
-    }
-
-private:
-    const EngineWrapper& mEngine;
-};
-
-#endif // DATACONTAINER_H
--- a/perfmon/ui/hb/app/inc/datapopup.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* 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 DATAPOPUP_H
-#define DATAPOPUP_H
-
-#include <HbDeviceDialog>
-#include <QFont>
-
-class EngineWrapper;
-
-class DataPopup : public HbDeviceDialog
-{
-    Q_OBJECT
-
-public:
-    DataPopup(EngineWrapper &engine);
-
-public slots:
-    void show();
-    void hide();
-    void updateSamples();
-    void updateSettings();
-    void updateVisibility(bool foreground);
-
-signals:
-    void clicked();
-
-private slots:
-    void triggerAction(QVariantMap data);
-
-private:
-    QVariantMap collectParams() const;
-    void updateData();
-
-private:
-    EngineWrapper &mEngine;
-
-    bool mPopupCreated;
-
-    bool mPopupVisible;
-};
-
-#endif // DATAPOPUP_H
--- a/perfmon/ui/hb/app/inc/enginewrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,194 +0,0 @@
-/*
-* 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 "perfmon_engine.h"
-
-#include <QObject>
-#include <QColor>
-#include <QList>
-#include <QVariant>
-
-struct SampleData
-{
-    qint64 mFree;
-    qint64 mSize;
-    qint64 mTimeFromStart;
-};
-
-class SampleEntry
-{
-public:
-    SampleEntry(const TSampleEntry& sampleEntry) : mEntry(&sampleEntry) {}
-
-    QString description() const { return QString((QChar*)mEntry->iDescription.Ptr(), mEntry->iDescription.Length()); }
-    QString unitShort() const { return QString((QChar*)mEntry->iUnitTypeShort.Ptr(), mEntry->iUnitTypeShort.Length()); }
-    QString unitLong() const { return QString((QChar*)mEntry->iUnitTypeLong.Ptr(), mEntry->iUnitTypeLong.Length()); }
-    int driveNumber() const { return mEntry->iDriveNumber; }
-    QColor graphColor() const { return QColor(mEntry->iGraphColor.Red(), mEntry->iGraphColor.Green(), mEntry->iGraphColor.Blue()); }
-
-    int sampleCount() const { return mEntry->iSampleDataArray->Count(); }
-    inline const SampleData& sample(int index) const { return reinterpret_cast<SampleData&>(mEntry->iSampleDataArray->At(index)); }
-private:
-    const TSampleEntry *mEntry;
-
-friend class EngineWrapper;
-};
-
-class PerfMonSources
-{
-public:
-    int count() const { return ESourcesLength; }
-    int isEnabled (int index) const { return mSources.iSrcEnabled[index]; }
-    void setEnabled(int index, bool enabled) { mSources.iSrcEnabled[index] = enabled; }
-    QList<QVariant> enabledIndexes() const {
-        QList<QVariant> indexes;
-        for(int i=0; i<count(); i++) {
-            if (isEnabled(i))
-                indexes.append(i);
-        }
-        return indexes;
-    }
-    void setEnabledIndexes(const QList<QVariant> &indexes)
-    {
-        for (int i=0; i<count(); i++) {
-            setEnabled(i, false);
-        }
-        foreach (const QVariant& index, indexes) {
-        	setEnabled(index.toInt(), true);
-        }
-    }
-
-private:
-    PerfMonSources(TPerfMonSources &sources) : mSources(sources) {}
-    friend class PerfMonSettings;
-
-private:
-    TPerfMonSources &mSources;
-};
-
-class PerfMonSettings
-{
-public:
-    int heartBeat() const { return mSettings.iHeartBeat; }
-    int maxSamples() const { return mSettings.iMaxSamples; }
-    int priority() const { return mSettings.iPriority; }
-    int cpuMode() const { return mSettings.iCPUMode; }
-    bool keepBacklightOn() const { return mSettings.iKeepBacklightOn; }
-
-    int dataPopupVisibility() const { return mSettings.iDataPopupVisibility; }
-    int dataPopupLocation() const { return mSettings.iDataPopupLocation; }
-    PerfMonSources &dataPopupSources() { return mDataPopupSources; }
-    const PerfMonSources &dataPopupSources() const { return mDataPopupSources; }
-
-    int graphVerticalBarPeriod() const { return mSettings.iGraphsVerticalBarPeriod; }
-    PerfMonSources &graphSources() { return mGraphSources; }
-    const PerfMonSources &graphSources() const { return mGraphSources; }
-
-    int loggingMode() const { return mSettings.iLoggingMode; }
-    QString loggingFilePath() const {
-        return QString((QChar*)mSettings.iLoggingFilePath.Ptr(),
-                       mSettings.iLoggingFilePath.Length());
-    }
-    PerfMonSources &loggingSources() { return mLogSources; }
-    const PerfMonSources &loggingSources() const { return mLogSources; }
-
-    bool loggingEnabled() { return mSettings.iLoggingEnabled; }
-
-
-    void setHeartBeat(int heartBeat) { mSettings.iHeartBeat = heartBeat; }
-    void setMaxSamples(int maxSamples) { mSettings.iMaxSamples = maxSamples; }
-    void setPriority(int priority) { mSettings.iPriority = priority; }
-    void setCpuMode(int cpuMode) { mSettings.iCPUMode = cpuMode; }
-    void setKeepBacklightOn(bool backlightOn) const { mSettings.iKeepBacklightOn = backlightOn; }
-
-    void setDataPopupVisibility(int visibility) { mSettings.iDataPopupVisibility = visibility; }
-    void setDataPopupLocation(int location) { mSettings.iDataPopupLocation = location; }
-
-    void setGraphVerticalBarPeriod(int period) { mSettings.iGraphsVerticalBarPeriod = period; }
-
-    void setLoggingMode(int mode) { mSettings.iLoggingMode = mode; }
-    void setLoggingFilePath(const QString& filePath) { mSettings.iLoggingFilePath = filePath.utf16(); }
-
-private:
-    // only EngineWrapper can create Settings instance
-    PerfMonSettings(TPerfMonSettings &settings) :
-            mSettings(settings),
-            mDataPopupSources(settings.iDataPopupSources),
-            mGraphSources(settings.iGraphsSources),
-            mLogSources(settings.iLoggingSources)
-    {}
-    friend class EngineWrapper;
-
-private:
-    TPerfMonSettings &mSettings;
-    PerfMonSources mDataPopupSources;
-    PerfMonSources mGraphSources;
-    PerfMonSources mLogSources;
-};
-
-/**
- * class that is used for communicating between Symbian and Qt code.
- */
-class EngineWrapper : public QObject, public CPerfMonEngine
- {
-    Q_OBJECT
-
-public:
-
-    /**
-     * Constructor
-     */
-    EngineWrapper();
-
-    /**
-     * Destructor
-     */
-    ~EngineWrapper();
-
-public:
-    const QList<SampleEntry>& sampleEntries() const { return mEntries; }
-
-    PerfMonSettings &settings() { return mSettings; }
-    const PerfMonSettings &settings() const { return mSettings; }
-
-public slots:
-
-    bool updateSettings();
-    bool initialize();
-    void finalize();
-    void setLoggingEnabled(bool enabled);
-
-signals:
-
-    void samplesUpdated();
-    void settingsUpdated();
-
-protected:
-    void SendDrawEventToContainersL();
-
-private:
-    QList<SampleEntry> mEntries;
-
-    void createSampleEntriesArray();
-
-    PerfMonSettings mSettings;
-};
-
-#endif //ENGINEWRAPPER_H
--- a/perfmon/ui/hb/app/inc/graphdatacontainer.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* 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 GRAPHDATACONTAINER_H
-#define GRAPHDATACONTAINER_H
-
-#include "datacontainer.h"
-
-#include <QFont>
-
-class GraphDataContainer : public DataContainer
-{
-    Q_OBJECT
-public:
-    GraphDataContainer(const EngineWrapper& engine, QGraphicsItem *parent = 0);
-
-protected:
-    void paint (QPainter *painter,
-                const QStyleOptionGraphicsItem *option,
-                QWidget *widget = 0);
-
-private:
-    QFont mFont;
-};
-
-#endif // GRAPHDATACONTAINER_H
--- a/perfmon/ui/hb/app/inc/mainview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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 "valuedatacontainer.h"
-#include "graphdatacontainer.h"
-
-class HbAction;
-class EngineWrapper;
-
-class MainView : public HbView
-{
-    Q_OBJECT
-
-public:
-    MainView(EngineWrapper &engine);
-    ~MainView();
-
-private:
-    void createMenu();
-
-public slots:
-    void showValues();
-    void showGraphs();
-    void toggleLogging();
-    void showAbout();
-
-signals:
-    void settingsCommandInvoked();
-
-private:
-    void updateLoggingAction();
-
-private:
-    EngineWrapper &mEngine;
-
-    ValueDataContainer *mValueDataContainer;
-    GraphDataContainer *mGraphDataContainer;
-
-    HbAction *mValuesAction;
-    HbAction *mGraphAction;
-    HbAction *mSwitchViewAction;
-    HbAction *mLoggingAction;
-};
-
-#endif // MAINVIEW_H
--- a/perfmon/ui/hb/app/inc/mainwindow.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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 MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <HbMainWindow>
-
-class EngineWrapper;
-class MainView;
-class SettingsView;
-
-class MainWindow : public HbMainWindow
-{
-    Q_OBJECT
-public:
-    MainWindow(EngineWrapper &engine, QWidget *parent = 0);
-
-public slots:
-    void showMainView();
-    void showSettings();
-
-private:
-    void clearViews();
-
-private:
-    EngineWrapper &mEngine;
-    MainView* mMainView;
-    SettingsView* mSettingsView;
-};
-
-#endif // MAINWINDOW_H
--- a/perfmon/ui/hb/app/inc/popupdatacontainer.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/*
-* 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 POPUPDATACONTAINER_H
-#define POPUPDATACONTAINER_H
-
-#include "datacontainer.h"
-
-#include <QFont>
-
-class PopupDataContainer : public DataContainer
-{
-    Q_OBJECT
-public:
-    PopupDataContainer(const EngineWrapper& engine, QGraphicsItem *parent = 0);
-
-public slots:
-    virtual void samplesUpdated();
-
-protected:
-    void paint (QPainter *painter,
-                const QStyleOptionGraphicsItem *option,
-                QWidget *widget = 0);
-
-private:
-    QFont mFont;
-};
-
-#endif // POPUPDATACONTAINER_H
--- a/perfmon/ui/hb/app/inc/settingsview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* 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 HbDataFormModel;
-class HbDataFormModelItem;
-
-class EngineWrapper;
-class PerfMonSettings;
-class PerfMonSources;
-
-class SettingsView : public HbView
-{
-    Q_OBJECT
-
-signals:
-    void finished(bool ok);
-
-public:
-    SettingsView(EngineWrapper &engine);
-
-private slots:
-    void dataItemDisplayed(const QModelIndex &index);
-    void logModeChanged(int index);
-    void accept();
-    void reject();
-
-private:
-    void createModel(HbDataFormModel &model);
-    void load(const PerfMonSettings& settings);
-    void save(PerfMonSettings& settings);
-    void createLogFilePathItem();
-    void removeLogFilePathItem();
-    
-private:
-    EngineWrapper &mEngine;
-    HbDataForm *mSettingsForm;
-    HbDataFormModel *mModel;
-
-    HbDataFormModelItem* mHeartBeatItem;
-    HbDataFormModelItem* mMaxSamplesItem;
-    HbDataFormModelItem* mPriorityItem;
-    HbDataFormModelItem* mCpuSamplingItem;
-    HbDataFormModelItem* mKeepBacklightItem;
-    HbDataFormModelItem* mPopupVisibilityItem;
-    HbDataFormModelItem* mPopupLocationItem;
-    HbDataFormModelItem* mPopupSourcesItem;
-    HbDataFormModelItem* mVerticalBarPeriodItem;
-    HbDataFormModelItem* mGraphSourcesItem;
-
-    HbDataFormModelItem* mLogPage;
-    HbDataFormModelItem* mLogModeItem;
-    HbDataFormModelItem* mLogFilePathItem;
-    HbDataFormModelItem* mLogSourcesItem;
-    
-    QString mLogFilePath;
-};
-
-#endif // SETTINGSVIEW_H
--- a/perfmon/ui/hb/app/inc/valuedatacontainer.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* 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 VALUEDATACONTAINER_H
-#define VALUEDATACONTAINER_H
-
-#include "datacontainer.h"
-
-#include <QFont>
-
-class ValueDataContainer : public DataContainer
-{
-    Q_OBJECT
-public:
-    ValueDataContainer(const EngineWrapper& engine, QGraphicsItem *parent = 0);
-
-protected:
-    void paint (QPainter *painter,
-                const QStyleOptionGraphicsItem *option,
-                QWidget *widget = 0);
-
-private:
-    QFont mFont;
-};
-
-#endif // VALUEDATACONTAINER_H
--- a/perfmon/ui/hb/app/src/application.cpp	Tue Aug 31 15:15:20 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:  
-*
-*/
-
-#include <QSymbianEvent>
-
-#include "application.h"
-
-#ifdef Q_OS_SYMBIAN
-#include <w32std.h>
-
-#endif
-
-Application::Application(int &argc, char *argv[]) :
-        HbApplication(argc, argv)
-{
-}
-
-#ifdef Q_OS_SYMBIAN
-bool Application::symbianEventFilter(const QSymbianEvent * event)
-{
-    if (event->type() == QSymbianEvent::WindowServerEvent)
-    {
-        const TWsEvent *aEvent = event->windowServerEvent();
-
-        if (aEvent->Type() == EEventFocusLost) {
-            emit foregroundEvent(false);
-        }
-
-        if (aEvent->Type() == EEventFocusGained) {
-            emit foregroundEvent(true);
-        }
-    }
-    return HbApplication::symbianEventFilter(event);
-}
-#endif
--- a/perfmon/ui/hb/app/src/datapopup.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
-* 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 <HbEvent>
-#include <QFontMetrics>
-
-#include "datapopup.h"
-#include "enginewrapper.h"
-#include "popupdatacontainer.h"
-
-DataPopup::DataPopup(EngineWrapper &engine) :
-        mEngine(engine),
-        mPopupCreated(false),
-        mPopupVisible(false)
-{
-    connect(&mEngine, SIGNAL(samplesUpdated()), this, SLOT(updateSamples()));
-    connect(&mEngine, SIGNAL(settingsUpdated()), this, SLOT(updateSettings()));
-    connect(this, SIGNAL(dataReceived(QVariantMap)), this, SLOT(triggerAction(QVariantMap)));
-}
-
-void DataPopup::show()
-{
-    mPopupVisible = true;
-    if (!mPopupCreated &&
-        mEngine.sampleEntries().length() &&
-        mEngine.settings().dataPopupSources().enabledIndexes().length())
-    {
-        bool anyData = false;
-        foreach (QVariant index, mEngine.settings().dataPopupSources().enabledIndexes())
-            anyData = anyData || mEngine.sampleEntries().at(index.toInt()).sampleCount();
-
-        if (anyData) {
-            mPopupCreated = HbDeviceDialog::show("com.nokia.rnd.perfmondatapopup/1.0",
-                                                 collectParams());
-        }
-    }
-}
-
-void DataPopup::hide()
-{
-    mPopupVisible = false;
-    if (mPopupCreated) {
-        mPopupCreated = !cancel();
-    }
-}
-
-void DataPopup::updateSamples()
-{
-    updateData();
-}
-
-void DataPopup::updateSettings()
-{
-    // mEngine.settings().dataPopupVisibility can only be changed from
-    // main window, so we may assume the window is in foreground
-    updateVisibility(true);
-    updateData();
-}
-
-void DataPopup::updateVisibility(bool foreground)
-{
-    if (mEngine.settings().dataPopupVisibility() == EDataPopupVisbilityAlwaysOn ||
-        (mEngine.settings().dataPopupVisibility() == EDataPopupVisbilityBackgroundOnly && !foreground)) {
-
-        show();
-    } else {
-        hide();
-    }
-}
-
-void DataPopup::triggerAction(QVariantMap data)
-{
-    if (data.contains("mouseEvent") && data["mouseEvent"].toString() == "press") {
-        emit clicked();
-
-        // data popup was clicked, move it to other position
-        mEngine.settings().setDataPopupLocation(
-                EDataPopupLocationBottomMiddle - mEngine.settings().dataPopupLocation());
-        mEngine.updateSettings();
-    }
-}
-
-QVariantMap DataPopup::collectParams() const
-{
-    QVariantMap result;
-
-    // add location param
-    result["location"] = mEngine.settings().dataPopupLocation();
-
-    // add lines param
-    QStringList lines;
-    QList<SampleEntry> entries = mEngine.sampleEntries();
-    for (int i=0; i<entries.length(); i++)
-    {
-        if (mEngine.settings().dataPopupSources().isEnabled(i) &&
-            entries.at(i).sampleCount() > 0)
-        {
-            const SampleEntry &entry = entries.at(i);
-            const SampleData &sample = entry.sample(0);
-
-            if (i == ESourceCPU)
-            {
-                // CPU
-                double perc = sample.mSize > 0 ?
-                              100. - 100. * sample.mFree / sample.mSize : 0;
-
-
-                QString text = tr("%1 %2%").arg(entry.description()).
-                               arg(perc, 0, 'f', 0);
-                lines.append(text);
-            }
-            else
-            {
-                // RAM and Drives
-                QString text = tr("%1 free %L2%3").arg(entry.description()).
-                               arg(sample.mFree).arg(entry.unitShort());
-                lines.append(text);
-            }
-        }
-    }
-    result["lines"] = lines;
-
-    return result;
-}
-
-void DataPopup::updateData()
-{
-    if (!mPopupVisible)
-        return;
-
-    if (!mPopupCreated) {
-        show();
-    } else {
-        HbDeviceDialog::update(collectParams());
-    }
-}
--- a/perfmon/ui/hb/app/src/enginewrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* 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 <e32def.h>
-#include <e32cmn.h>
-
-#include "enginewrapper.h"
-
-
-// ---------------------------------------------------------------------------
-
-EngineWrapper::EngineWrapper() : mSettings(iSettings)
-{
-}
-
-// ---------------------------------------------------------------------------
-
-EngineWrapper::~EngineWrapper()
-{
-    finalize();
-}
-
-// ---------------------------------------------------------------------------
-
-bool EngineWrapper::initialize()
-{
-    TInt err = KErrNone;
-
-    TRAP(err, ConstructL());
-    if (err != KErrNone)
-        return false;
-
-    TRAP(err, ActivateEngineL());
-    if (err != KErrNone)
-        return false;
-
-    createSampleEntriesArray();
-
-    return true;
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::createSampleEntriesArray()
-{
-    for (TInt i=0; i < iSampleEntryArray->Count(); i++)
-    {
-        mEntries.append(iSampleEntryArray->At(i));
-    }
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::finalize()
-{
-    TRAP_IGNORE(DeActivateEngineL());
-}
-
-// ---------------------------------------------------------------------------
-
-bool EngineWrapper::updateSettings()
-{
-    TInt err = KErrNone;
-
-    TRAP(err, SaveSettingsL());
-    if (err != KErrNone)
-        return false;
-
-    TRAP(err, HandleSettingsChangeL());
-    if (err != KErrNone)
-        return false;
-
-    emit settingsUpdated();
-    return true;
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::setLoggingEnabled(bool enabled)
-{
-    EnableLogging(enabled);    
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::SendDrawEventToContainersL()
-{
-    emit samplesUpdated();
-}
-
-// ---------------------------------------------------------------------------
--- a/perfmon/ui/hb/app/src/graphdatacontainer.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
-* 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 "graphdatacontainer.h"
-#include "enginewrapper.h"
-
-#include <QPainter>
-#include <QFontMetrics>
-
-const int amountOfMicroSecondsFitsScreen = 20 * 1000000;
-const int microToSecondMultiplier = 1000000;
-
-GraphDataContainer::GraphDataContainer(const EngineWrapper& engine, QGraphicsItem *parent) :
-    DataContainer(engine, parent)
-{
-    HbFontSpec spec(HbFontSpec::Secondary);
-    mFont = spec.font();
-    mFont.setPixelSize(12);
-}
-
-void GraphDataContainer::paint (QPainter *painter,
-    const QStyleOptionGraphicsItem *option,
-    QWidget *widget)
-{
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-
-    // set proper font and prepare font metrics for text width / height calculation
-    painter->setFont(mFont);
-    QFontMetricsF metrics(mFont);
-
-    // fill background with black color
-    painter->fillRect(rect(), Qt::black);
-
-    // calculate time factor
-    qreal scaleFactor = rect().width() / (qreal) amountOfMicroSecondsFitsScreen;
-
-    // calculate area height which is used to draw the grpahs
-    qreal drawAreaHeight = rect().height() - 2 * metrics.height();
-
-
-    const QList<SampleEntry> sampleEntries = engine().sampleEntries();
-
-    // check if sample array has been constructed
-    if (sampleEntries.length())
-    {
-        // draw vertical time lines first
-        int verticalBarPeriodInSecs = engine().settings().graphVerticalBarPeriod();
-
-        if (verticalBarPeriodInSecs >= 1 && sampleEntries.first().sampleCount() > 0)
-        {
-            // get time from the first sample
-            const SampleData& firstSample = sampleEntries.first().sample(0);
-            qint64 currentMicroSeconds = firstSample.mTimeFromStart;
-
-            // calculate amount of microseconds exceeding value by using the modulo operator
-            int remainderInMicroSeconds = currentMicroSeconds % (verticalBarPeriodInSecs * 1000000);
-
-            // calculate first x pos
-            qreal vbarXpos = rect().width() - (remainderInMicroSeconds * scaleFactor);
-
-            // calculate the amount in seconds
-            int barSeconds = (currentMicroSeconds - remainderInMicroSeconds) / microToSecondMultiplier;
-
-            // continue drawing periodically the vertical lines
-            while (vbarXpos >= 0 && barSeconds >= 0)
-            {
-                // draw vertical line
-                painter->setPen(Qt::darkRed);
-                painter->drawLine(QPointF(vbarXpos, metrics.height() + 1),
-                                  QPointF(vbarXpos, rect().height() - metrics.height()));
-
-                // draw seconds value
-                painter->setPen(Qt::darkGray);
-                QString secsText = QString("%1s").arg(barSeconds);
-                QPointF secsPos(vbarXpos - metrics.width(secsText) / 2,
-                                rect().height());
-                painter->drawText(secsPos, secsText);
-
-                // calculate new position
-                vbarXpos -= verticalBarPeriodInSecs * 1000000 * scaleFactor;
-                barSeconds -= verticalBarPeriodInSecs;
-            }
-        }
-
-        // draw the basic grid
-        painter->setPen(Qt::darkGray);
-
-        qreal axisY = metrics.height();
-        painter->drawLine(QPointF(0, axisY), QPointF(rect().width(), axisY)); // upper line
-        painter->drawText(QPointF(0, axisY), tr("100%"));
-
-        axisY = rect().height() / 2;
-        painter->drawLine(QPointF(0, axisY), QPointF(rect().width(), axisY)); // mid line
-        painter->drawText(QPointF(0, axisY), tr("50%"));
-
-        axisY = rect().height() - metrics.height();
-        painter->drawLine(QPointF(0, axisY), QPointF(rect().width(), axisY)); // bottom line
-        painter->drawText(QPointF(0, axisY), tr("0%"));
-
-        int c = 0;
-        // draw graphs for each sampled type
-        for (int i=0; i<sampleEntries.length(); i++)
-        {
-            // check if this setting has been enabled and it has some data
-            if (engine().settings().graphSources().isEnabled(i) &&
-                sampleEntries.at(i).sampleCount() > 0)
-            {
-                // set pen color for the graph
-                painter->setPen(sampleEntries.at(i).graphColor());
-
-                // remember the position where drawing started
-                qreal currentXPos(rect().width()); // start drawing from right
-                qreal currentYPos(0.);
-
-                // draw samples
-                for (int j=0; j<sampleEntries.at(i).sampleCount()-1; j++)
-                {
-                    const SampleData& currentSample = sampleEntries.at(i).sample(j);
-                    const SampleData& previousSample = sampleEntries.at(i).sample(j+1);
-
-                    // calculate X position for previous (j+1)
-                    qreal previousXPos = currentXPos -
-                        qAbs(previousSample.mTimeFromStart - currentSample.mTimeFromStart) * scaleFactor;
-
-
-                    // calculate initial Y position
-                    if (j==0)
-                    {
-                        currentYPos = currentSample.mSize > 0 ?
-                            drawAreaHeight * currentSample.mFree / currentSample.mSize + metrics.height() :
-                            rect().height() - metrics.height();
-                    }
-
-                    // calculate Y position for previous (j+1)
-                    qreal previousYPos = previousSample.mSize > 0 ?
-                        drawAreaHeight * previousSample.mFree / previousSample.mSize + metrics.height() :
-                        rect().height() - metrics.height();
-
-
-                    // draw a line between the previous and current
-                    painter->drawLine(QPointF(previousXPos, previousYPos),
-                                      QPointF(currentXPos, currentYPos));
-
-                    // draw current value in %
-                    if (j==0) // draw the value of first sample
-                    {
-                        qreal perc = currentSample.mSize > 0 ?
-                                     100. - 100. * currentSample.mFree / currentSample.mSize : 0;
-                        QString percText = QString ("%1 %2%").
-                                           arg(sampleEntries.at(i).description()).
-                                           arg(perc, 0, 'f', 0);
-
-                        painter->drawText(QPointF(0, metrics.height() * (c + 2)),
-                                          percText);
-                        c++;
-                    }
-
-
-                    // stop drawing if we have run out of space
-                    if (previousXPos < 0)
-                        break;
-
-                    // remeber previous values
-                    currentXPos = previousXPos;
-                    currentYPos = previousYPos;
-                }
-
-
-            }
-        }
-
-    }
-}
--- a/perfmon/ui/hb/app/src/main.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* 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 <QMessageBox>
-
-#include "application.h"
-#include "enginewrapper.h"
-#include "mainwindow.h"
-#include "datapopup.h"
-
-int main(int argc, char *argv[])
-{
-    Application app(argc, argv);
-	
-    EngineWrapper engine;
-    if (!engine.initialize())
-    {
-        QMessageBox::critical(0, QObject::tr("Error"), QObject::tr("Unable to initialize engine. Application will now quit."));
-        return 1;
-    }
-
-    MainWindow window(engine);
-	window.show();
-
-//    DataPopup dataPopup(engine);
-
-//    QObject::connect(&app, SIGNAL(foregroundEvent(bool)),
-//                     &dataPopup, SLOT(updateVisibility(bool)));
-
-    // TODO: pass false if run in background
-//    dataPopup.updateVisibility(true);
-
-    return app.exec();
-}
--- a/perfmon/ui/hb/app/src/mainview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* 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 <QActionGroup>
-#include <HbApplication>
-#include <HbMenu>
-#include <HbToolBar>
-#include <HbAction>
-#include <HbMessageBox>
-#include <HbLabel>
-
-#include "mainview.h"
-#include "enginewrapper.h"
-
-
-// ---------------------------------------------------------------------------
-
-MainView::MainView(EngineWrapper &engine) :
-    mEngine(engine),
-    mValueDataContainer(0),
-    mGraphDataContainer(0)
-{
-    setTitle(tr("Perf. Monitor"));
-    mValueDataContainer = new ValueDataContainer(mEngine, this); 
-    mGraphDataContainer = new GraphDataContainer(mEngine, this);
-    createMenu();
-    showValues();
-}
-
-// ---------------------------------------------------------------------------
-
-MainView::~MainView()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-void MainView::createMenu()
-{
-    HbMenu *menu = this->menu();
-    HbToolBar *toolbar = this->toolBar();
-
-    if (menu && toolbar) {
-        mSwitchViewAction = new HbAction(toolbar);
-        toolbar->addAction(mSwitchViewAction);
-
-        QActionGroup *viewGroup = new QActionGroup(this);
-        HbMenu *viewSubmenu = menu->addMenu(tr("View"));
-        mValuesAction = viewSubmenu->addAction(tr("Values"), this, SLOT(showValues()));
-        mValuesAction->setCheckable(true);
-        mValuesAction->setChecked(true);
-        viewGroup->addAction(mValuesAction);
-
-        mGraphAction = viewSubmenu->addAction(tr("Graphs"), this, SLOT(showGraphs()));
-        mGraphAction->setCheckable(true);
-        viewGroup->addAction(mGraphAction);
-
-        mLoggingAction = menu->addAction(QString(), this, SLOT(toggleLogging()));
-        toolbar->addAction(mLoggingAction);
-        updateLoggingAction();
-
-        menu->addAction(tr("Settings..."), this, SIGNAL(settingsCommandInvoked()));
-        menu->addAction(tr("About..."), this, SLOT(showAbout()));
-        menu->addAction(tr("Exit"), qApp, SLOT(quit()));
-
-    }
-}
-
-void MainView::showValues()
-{
-    // remove old widget & take ownership
-    takeWidget();
-    mGraphDataContainer->hideContainer();
-    mValueDataContainer->showContainer(); 
-    // set new widget
-    this->setWidget(mValueDataContainer);
-    
-    mValuesAction->setChecked(true);
-
-    mSwitchViewAction->setText(tr("View Graphs"));
-    disconnect(mSwitchViewAction, SIGNAL(triggered(bool)), this, SLOT(showValues()));
-    connect(mSwitchViewAction, SIGNAL(triggered(bool)), this, SLOT(showGraphs()));
-}
-
-void MainView::showGraphs()
-{
-    // remove old widget & take ownership
-    takeWidget();
-    mValueDataContainer->hideContainer();    
-    mGraphDataContainer->showContainer();
-    // set new widget
-    this->setWidget(mGraphDataContainer);
-
-    mGraphAction->setChecked(true);
-
-    mSwitchViewAction->setText(tr("View Values"));
-    disconnect(mSwitchViewAction, SIGNAL(triggered(bool)), this, SLOT(showGraphs()));
-    connect(mSwitchViewAction, SIGNAL(triggered(bool)), this, SLOT(showValues()));
-}
-
-void MainView::updateLoggingAction()
-{
-    mLoggingAction->setText(mEngine.settings().loggingEnabled() ?
-                            tr("Stop Logging") :
-                            tr("Start Logging"));
-}
-
-void MainView::toggleLogging()
-{
-    mEngine.setLoggingEnabled(!mEngine.settings().loggingEnabled());
-    updateLoggingAction();
-}
-
-void MainView::showAbout()
-{
-    HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation);
-    messageBox->setText("Version 1.1.1 - 21st May 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/mainwindow.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* 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 <HbAction>
-
-#include "mainwindow.h"
-
-#include "enginewrapper.h"
-#include "mainview.h"
-#include "settingsview.h"
-
-MainWindow::MainWindow(EngineWrapper &engine, QWidget *parent)
-    : HbMainWindow(parent)
-    , mEngine(engine)
-{
-    mMainView = new MainView(mEngine);
-    connect(mMainView, SIGNAL(settingsCommandInvoked()), this, SLOT(showSettings()));
-
-    addView(mMainView);
-    
-    mSettingsView = new SettingsView(mEngine);
-    connect(mSettingsView, SIGNAL(finished(bool)), this, SLOT(showMainView()));
-    
-    HbAction *action = new HbAction(Hb::BackNaviAction, mSettingsView);        
-    connect(action, SIGNAL(triggered()), mSettingsView, SLOT(reject()));
-    mSettingsView->setNavigationAction(action);
-
-    addView(mSettingsView);
-    
-    showMainView();
-}
-
-void MainWindow::showMainView()
-{
-    setCurrentView( mMainView );
-}
-
-void MainWindow::showSettings()
-{
-    setCurrentView( mSettingsView );
-}
--- a/perfmon/ui/hb/app/src/popupdatacontainer.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* 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 "popupdatacontainer.h"
-#include "enginewrapper.h"
-
-#include <QGraphicsLinearLayout>
-#include <HbLabel>
-#include <QPainter>
-
-const int leftMargin = 2;
-
-PopupDataContainer::PopupDataContainer(const EngineWrapper& engine, QGraphicsItem *parent) :
-    DataContainer(engine, parent)
-{
-    connect(&engine, SIGNAL(samplesUpdated()), this, SLOT(samplesUpdated()));
-
-    HbFontSpec spec(HbFontSpec::Secondary);
-    mFont = spec.font();
-    mFont.setPixelSize(12);
-    
-}
-
-void PopupDataContainer::samplesUpdated()
-{
-    update();
-}
-
-void PopupDataContainer::paint (QPainter *painter,
-    const QStyleOptionGraphicsItem *option,
-    QWidget *widget)
-{
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-
-    // set proper font and prepare font metrics for text height calculation
-    painter->setFont(mFont);
-    QFontMetricsF metrics(mFont);
-
-    QList<SampleEntry> entries = engine().sampleEntries();
-    qreal verticalPos = metrics.height();
-
-    for (int i=0; i<entries.length(); i++)
-    {
-        if (engine().settings().dataPopupSources().isEnabled(i) &&
-            entries.at(i).sampleCount() > 0)
-        {
-            const SampleEntry &entry = entries.at(i);
-            const SampleData &sample = entry.sample(0);
-
-            if (i == ESourceCPU)
-            {
-                // CPU
-                double perc = sample.mSize > 0 ?
-                              100. - 100. * sample.mFree / sample.mSize : 0;
-
-
-                QString text = tr("%1 %2%").arg(entry.description()).
-                               arg(perc, 0, 'f', 2);
-                painter->drawText(QPointF(leftMargin, verticalPos), text);
-            }
-            else
-            {
-                // RAM and Drives
-                QString text = tr("%1 free %L2%3").arg(entry.description()).
-                               arg(sample.mFree).arg(entry.unitShort());
-                painter->drawText(QPointF(leftMargin, verticalPos), text);
-            }
-
-            verticalPos += metrics.height();
-        }
-    }
-}
--- a/perfmon/ui/hb/app/src/settingsview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,266 +0,0 @@
-/*
-* 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 <HbAction>
-#include <HbToolBar>
-#include <HbDataForm>
-#include <HbDataFormModel>
-#include <HbDataFormModelItem>
-#include <HbDataFormViewItem>
-#include <HbLineEdit>
-#include <HbPushButton>
-
-#include "enginewrapper.h"
-
-const QStringList PRIORITY_ITEMS = QStringList() << SettingsView::tr("Much less") <<
-    SettingsView::tr("Less") << SettingsView::tr("Normal") <<
-    SettingsView::tr("More") << SettingsView::tr("Much more") <<
-    SettingsView::tr("Real time") << SettingsView::tr("Abs. very low") <<
-    SettingsView::tr("Abs. low") << SettingsView::tr("Abs background") <<
-    SettingsView::tr("Abs. foreground") << SettingsView::tr("Abs high");
-
-const QStringList CPU_SAMPLING = QStringList() << SettingsView::tr("CPU Time") <<
-    SettingsView::tr("NOPs");
-
-const QStringList POPUP_LOCATION = QStringList() << SettingsView::tr("Top right") <<
-    SettingsView::tr("Bottom middle");
-
-const QStringList POPUP_VISIBILITY = QStringList() << SettingsView::tr("On") <<
-    SettingsView::tr("Backgr. only") << SettingsView::tr("Off");
-
-const QStringList SOURCES = QStringList() << SettingsView::tr("CPU") <<
-    SettingsView::tr("Ram") << SettingsView::tr("C:") << SettingsView::tr("D:") <<
-    SettingsView::tr("E:") << SettingsView::tr("F:") << SettingsView::tr("G:") <<
-    SettingsView::tr("H:") << SettingsView::tr("I:");
-
-const QStringList LOG_MODES = QStringList() << SettingsView::tr("RDebug") <<
-    SettingsView::tr("Log file") << SettingsView::tr("RDebug & log file");
-
-
-SettingsView::SettingsView(EngineWrapper &engine)
-    : mEngine(engine), mLogFilePathItem(0)
-{
-    setTitle(tr("Settings"));
-
-    //create toolbar showing launch popup
-    HbToolBar *toolBar = this->toolBar();
-    HbAction *actionOk = new HbAction(tr("Ok"), toolBar);
-    HbAction *actionCancel = new HbAction(tr("Cancel"), toolBar);
-    
-    toolBar->addAction(actionOk);
-    toolBar->addAction(actionCancel);
-
-    //create setting form
-    mSettingsForm = new HbDataForm();
-
-    //create a model class
-    mModel = new HbDataFormModel(this);
-    createModel(*mModel);
-    load(engine.settings());
-
-    connect(mSettingsForm, SIGNAL(itemShown(const QModelIndex)),
-            this, SLOT(dataItemDisplayed(const QModelIndex)));
-
-    // Set created model to form
-    mSettingsForm->setModel(mModel);
-    setWidget(mSettingsForm);
-
-
-    connect(actionOk, SIGNAL(triggered()), this, SLOT(accept()));
-    connect(actionCancel, SIGNAL(triggered()), this, SLOT(reject()));
-    connect(this, SIGNAL(aboutToClose()), this, SLOT(accept()));
-
-}
-
-void SettingsView::createModel(HbDataFormModel &model)
-{
-    // General page
-    HbDataFormModelItem *generalPage = model.appendDataFormPage(tr("General"));
-
-    mHeartBeatItem = model.appendDataFormItem(
-            HbDataFormModelItem::TextItem, tr("Heart beat (ms)"), generalPage);
-    mHeartBeatItem->setContentWidgetData("maximum", 99999);
-    mHeartBeatItem->setContentWidgetData("minimum", 0);
-    mHeartBeatItem->setContentWidgetData("inputMethodHints", Qt::ImhDigitsOnly);
-
-    mMaxSamplesItem = model.appendDataFormItem(
-            HbDataFormModelItem::TextItem, tr("Max samples"), generalPage);
-    mMaxSamplesItem->setContentWidgetData("maximum", 9999);
-    mMaxSamplesItem->setContentWidgetData("minimum", 0);
-    mMaxSamplesItem->setContentWidgetData("inputMethodHints", Qt::ImhDigitsOnly);
-
-    mPriorityItem = model.appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, tr("Priority"), generalPage);
-    mPriorityItem->setContentWidgetData("items", PRIORITY_ITEMS);
-
-    mCpuSamplingItem = model.appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, tr("CPU sampling mode"), generalPage);
-    mCpuSamplingItem->setContentWidgetData("items", CPU_SAMPLING);
-    
-    mKeepBacklightItem = model.appendDataFormItem(
-            HbDataFormModelItem::CheckBoxItem, tr("Backlight"), generalPage);
-    mKeepBacklightItem->setContentWidgetData("text", tr("Keep backlight on"));
-
-    // Data popup page
-    HbDataFormModelItem *dataPopupPage = model.appendDataFormPage(tr("Data popup"));
-
-    mPopupVisibilityItem = model.appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, tr("Visibility"),
-            dataPopupPage);
-    mPopupVisibilityItem->setContentWidgetData("items", POPUP_VISIBILITY);
-
-    mPopupLocationItem = model.appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, tr("Location"), dataPopupPage);
-    mPopupLocationItem->setContentWidgetData("items", POPUP_LOCATION);
-
-    mPopupSourcesItem = model.appendDataFormItem(
-            HbDataFormModelItem::MultiselectionItem, tr("Sources"), dataPopupPage);
-    mPopupSourcesItem->setContentWidgetData("items", SOURCES);
-
-    // Graphs page
-    HbDataFormModelItem *graphsPage = model.appendDataFormPage(tr("Graphs"));
-
-    mVerticalBarPeriodItem = model.appendDataFormItem(
-            HbDataFormModelItem::TextItem, tr("Vertical bar period (s)"), graphsPage);
-    mVerticalBarPeriodItem->setContentWidgetData("maximum", 999);
-    mVerticalBarPeriodItem->setContentWidgetData("minimum", 0);
-    mVerticalBarPeriodItem->setContentWidgetData("inputMethodHints", Qt::ImhDigitsOnly);
-
-    mGraphSourcesItem = model.appendDataFormItem(
-            HbDataFormModelItem::MultiselectionItem, tr("Sources"), graphsPage);
-    mGraphSourcesItem->setContentWidgetData("items", SOURCES);
-
-    // Logging page
-    mLogPage = model.appendDataFormPage(tr("Logging"));
-
-    mLogModeItem = model.appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, tr("Mode"), mLogPage);
-    mLogModeItem->setContentWidgetData("items", LOG_MODES);
-    mSettingsForm->addConnection(mLogModeItem, SIGNAL(itemSelected(int)),
-                                 this, SLOT(logModeChanged(int)));
-
-    mLogSourcesItem = model.appendDataFormItem(
-            HbDataFormModelItem::MultiselectionItem, tr("Sources"), mLogPage);
-    mLogSourcesItem->setContentWidgetData("items", SOURCES);
-}
-
-void SettingsView::load(const PerfMonSettings& settings)
-{
-    mHeartBeatItem->setContentWidgetData("text", settings.heartBeat());
-    mMaxSamplesItem->setContentWidgetData("text", settings.maxSamples());
-    mPriorityItem->setContentWidgetData("selected", settings.priority());
-    mCpuSamplingItem->setContentWidgetData("selected", settings.cpuMode());
-    mKeepBacklightItem->setContentWidgetData("checkState", settings.keepBacklightOn() ? Qt::Checked : Qt::Unchecked);
-
-    mPopupVisibilityItem->setContentWidgetData("selected", settings.dataPopupVisibility());
-    mPopupLocationItem->setContentWidgetData("selected", settings.dataPopupLocation());
-    mPopupSourcesItem->setContentWidgetData("selectedItems",
-            qVariantFromValue(settings.dataPopupSources().enabledIndexes()));
-
-    mVerticalBarPeriodItem->setContentWidgetData("text", settings.graphVerticalBarPeriod());
-    mGraphSourcesItem->setContentWidgetData("selectedItems",
-            qVariantFromValue(settings.graphSources().enabledIndexes()));
-
-    mLogModeItem->setContentWidgetData("selected", settings.loggingMode());
-    mLogFilePath = settings.loggingFilePath();
-    if (settings.loggingMode() > ELoggingModeRDebug)
-    	createLogFilePathItem();
-    mLogSourcesItem->setContentWidgetData("selectedItems",
-            qVariantFromValue(settings.loggingSources().enabledIndexes()));
-}
-
-void SettingsView::save(PerfMonSettings& settings)
-{
-    settings.setHeartBeat(mHeartBeatItem->contentWidgetData("text").toInt());
-    settings.setMaxSamples(mMaxSamplesItem->contentWidgetData("text").toInt());
-    settings.setPriority(mPriorityItem->contentWidgetData("selected").toInt());
-    settings.setCpuMode(mCpuSamplingItem->contentWidgetData("selected").toInt());
-    settings.setKeepBacklightOn(mKeepBacklightItem->contentWidgetData("checkState").toInt() == Qt::Checked);
-
-    settings.setDataPopupVisibility(mPopupVisibilityItem->contentWidgetData("selected").toInt());
-    settings.setDataPopupLocation(mPopupLocationItem->contentWidgetData("selected").toInt());
-    settings.dataPopupSources().setEnabledIndexes(
-            qVariantValue<QList<QVariant> >(mPopupSourcesItem->contentWidgetData("selectedItems")));
-
-    settings.setGraphVerticalBarPeriod(mVerticalBarPeriodItem->contentWidgetData("text").toInt());
-    settings.graphSources().setEnabledIndexes(
-            qVariantValue<QList<QVariant> >(mGraphSourcesItem->contentWidgetData("selectedItems")));
-
-    settings.setLoggingMode(mLogModeItem->contentWidgetData("selected").toInt());
-    
-    if (mLogFilePathItem)
-    	settings.setLoggingFilePath(mLogFilePathItem->contentWidgetData("text").toString());
-    settings.loggingSources().setEnabledIndexes(
-            qVariantValue<QList<QVariant> >(mLogSourcesItem->contentWidgetData("selectedItems")));
-}
-
-void SettingsView::dataItemDisplayed(const QModelIndex &index)
-{
-    HbDataFormModelItem* modelItem = mModel->itemFromIndex(index);
-    HbDataFormViewItem *viewItem = static_cast<HbDataFormViewItem*>(mSettingsForm->itemByIndex(index));
-    HbWidget *dataContentWidget = viewItem->dataItemContentWidget();
-
-    // set input method hint for edits
-    // TODO: remove once setContentWidgetData works with inputMethodHints
-    if (modelItem == mHeartBeatItem ||
-        modelItem == mMaxSamplesItem ||
-        modelItem == mVerticalBarPeriodItem)
-    {
-        HbLineEdit *edit = static_cast<HbLineEdit*>(dataContentWidget);
-        edit->setInputMethodHints(Qt::ImhDigitsOnly);
-    }
-}
-
-void SettingsView::logModeChanged(int index)
-{
-    if (index == ELoggingModeRDebug && mLogFilePathItem) {
-        removeLogFilePathItem();
-    }
-    else if (index != ELoggingModeRDebug && !mLogFilePathItem) {
-		createLogFilePathItem();
-    }
-}
-
-void SettingsView::createLogFilePathItem()
-{
-	mLogFilePathItem = mModel->insertDataFormItem(mLogPage->indexOf(mLogModeItem) + 1,
-			HbDataFormModelItem::TextItem, tr("Log file path"), mLogPage);
-	mLogFilePathItem->setContentWidgetData("text", mLogFilePath);
-}
-
-void SettingsView::removeLogFilePathItem()
-{
-	// we need to store current text so that it is not lost when 
-	// user hides and then displays "Log file path" item again.
-	mLogFilePath = mLogFilePathItem->contentWidgetData("text").toString();
-	mModel->removeItem(mLogFilePathItem);
-	mLogFilePathItem = 0;
-}
-
-void SettingsView::accept()
-{
-    save(mEngine.settings());
-    mEngine.updateSettings();
-    emit finished(true);
-}
-
-void SettingsView::reject()
-{
-    emit finished(false);
-}
--- a/perfmon/ui/hb/app/src/valuedatacontainer.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
-* 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 "valuedatacontainer.h"
-#include "enginewrapper.h"
-
-#include <QGraphicsLinearLayout>
-#include <QPalette>
-#include <QPainter>
-#include <HbColorScheme>
-
-const int leftMargin = 2;
-
-ValueDataContainer::ValueDataContainer(const EngineWrapper& engine, QGraphicsItem *parent) :
-    DataContainer(engine, parent)
-{
-    HbFontSpec spec(HbFontSpec::Secondary);
-    mFont = spec.font();
-}
-
-void ValueDataContainer::paint (QPainter *painter,
-    const QStyleOptionGraphicsItem *option,
-    QWidget *widget)
-{
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-
-    // set proper font and prepare font metrics for text height calculation
-    painter->setFont(mFont);
-
-    QColor col = HbColorScheme::color("qtc_textedit_normal");
-    if(col.isValid())
-        painter->setPen(col);
-    
-    QFontMetricsF metrics(mFont);
-
-    QList<SampleEntry> entries = engine().sampleEntries();
-    int c = 1;
-
-    for (int i=0; i<entries.length(); i++)
-    {
-        const SampleEntry &entry = entries.at(i);
-
-        if (entry.sampleCount() == 0)
-            continue;
-
-        const SampleData &sample = entry.sample(0);
-
-        if (i == 0)
-        {
-            // CPU
-            double perc = sample.mSize > 0 ?
-                          100. - 100. * sample.mFree / sample.mSize : 0;
-
-
-            QString text = tr("%1 %2%").arg(entry.description()).
-                           arg(perc, 0, 'f', 0);
-            painter->drawText(QPointF(leftMargin, c * metrics.height()), text);
-            c++;
-        }
-        else if (sample.mSize > 0)
-        {
-            // RAM and Drives
-            QString text = tr("%1 free %L2%3").arg(entry.description()).
-                           arg(sample.mFree).arg(entry.unitShort());
-            painter->drawText(QPointF(leftMargin, c * metrics.height()), text);
-            c++;
-
-            text = tr("%1 size %L2%3").arg(entry.description()).
-                   arg(sample.mSize).arg(entry.unitShort());
-            painter->drawText(QPointF(leftMargin, c * metrics.height()), text);
-            c++;
-        }
-    }
-}
--- a/perfmon/ui/hb/datapopup/datapopup.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-#
-# 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 = lib
-TARGET = PerfMonDataPopupPlugin
-CONFIG += plugin hb
-
-# directories
-INCLUDEPATH += inc
-DEPENDPATH += inc
-
-HEADERS += inc/perfmondatapopupplugin_p.h
-HEADERS += inc/perfmondatapopupdialog_p.h
-HEADERS += inc/perfmondatapopupwidget_p.h
-
-SOURCES += src/perfmondatapopupplugin.cpp
-SOURCES += src/perfmondatapopupdialog.cpp
-SOURCES += src/perfmondatapopupwidget.cpp
-
-symbian {
-		INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-    TARGET.EPOCALLOWDLLDATA = 1
-    TARGET.CAPABILITY = CAP_GENERAL_DLL
-    TARGET.UID3 = 0x2002E6B0
-
-    hblib.sources = Hb.dll
-    hblib.path = \sys\bin
-    hblib.depends = "(0xEEF9EA38), 1, 0, 0, {\"Hb\"}"
-
-    pluginstub.sources = PerfMonDataPopupPlugin.dll
-    pluginstub.path = /private/20011385
-    DEPLOYMENT += pluginstub
-}
\ No newline at end of file
--- a/perfmon/ui/hb/datapopup/inc/perfmondatapopupdialog_p.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* 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 PERFMONDATAPOPUPDIALOG_P_H
-#define PERFMONDATAPOPUPDIALOG_P_H
-
-#include <QObject>
-#include <QVariantMap>
-
-#include <hbdevicedialoginterface.h>
-#include <hbdevicedialog.h>
-#include <hbnotificationdialog.h>
-
-class PerfMonDataPopupWidget;
-
-class PerfMonDataPopupDialog : public HbDialog, public HbDeviceDialogInterface
-{
-    Q_OBJECT
-    Q_PROPERTY(Location location READ location WRITE setLocation)
-    Q_PROPERTY(QStringList lines READ lines WRITE setLines)
-
-    Q_ENUMS(Location)
-
-public:
-    enum Location
-    {
-        LocationTopRight = 0,
-        LocationBottomMiddle
-    };
-
-public:
-    PerfMonDataPopupDialog(const QVariantMap &parameters);
-    virtual ~PerfMonDataPopupDialog();
-
-    bool setDeviceDialogParameters(const QVariantMap &parameters);
-    int deviceDialogError() const;
-    void closeDeviceDialog(bool byClient);
-    HbPopup *deviceDialogWidget() const;
-
-protected:
-//    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
-//               QWidget *widget=0);
-
-protected:
-    void hideEvent(QHideEvent *event);
-    void showEvent(QShowEvent *event);
-    void mousePressEvent(QGraphicsSceneMouseEvent *event);
-
-signals:
-    void deviceDialogClosed();
-    void deviceDialogData(QVariantMap data);
-
-private slots:
-    void reposition();
-
-private:
-    Location location() const;
-    void setLocation(Location location);
-
-    QStringList lines() const;
-    void setLines(const QStringList &lines);
-
-private:
-    Q_DISABLE_COPY(PerfMonDataPopupDialog)
-
-    int mLastError;
-    bool mShowEventReceived;
-
-    Location mLocation;
-
-    PerfMonDataPopupWidget *mWidget;
-};
-
-#endif // PERFMONDATAPOPUPDIALOG_P_H
--- a/perfmon/ui/hb/datapopup/inc/perfmondatapopupplugin_p.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/*
-* 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 PERFMONDATAPOPUPPLUGIN_P_H
-#define PERFMONDATAPOPUPPLUGIN_P_H
-
-#include <QObject>
-#include <QVariantMap>
-
-#include <hbdevicedialogplugin.h>
-
-class PerfMonDataPopupPluginPrivate;
-
-class PerfMonDataPopupPlugin : public HbDeviceDialogPlugin
-{
-    Q_OBJECT
-
-public:
-    friend class PerfMonDataPopupPluginPrivate;
-
-    PerfMonDataPopupPlugin();
-    ~PerfMonDataPopupPlugin();
-
-    bool accessAllowed(const QString &deviceDialogType,
-        const QVariantMap &parameters, const QVariantMap &securityInfo) const;
-    HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType,
-        const QVariantMap &parameters);
-    bool deviceDialogInfo(const QString &deviceDialogType,
-        const QVariantMap &parameters, DeviceDialogInfo *info) const;
-    QStringList deviceDialogTypes() const;
-    PluginFlags pluginFlags() const;
-    int error() const;
-
-private:
-    Q_DISABLE_COPY(PerfMonDataPopupPlugin)
-    PerfMonDataPopupPluginPrivate *d;
-};
-
-#endif // PERFMONDATAPOPUPPLUGIN_P_H
--- a/perfmon/ui/hb/datapopup/inc/perfmondatapopuppluginerrors_p.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* 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 PERFMONDATAPOPUPPLUGINERRORS_P_H
-#define PERFMONDATAPOPUPPLUGINERRORS_P_H
-
-#include <hbdevicedialog.h>
-
-// No error
-const int NoError = 0;
-// Illegal parameter error
-const int ParameterError = HbDeviceDialog::PluginErrors + 1;
-
-#endif // PERFMONDATAPOPUPPLUGINERRORS_P_H
--- a/perfmon/ui/hb/datapopup/inc/perfmondatapopupwidget_p.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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 PERFMONDATAPOPUPWIDGET_P_H
-#define PERFMONDATAPOPUPWIDGET_P_H
-
-#include <HbWidget>
-
-class PerfMonDataPopupWidget : public HbWidget
-{
-    Q_OBJECT
-    Q_PROPERTY(QStringList lines READ lines WRITE setLines)
-
-public:
-    explicit PerfMonDataPopupWidget(QGraphicsItem *parent = 0);
-
-public:
-    QStringList lines() const;
-    void setLines(const QStringList &lines);
-
-protected:
-    QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
-    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0);
-
-private:
-    QStringList mLines;
-
-    QFont mFont;
-
-};
-
-#endif // PERFMONDATAPOPUPWIDGET_P_H
--- a/perfmon/ui/hb/datapopup/src/perfmondatapopupdialog.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,179 +0,0 @@
-/*
-* 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 <QtDebug>
-#include <QIcon>
-#include <QVariant>
-#include <QList>
-#include <HbMainWindow>
-
-#include "perfmondatapopupdialog_p.h"
-#include "perfmondatapopuppluginerrors_p.h"
-#include "perfmondatapopupwidget_p.h"
-
-// Constructor
-PerfMonDataPopupDialog::PerfMonDataPopupDialog(const QVariantMap &parameters) :
-        mLastError(NoError),
-        mShowEventReceived(false),
-        mLocation(LocationTopRight),
-        mWidget(new PerfMonDataPopupWidget(this))
-{
-    setTimeout(0);
-    setModal(false);
-    setDismissPolicy(HbPopup::NoDismiss);
-    setBackgroundItem(0);
-    setContentWidget(mWidget);
-
-    setDeviceDialogParameters(parameters);
-}
-
-PerfMonDataPopupDialog::~PerfMonDataPopupDialog()
-{
-}
-
-// Set parameters
-bool PerfMonDataPopupDialog::setDeviceDialogParameters(const QVariantMap &parameters)
-{
-    if (parameters.contains("lines"))
-    {
-        QVariant lines = parameters.value("lines");
-        if (!lines.canConvert(QVariant::StringList)) {
-            mLastError = ParameterError;
-            return false;
-        }
-
-        setLines(lines.toStringList());
-    }
-
-    if (parameters.contains("location"))
-    {
-        QVariant location = parameters.value("location");
-        if (!location.canConvert<int>()) {
-            mLastError = ParameterError;
-            return false;
-        }
-
-        if (location.toInt() != LocationTopRight &&
-            location.toInt() != LocationBottomMiddle)
-        {
-            mLastError = ParameterError;
-            return false;
-        }
-
-        setLocation(static_cast<Location>(location.toInt()));
-    }
-    return true;
-}
-
-// Get error
-int PerfMonDataPopupDialog::deviceDialogError() const
-{
-    return mLastError;
-}
-
-// Close device dialog
-void PerfMonDataPopupDialog::closeDeviceDialog(bool byClient)
-{
-    Q_UNUSED(byClient);
-    close();
-    // If show event has been received, close is signalled from hide event. If not,
-    // hide event does not come and close is signalled from here.
-    if (!mShowEventReceived) {
-        emit deviceDialogClosed();
-    }
-}
-
-// Return display widget
-HbPopup *PerfMonDataPopupDialog::deviceDialogWidget() const
-{
-    return const_cast<PerfMonDataPopupDialog*>(this);
-}
-
-// Widget is about to hide. Closing effect has ended.
-void PerfMonDataPopupDialog::hideEvent(QHideEvent *event)
-{
-    if (mainWindow()) {
-        disconnect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
-                   this, SLOT(reposition()));
-    }
-    HbPopup::hideEvent(event);
-    emit deviceDialogClosed();
-}
-
-// Widget is about to show
-void PerfMonDataPopupDialog::showEvent(QShowEvent *event)
-{
-    if (mainWindow()) {
-        connect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
-                this, SLOT(reposition()));
-    }
-    reposition();
-    HbPopup::showEvent(event);
-    mShowEventReceived = true;
-}
-
-
-void PerfMonDataPopupDialog::mousePressEvent(QGraphicsSceneMouseEvent *event)
-{
-    Q_UNUSED(event);
-
-    QVariantMap data;
-    data["mouseEvent"] = "press";
-    emit deviceDialogData(data);
-}
-
-
-PerfMonDataPopupDialog::Location PerfMonDataPopupDialog::location() const
-{
-    return mLocation;
-}
-
-void PerfMonDataPopupDialog::setLocation(Location location)
-{
-    if (location != mLocation) {
-        mLocation = location;
-        reposition();
-    }
-}
-
-QStringList PerfMonDataPopupDialog::lines() const
-{
-    return mWidget->lines();
-}
-
-void PerfMonDataPopupDialog::setLines(const QStringList &lines)
-{
-    mWidget->setLines(lines);
-}
-
-void PerfMonDataPopupDialog::reposition()
-{
-    if (mainWindow()) {
-        QSize screenSize = HbDeviceProfile::profile(mainWindow()).logicalSize();
-        switch (mLocation) {
-            case LocationTopRight:
-                setPreferredPos(QPointF(screenSize.width(), 0),
-                                HbPopup::TopRightCorner);
-                break;
-
-            case LocationBottomMiddle:
-                setPreferredPos(QPointF(screenSize.width() / 2, screenSize.height()),
-                                HbPopup::BottomEdgeCenter);
-                break;
-        }
-    }
-}
--- a/perfmon/ui/hb/datapopup/src/perfmondatapopupplugin.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +0,0 @@
-/*
-* 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 <QtPlugin>
-
-#include <hbdevicedialog.h>
-#include "perfmondatapopupplugin_p.h"
-#include "perfmondatapopupdialog_p.h"
-#include "perfmondatapopuppluginerrors_p.h"
-
-Q_EXPORT_PLUGIN2(perfmondatapopupplugin, PerfMonDataPopupPlugin)
-
-// This plugin implements one device dialog type
-static const struct {
-    const char *mTypeString;
-} dialogInfos[] = {
-    {"com.nokia.rnd.perfmondatapopup/1.0"}
-};
-
-class PerfMonDataPopupPluginPrivate
-{
-public:
-    PerfMonDataPopupPluginPrivate() {mError = NoError;}
-
-    int mError;
-};
-
-// Constructor
-PerfMonDataPopupPlugin::PerfMonDataPopupPlugin()
-    : d(new PerfMonDataPopupPluginPrivate)
-{
-}
-
-// Destructor
-PerfMonDataPopupPlugin::~PerfMonDataPopupPlugin()
-{
-    delete d;
-}
-
-// Check if client is allowed to use device dialog widget
-bool PerfMonDataPopupPlugin::accessAllowed(const QString &deviceDialogType,
-    const QVariantMap &parameters, const QVariantMap &securityInfo) const
-{
-    Q_UNUSED(deviceDialogType)
-    Q_UNUSED(parameters)
-    Q_UNUSED(securityInfo)
-
-    // This plugin doesn't perform operations that may compromise security. All clients
-    // are allowed to use.
-    return true;
-}
-
-// Create device dialog widget
-HbDeviceDialogInterface *PerfMonDataPopupPlugin::createDeviceDialog(
-    const QString &deviceDialogType, const QVariantMap &parameters)
-{
-    Q_UNUSED(deviceDialogType)
-    d->mError = NoError;
-
-    HbDeviceDialogInterface *ret(0);
-    QVariantMap params = parameters;
-
-    PerfMonDataPopupDialog *deviceDialog =
-        new PerfMonDataPopupDialog(params);
-    d->mError = deviceDialog->deviceDialogError();
-    if (d->mError != NoError) {
-        delete deviceDialog;
-        deviceDialog = 0;
-    }
-    ret = deviceDialog;
-
-    return ret;
-}
-
-// Return device dialog flags
-bool PerfMonDataPopupPlugin::deviceDialogInfo(const QString &deviceDialogType,
-        const QVariantMap &parameters, DeviceDialogInfo *info) const
-{
-    Q_UNUSED(deviceDialogType);
-    Q_UNUSED(parameters);
-
-    info->group = DeviceNotificationDialogGroup;
-    info->flags = NoDeviceDialogFlags;
-    info->priority = DefaultPriority;
-
-    return true;
-}
-
-// Return device dialog types this plugin implements
-QStringList PerfMonDataPopupPlugin::deviceDialogTypes() const
-{
-    QStringList types;
-    const int numTypes = sizeof(dialogInfos) / sizeof(dialogInfos[0]);
-    for(int i = 0; i < numTypes; i++) {
-        types.append(dialogInfos[i].mTypeString);
-    }
-    return types;
-}
-
-// Return plugin flags
-HbDeviceDialogPlugin::PluginFlags PerfMonDataPopupPlugin::pluginFlags() const
-{
-    return NoPluginFlags;
-}
-
-// Return last error
-int PerfMonDataPopupPlugin::error() const
-{
-    return d->mError;
-}
--- a/perfmon/ui/hb/datapopup/src/perfmondatapopupwidget.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
-* 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 <QPainter>
-
-#include "perfmondatapopupwidget_p.h"
-
-const qreal popupMargin = 5.;
-
-PerfMonDataPopupWidget::PerfMonDataPopupWidget(QGraphicsItem *parent) :
-    HbWidget(parent)
-{
-    HbFontSpec fontSpec(HbFontSpec::Secondary);
-    mFont = fontSpec.font();
-    mFont.setPixelSize(12);
-}
-
-QStringList PerfMonDataPopupWidget::lines() const
-{
-    return mLines;
-}
-
-void PerfMonDataPopupWidget::setLines(const QStringList &lines)
-{
-    mLines = lines;
-    updateGeometry();
-}
-
-QSizeF PerfMonDataPopupWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
-{
-    if (which == Qt::PreferredSize)
-    {
-        QFontMetricsF metrics(mFont);
-
-        qreal width = 0;
-        foreach (const QString &line, mLines) {
-            width = qMax(width, metrics.width(line));
-        }
-        qreal height = metrics.height() * mLines.length();
-
-        return QSizeF(width + 2 * popupMargin, height + 2 * popupMargin);
-    }
-
-    return HbWidget::sizeHint(which, constraint);
-}
-
-void PerfMonDataPopupWidget::paint(QPainter *painter,
-    const QStyleOptionGraphicsItem *option, QWidget *widget)
-{
-    Q_UNUSED(widget);
-    Q_UNUSED(option);
-
-    QFontMetricsF metrics(mFont);
-    qreal lineHeight = metrics.height();
-    qreal verticalPos = lineHeight + popupMargin;
-
-    // draw background
-    painter->setBrush(Qt::white);
-    painter->drawRect(option->rect);
-
-    painter->setFont(mFont);
-
-    foreach (const QString &line, mLines) {
-        painter->drawText(QPointF(popupMargin, verticalPos), line);
-        verticalPos += lineHeight;
-    }
-
-}
--- a/perfmon/ui/hb/win/enginewrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* 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"
-
-
-// ---------------------------------------------------------------------------
-
-EngineWrapper::EngineWrapper()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-EngineWrapper::~EngineWrapper()
-{
-    finalize();
-}
-
-// ---------------------------------------------------------------------------
-
-bool EngineWrapper::initialize()
-{
-
-    SampleEntry cpu;
-    cpu.mDescription = "CPU";
-    cpu.mDriveNumber = -1;
-    cpu.mGraphColor.setNamedColor("yellow");
-
-    SampleEntry ram;
-    ram.mDescription = "RAM";
-    ram.mUnitShort = "b";
-    ram.mUnitLong = "bytes";
-    ram.mDriveNumber = -1;
-    ram.mGraphColor.setNamedColor("green");
-
-    SampleEntry cdrive;
-    cdrive.mDescription = "C:";
-    cdrive.mUnitShort = "b";
-    cdrive.mUnitLong = "bytes";
-    cdrive.mDriveNumber = 0;
-    cdrive.mGraphColor.setNamedColor("cyan");
-
-    SampleEntry ddrive;
-    ddrive.mDescription = "D:";
-    ddrive.mUnitShort = "b";
-    ddrive.mUnitLong = "bytes";
-    ddrive.mDriveNumber = 0;
-    ddrive.mGraphColor.setNamedColor("blue");
-
-    mEntries << cpu << ram << cdrive << ddrive;
-
-    connect(&mTimer, SIGNAL(timeout()), this, SLOT(update()));
-    mStartTime = QTime::currentTime();
-    mTimer.start(600);
-
-    return true;
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::finalize()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-bool EngineWrapper::updateSettings()
-{
-    emit settingsUpdated();
-    return true;
-}
-
-void EngineWrapper::update()
-{
-    // do some updates :)
-    for (int i=0; i<mEntries.length(); i++)
-    {
-        SampleEntry & entry = mEntries[i];
-        if (entry.mSampleData.length() > 0)
-        {
-            SampleData data = entry.mSampleData.at(0);
-            data.mFree += 10000 * (qrand() % 1000 - 500);
-            data.mTimeFromStart = mStartTime.msecsTo(QTime::currentTime()) * 1000;
-            entry.mSampleData.prepend(data);
-        }
-        else
-        {
-            SampleData data = {100000000L, 200000000L, mStartTime.msecsTo(QTime::currentTime()) * 1000};
-            entry.mSampleData.prepend(data);
-        }
-
-        if (entry.mSampleData.length() > 64)
-        {
-            entry.mSampleData.removeLast();
-        }
-    }
-
-    emit samplesUpdated();
-}
--- a/perfmon/ui/hb/win/enginewrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,270 +0,0 @@
-/*
-* 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 <QObject>
-#include <QColor>
-#include <QList>
-#include <QTime>
-#include <QTimer>
-
-enum SettingThreadPriorityTypes
-{
-    EThreadPriorityTypeMuchLess = 0,
-    EThreadPriorityTypeLess,
-    EThreadPriorityTypeNormal,
-    EThreadPriorityTypeMore,
-    EThreadPriorityTypeMuchMore,
-    EThreadPriorityTypeRealTime,
-    EThreadPriorityTypeAbsoluteVeryLow,
-    EThreadPriorityTypeAbsoluteLow,
-    EThreadPriorityTypeAbsoluteBackground,
-    EThreadPriorityTypeAbsoluteForeground,
-    EThreadPriorityTypeAbsoluteHigh
-};
-
-enum SettingCPUModes
-{
-    ECPUModeNotSet = -1,
-    ECPUModeCPUTime,
-    ECPUModeNOPs
-};
-
-enum SettingDataPopupVisbilities
-{
-    EDataPopupVisbilityAlwaysOn = 0,
-    EDataPopupVisbilityBackgroundOnly,
-    EDataPopupVisbilityAlwaysAlwaysOff
-};
-
-enum SettingDataPopupLocations
-{
-    EDataPopupLocationTopRight = 0,
-    EDataPopupLocationBottomMiddle
-};
-
-enum SettingSources
-{
-    ESourceCPU = 0,
-    ESourceRAM,
-    ESourceC,
-    ESourceD,
-    ESourceE,
-    ESourceF,
-    ESourceG,
-    ESourceH,
-    ESourceI,
-    ESourcesLength // this should be always the last!
-};
-
-enum SettingLoggingMode
-{
-    ELoggingModeRDebug = 0,
-    ELoggingModeLogFile,
-    ELoggingModeRDebugLogFile
-};
-
-
-struct SampleData
-{
-    qint64 mFree;
-    qint64 mSize;
-    qint64 mTimeFromStart;
-};
-
-class SampleEntry
-{
-public:
-    QString description() const { return mDescription; }
-    QString unitShort() const { return mUnitShort; }
-    QString unitLong() const { return mUnitLong; }
-    int driveNumber() const { return mDriveNumber; }
-    QColor graphColor() const { return mGraphColor; }
-
-    int sampleCount() const { return mSampleData.length(); }
-    const SampleData &sample(int index) const { return mSampleData[index]; }
-private:
-    QString mDescription;
-    QString mUnitShort;
-    QString mUnitLong;
-    int mDriveNumber;
-    QColor mGraphColor;
-
-    QList<SampleData> mSampleData;
-
-friend class EngineWrapper;
-};
-
-class PerfMonSources
-{
-public:
-    int count() const { return 9; }
-    int isEnabled (int index) const { return mSources[index]; }
-    void setEnabled(int index, bool enabled) { mSources[index] = enabled; }
-    QList<int> enabledIndexes() const
-    {
-        QList<int> indexes;
-        for(int i=0; i<count(); i++) {
-            if (isEnabled(i))
-                indexes.append(i);
-        }
-        return indexes;
-    }
-    void setEnabledIndexes(const QList<int> &indexes)
-    {
-        for(int i=0; i<count(); i++) {
-            setEnabled(i, indexes.contains(i));
-        }
-    }
-
-PerfMonSources() {
-    memset(mSources, 0, sizeof mSources);
-    mSources[0] = mSources[1] = mSources[2] = true;
-}
-
-private:
-    bool mSources[9];
-};
-
-class PerfMonSettings
-{
-public:
-    int heartBeat() const { return mHeartBeat; }
-    int maxSamples() const { return mMaxSamples; }
-    int priority() const { return mPriority; }
-    int cpuMode() const { return mCPUMode; }
-    bool keepBacklightOn() const { return mKeepBacklightOn; }
-
-    int dataPopupVisibility() const { return mDataPopupVisibility; }
-    int dataPopupLocation() const { return mDataPopupLocation; }
-    PerfMonSources &dataPopupSources() { return mDataPopupSources; }
-    const PerfMonSources &dataPopupSources() const { return mDataPopupSources; }
-
-    int graphVerticalBarPeriod() const { return mGraphsVerticalBarPeriod; }
-    PerfMonSources &graphSources() { return mGraphSources; }
-    const PerfMonSources &graphSources() const { return mGraphSources; }
-
-    int loggingMode() const { return mLoggingMode; }
-    QString loggingFilePath() const { return mLoggingFilePath; }
-    PerfMonSources &loggingSources() { return mLogSources; }
-    const PerfMonSources &loggingSources() const { return mLogSources; }
-
-    bool loggingEnabled() { return mLoggingEnabled; }
-
-
-    void setHeartBeat(int heartBeat) { mHeartBeat = heartBeat; }
-    void setMaxSamples(int maxSamples) { mMaxSamples = maxSamples; }
-    void setPriority(int priority) { mPriority = priority; }
-    void setCpuMode(int cpuMode) { mCPUMode = cpuMode; }
-    void setKeepBacklightOn(bool backlightOn) { mKeepBacklightOn = backlightOn; }
-
-    void setDataPopupVisibility(int visibility) { mDataPopupVisibility = visibility; }
-    void setDataPopupLocation(int location) { mDataPopupLocation = location; }
-
-    void setGraphVerticalBarPeriod(int period) { mGraphsVerticalBarPeriod = period; }
-
-    void setLoggingMode(int mode) { mLoggingMode = mode; }
-    void setLoggingFilePath(const QString& filePath) { mLoggingFilePath = filePath; }
-
-    void setLoggingEnabled(bool enabled) { mLoggingEnabled = enabled; }
-
-private:
-    friend class EngineWrapper;
-
-    PerfMonSettings() : mHeartBeat(600), mMaxSamples(64), mPriority(2), mCPUMode(1),
-        mKeepBacklightOn(true), mDataPopupVisibility(0), mDataPopupLocation(0),
-        mGraphsVerticalBarPeriod(5), mLoggingMode(1), mLoggingFilePath("C:\\data\\perfmon.log"),
-        mLoggingEnabled(true) {}
-
-
-private:
-    int mHeartBeat;
-    int mMaxSamples;
-    int mPriority;
-    int mCPUMode;
-    bool mKeepBacklightOn;
-
-    int mDataPopupVisibility;
-    int mDataPopupLocation;
-    PerfMonSources mDataPopupSources;
-
-    int mGraphsVerticalBarPeriod;
-    PerfMonSources mGraphSources;
-
-    int mLoggingMode;
-    QString mLoggingFilePath;
-    PerfMonSources mLogSources;
-
-    bool mLoggingEnabled;
-};
-
-/**
- * Mock engine to simulate perfmon engine for non-symbian development.
- */
-class EngineWrapper : public QObject
- {
-    Q_OBJECT
-
-public:
-
-    /**
-     * Constructor
-     */
-    EngineWrapper();
-
-    /**
-     * Destructor
-     */
-    ~EngineWrapper();
-
-public:
-    const QList<SampleEntry>& sampleEntries() const { return mEntries; }
-
-    PerfMonSettings &settings() { return mSettings; }
-    const PerfMonSettings &settings() const { return mSettings; }
-
-    void setLoggingEnabled(bool enabled) { mSettings.setLoggingEnabled(enabled); }
-
-public slots:
-
-    bool updateSettings();
-    bool initialize();
-    void finalize();
-
-signals:
-
-    void samplesUpdated();
-    void settingsUpdated();
-
-private slots:
-
-    void update();
-
-private:
-
-    QList<SampleEntry> mEntries;
-
-    QTimer mTimer;
-
-    QTime mStartTime;
-
-    PerfMonSettings mSettings;
-};
-
-#endif //ENGINEWRAPPER_H
--- a/perfmon/ui/hb/win/win.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-#
-# 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:
-#
-#
-
-win32 {
-    TEMPLATE = subdirs
-
-    SUBDIRS = ../app ../datapopup
-
-    system($$QMAKE_COPY enginewrapper.cpp ..\app\src\enginewrapper.cpp)
-    system($$QMAKE_COPY enginewrapper.h ..\app\inc\enginewrapper.h)
-} else {
-    error("Only Windows supported")
-}
--- a/piprofilerui/group/bld_generic.inf	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/group/bld_generic.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -16,5 +16,19 @@
 */
 
 PRJ_MMPFILES
+#ifndef SBSV2
+  #ifdef MARM
+  gnumakefile piprofiler_stub_sis.mk
+  #endif
+#endif
+
 PRJ_EXTENSIONS
+#ifdef SBSV2
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME PIProfiler_stub
+  END
+  #endif  
+#endif
 
--- a/piprofilerui/ui/avkon/data/piprofilerui.rss	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/ui/avkon/data/piprofilerui.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -480,7 +480,7 @@
             id = EAknMessageQueryContentId;
             control = AVKON_MESSAGE_QUERY
                 {
-               	message = "Version 2.2.1 - 10th August 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.";
+               	message = "Version 2.2.0.2 - 4th May 2010. Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.";
                 };
             }
         };
--- a/piprofilerui/ui/avkon/rom/piprofilerui_avkon.iby	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/ui/avkon/rom/piprofilerui_avkon.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -30,4 +30,7 @@
   S60_APP_AIF_RSC(PIProfilerUI)
 #endif
 
+data=ZPRIVATE\2001E5AE\backup_registration.xml        	private\2001E5AE\backup_registration.xml
+data=ZSYSTEM\Install\PIProfilerUI_stub.sis              system\install\PIProfilerUI_stub.sis
+
 #endif // __PROFILERGUI_IBY__
--- a/piprofilerui/ui/hb/hb.pro	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/ui/hb/hb.pro	Wed Sep 01 12:30:35 2010 +0100
@@ -55,7 +55,7 @@
     
 	TARGET.CAPABILITY = ALL -TCB
 
-	LIBS += -lcharconv -lbafl -lsysutil -lefsrv
+	LIBS += -lcharconv -lbafl -lsysutil
     
     ICON = ../icons/qgn_menu_piprofilerui.svg 
     
--- a/piprofilerui/ui/hb/inc/notifications.h	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/ui/hb/inc/notifications.h	Wed Sep 01 12:30:35 2010 +0100
@@ -18,7 +18,7 @@
 #ifndef NOTIFICATIONS_H_
 #define NOTIFICATIONS_H_
 
-#include <QString> 
+#include <qstring> 
 
 /**
  * Notifications class for viewing notification messages.
--- a/piprofilerui/ui/hb/inc/pimainwindow.h	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/ui/hb/inc/pimainwindow.h	Wed Sep 01 12:30:35 2010 +0100
@@ -19,7 +19,7 @@
 #define PIPROFILERMAINWINDOW_H_
 
 // System includes
-#include <qobject.h>
+#include <QObject.h>
 #include <hbmainwindow.h>
 
 // User includes
--- a/piprofilerui/ui/hb/rom/piprofilerui_hb.iby	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/ui/hb/rom/piprofilerui_hb.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -27,4 +27,7 @@
 //S60_APP_RESOURCE(PIProfilerUI)
 data=ZPRIVATE\10003a3f\import\apps\PIProfilerUI_reg.rsc private\10003a3f\import\apps\PIProfilerUI_reg.rsc
 
+data=ZPRIVATE\2001E5AE\backup_registration.xml        	private\2001E5AE\backup_registration.xml
+data=ZSYSTEM\Install\PIProfilerUI_stub.sis              system\install\PIProfilerUI_stub.sis
+
 #endif // __PROFILERGUI_IBY__
--- a/piprofilerui/ui/hb/src/pimainview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/ui/hb/src/pimainview.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -89,6 +89,7 @@
     loadItemsFromResources(loader);
 
     // Set list widget items
+    mListPlugins->setLongPressEnabled(true);
     mListPlugins->setClampingStyle(HbScrollArea::BounceBackClamping);
     mListPlugins->setFrictionEnabled(true);
 
@@ -186,7 +187,7 @@
 void PIMainView::showAboutPopup()
 {
 
-    Notifications::showMessageBox("Version 2.2.1 - 10th August 2010. \n"
+    Notifications::showMessageBox("Version 2.2.0.2 - 4th May 2010. \n"
             "Copyright © 2010 Nokia Corporation "
             "and/or its subsidiary(-ies). "
             "All rights reserved.");
--- a/piprofilerui/ui/hb/src/pisettingsview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ b/piprofilerui/ui/hb/src/pisettingsview.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -15,18 +15,18 @@
  *
  */
 
-#include <HbMainWindow>
-#include <HbDataForm>
-#include <HbDataFormModel>
-#include <HbDataFormModelItem>
-#include <HbDataFormViewItem>
-#include <QGraphicsLinearLayout>
-#include <QValidator>
-#include <QIntValidator>
-#include <QModelIndex>
-#include <HbLineEdit>
-#include <HbValidator>
-#include <HbEditorInterface>
+#include <hbmainwindow>
+#include <hbdataform>
+#include <hbdataformmodel>
+#include <hbdataformmodelitem>
+#include <hbdataformviewitem>
+#include <qgraphicslinearlayout>
+#include <qvalidator>
+#include <qintvalidator>
+#include <qmodelindex>
+#include <hblineedit>
+#include <hbvalidator>
+#include <hbeditorinterface>
 #include <hbabstractitemview.h>
 
 #include "pisettingsview.h"
--- a/screengrabber/ReleaseNotes_ScreenGrabber.txt	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-===============================================================================
-
-RELEASE NOTES - SCREENGRABBER v5.0.0
-RELEASED 10th March 2010 
-
-SUPPORTS S60 3.0+
-
-===============================================================================
-
-Product Description:
-====================
-ScreenGrabber tool is used to capture images and video of the visible screen
-area in S60 platform. Captures can be handled with the Media Gallery
-application or with PC when the device is connected via PC suite.
-
-Main Features:
-==============
-- Image capture in single or in sequential mode supporting PNG, JPEG and BMP
-  formats
-- Video capture in animated GIF format
-- Configurable saving format, hotkey, time delta in sequential mode, target
-  memory and default filename
-- Ability to change the screen mode to one of the supported more by the device
-
-===============================================================================
-
-What's New in v5.0.0
-====================
-- Orbit UI
-
-===============================================================================
-
-Installation Notes:
-===================
-ScreenGrabber is typically preinstalled on ROM. If not, it can be added to the
-ROM with the .iby file. Alternatively, the .sis file can be found under the sis-
-directory, but the user need 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:
-  WriteDeviceData
-  SwEvent
-
-When builing ScreenGrabber 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:
-=============
-
-Sluggish UI when capturing video
---------------------------------
-- Video capturing requires huge amount of processing power and thus may cause
-  the UI to become sluggish. If supported by the device, try to decrease the
-  screen resolution.
-
-===============================================================================
-
-Version History:
-================
-Version 4.2.0 - 14th May 2009
-------------------------------
-- Feature: Added a new SIS file for S60 3.2 devices and newer to support the
-  features in newer platforms
-- Feature: Added multidrive support in the settings dialog
-
-Version 4.1.3 - 8th March 2009
-------------------------------
-- Fix: ScreenGrabber does not work in devices which do not have Media Gallery
-  (Media Gallery File Manager API dependency changed from static to dynamic)
-    
-Version 4.1.2 - 8th February 2008
----------------------------------
-- Fix: Transparency errors in GIF animations (hopefully) finally fixed
-  
-Version 4.1.1 - 28th January 2008
----------------------------------
-- Feature: Added hash+* and alternative camera key into selection of capture
-  keys
-- Change: Reimplemented settings handling so that AllFiles and WriteUserData
-  capabilities are no longer needed
-    
-Version 4.1.0 - 14th January 2008
----------------------------------
-- Feature: Added support for GIF and MBM formats although it is always
-  recommended to capture screens in PNG format
-- Feature: JPEG format can now be selected as high quality (97%) or low quality
-  (60%) 
-- Feature: Added POC key under capturing key options
-- Change: Dimensions of a video will be grown if the screen resolution of the
-  device will grow during capturing
-- Change: Capturing is now done always from current focus screen which allows to
-  support secondary displays
-- Change: Send key is now the default key
-- Fix: Black color didn't always work correctly in GIF animation optimization
-  with transparency  
-- Fix: Capturing to JPEG format leaked memory
-
-Version 4.0.3 - 16th November 2007
-----------------------------------
-- Fix: Scroll bar in the main view can be scrolled on a touch UI
-- Fix: Application closes automatically when closed via open applications menu
-
-Version 4.0.2 - 9th October 2007
---------------------------------
-- Fix: Main screen layout in mirrored mode
-  
-Version 4.0.1 - 14th February 2007
-----------------------------------
-- Fix: Help screen on larger displays
-  
-Version 4.0.0 - 25th October 2006
----------------------------------
-- Feature: Support for sequential capture mode
-- Feature: Support for capturing video in animated GIF format
-- Feature: Ability to change screen mode to one of the supported more by the
-  device
-
-===============================================================================
-
-Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-All rights reserved.
-
-This component and the accompanying materials are made available
-under the terms 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/screengrabber/data/screengrabber.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,550 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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 "SG.hrh"
+#include "SGStd.h"
+#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
+    {
+	//status_pane = r_screengrabber_status_pane;
+    //menubar = r_screengrabber_menubar;
+    //cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT;
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_screengrabber_hotkeys
+//
+//----------------------------------------------------
+//
+RESOURCE HOTKEYS r_screengrabber_hotkeys
+    {
+    control=
+        {
+        HOTKEY { command=EAknCmdExit; key='e'; }
+        };
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_screengrabber_view1
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_VIEW r_screengrabber_view1
+    {
+    hotkeys=r_screengrabber_hotkeys;
+    menubar=r_screengrabber_menubar_view1;  
+    cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;    
+    }
+
+//----------------------------------------------------
+//   
+//    r_screengrabber_menubar_view1
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_screengrabber_menubar_view1
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_screengrabber_app_menu; txt="App"; },
+        MENU_TITLE { menu_pane=r_screengrabber_view1_menu; txt="View"; }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_screengrabber_view1_menu
+//
+//----------------------------------------------------
+//
+
+RESOURCE MENU_PANE r_screengrabber_view1_menu
+    {
+    items=
+        {
+        MENU_ITEM { command=EScreenGrabberCmdSendToBackground; txt="Send to background"; },
+        MENU_ITEM { command=EScreenGrabberCmdScreenResolution; cascade = r_screengrabber_resolution_submenu; txt="Screen resolution"; },
+        MENU_ITEM { command=EScreenGrabberCmdSettings; txt="Settings"; },
+        MENU_ITEM { command=EScreenGrabberCmdAbout; txt="About"; },
+        MENU_ITEM { command=EAknCmdExit; txt="Exit"; }
+        };
+    }
+
+RESOURCE MENU_PANE r_screengrabber_resolution_submenu
+    {
+    items=
+        {
+        };
+    }
+    
+//----------------------------------------------------
+//   
+//    r_screengrabber_view2
+//
+//----------------------------------------------------
+//
+RESOURCE CBA r_screengrabber_softkeys_view2
+	{
+	buttons =
+		{
+		CBA_BUTTON {id=EAknSoftkeyOptions; txt = "Options" ;},
+		CBA_BUTTON {id=EScreenGrabberCmdSettingsBack; txt = "Back" ; }
+		};
+	}
+
+RESOURCE AVKON_VIEW r_screengrabber_view2
+    {
+    hotkeys=r_screengrabber_hotkeys;
+    menubar=r_screengrabber_menubar_view2;  
+    cba=r_screengrabber_softkeys_view2; 
+    }
+
+//----------------------------------------------------
+//   
+//    r_screengrabber_menubar_view2
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_BAR r_screengrabber_menubar_view2
+    {
+    titles=
+        {
+        MENU_TITLE { menu_pane=r_screengrabber_app_menu; txt="App"; },
+        MENU_TITLE { menu_pane=r_screengrabber_view2_menu; txt="View"; }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_screengrabber_view2_menu
+//    ?description
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_screengrabber_view2_menu
+    {
+    items=
+        {
+        MENU_ITEM { command=EScreenGrabberCmdSettingsChange; txt="Change"; },
+        MENU_ITEM { command=EScreenGrabberCmdSettingsExit; txt="Exit"; }
+        };
+    }
+
+//----------------------------------------------------
+//   
+//    r_screengrabber_app_menu
+//
+//----------------------------------------------------
+//
+RESOURCE MENU_PANE r_screengrabber_app_menu
+    {
+    items=
+        {
+        };
+    }
+
+
+//----------------------------------------------------
+//   
+//    r_screengrabber_settinglist
+//
+//----------------------------------------------------
+//
+RESOURCE AVKON_SETTING_ITEM_LIST r_screengrabber_settinglist
+	{
+	title = "Settings";
+	initial_number = 1;
+	items = 
+		{
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListCaptureModeSelection;
+			name = "Capture mode";
+			setting_page_resource = r_capturemodeselection_setting_page;
+			associated_resource = r_capturemodeselection_setting_texts;
+			},
+					
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSingleCaptureHotkeySelection;
+			name = "Capture hotkey";
+			setting_page_resource = r_hotkeyselection_setting_page;
+			associated_resource = r_hotkeyselection_setting_texts;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSingleCaptureImageFormatSelection;
+			name = "Image format";
+			setting_page_resource = r_imageformatselection_setting_page;
+			associated_resource = r_imageformatselection_setting_texts;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSingleCaptureMemorySelection;
+			name = "Memory in use";
+			setting_page_resource = r_memoryselection_dialog;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSingleCaptureFileNameSelection;
+			name = "File name";
+			setting_page_resource = r_filenameselection_setting_page;
+			},
+			
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSequantialCaptureHotkeySelection;
+			name = "Start/stop hotkey";
+			setting_page_resource = r_hotkeyselection_setting_page;
+			associated_resource = r_hotkeyselection_setting_texts;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSequantialCaptureImageFormatSelection;
+			name = "Image format";
+			setting_page_resource = r_imageformatselection_setting_page;
+			associated_resource = r_imageformatselection_setting_texts;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSequantialCaptureDelaySelection;
+			name = "Delay (ms)";
+			setting_page_resource = r_delayselection_setting_page;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSequantialCaptureMemorySelection;
+			name = "Memory in use";
+			setting_page_resource = r_memoryselection_dialog;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListSequantialCaptureFileNameSelection;
+			name = "File name";
+			setting_page_resource = r_filenameselection_setting_page;
+			},
+
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListVideoCaptureHotkeySelection;
+			name = "Start/stop hotkey";
+			setting_page_resource = r_hotkeyselection_setting_page;
+			associated_resource = r_hotkeyselection_setting_texts;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListVideoCaptureVideoFormatSelection;
+			name = "Video format";
+			setting_page_resource = r_videoformatselection_setting_page;
+			associated_resource = r_videoformatselection_setting_texts;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListVideoCaptureMemorySelection;
+			name = "Memory in use";
+			setting_page_resource = r_memoryselection_dialog;
+			},
+		AVKON_SETTING_ITEM
+			{
+			identifier = ESettingListVideoCaptureFileNameSelection;
+			name = "File name";
+			setting_page_resource = r_filenameselection_setting_page;
+			}
+		};
+	}
+
+RESOURCE POPUP_SETTING_LIST r_popup_setting_list_editor
+	{
+	}
+
+//
+// resources for capture mode selection
+//
+RESOURCE AVKON_SETTING_PAGE r_capturemodeselection_setting_page
+	{
+    number = EAknSettingPageNoOrdinalDisplayed; 
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_popup_setting_list_editor;
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_capturemodeselection_setting_texts
+	{
+	setting_texts_resource = r_capturemodeselection_text_array;
+	}
+RESOURCE ARRAY r_capturemodeselection_text_array
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT { value=ECaptureModeSingleCapture; text = "Single capture"; },
+		AVKON_ENUMERATED_TEXT { value=ECaptureModeSequantialCapture; text = "Sequantial capture"; },
+		AVKON_ENUMERATED_TEXT { value=ECaptureModeVideoCapture; text = "Video capture"; }
+		};
+	}
+	
+//
+// generic resources for hotkey selection
+//
+RESOURCE AVKON_SETTING_PAGE r_hotkeyselection_setting_page
+	{
+    number = EAknSettingPageNoOrdinalDisplayed; 
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_popup_setting_list_editor;
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_hotkeyselection_setting_texts
+	{
+	setting_texts_resource = r_hotkeyselection_text_array;
+	}
+RESOURCE ARRAY r_hotkeyselection_text_array
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT { value=EHotkeySendKey; text = "Send key"; },
+		AVKON_ENUMERATED_TEXT { value=EHotkeyShiftStar; text = "SHIFT+*"; },
+		AVKON_ENUMERATED_TEXT { value=EHotkeyHashStar; text = "HASH+*"; },
+		AVKON_ENUMERATED_TEXT { value=EHotkeyShiftMenu; text = "SHIFT+Menu"; },
+		AVKON_ENUMERATED_TEXT { value=EHotkeyPowerKey; text = "Power key"; },
+		AVKON_ENUMERATED_TEXT { value=EHotkeySideKey; text = "Side key"; },
+		AVKON_ENUMERATED_TEXT { value=EHotkeyCameraKey1; text = "Camera key #1"; },
+		AVKON_ENUMERATED_TEXT { value=EHotkeyCameraKey2; text = "Camera key #2"; },
+		AVKON_ENUMERATED_TEXT { value=EHotkeyPOC; text = "POC"; }
+		};
+	}
+
+//
+// generic resources for image format selection
+//
+RESOURCE AVKON_SETTING_PAGE r_imageformatselection_setting_page
+	{
+    number = EAknSettingPageNoOrdinalDisplayed; 
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_popup_setting_list_editor;
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_imageformatselection_setting_texts
+	{
+	setting_texts_resource = r_imageformatselection_text_array;
+	}
+RESOURCE ARRAY r_imageformatselection_text_array
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT { value=EImageFormatPNG; text = "PNG"; },
+		AVKON_ENUMERATED_TEXT { value=EImageFormatJPGHQ; text = "JPEG high qual."; },
+		AVKON_ENUMERATED_TEXT { value=EImageFormatJPGLQ; text = "JPEG low qual."; },
+		AVKON_ENUMERATED_TEXT { value=EImageFormatBMP; text = "BMP"; },
+		AVKON_ENUMERATED_TEXT { value=EImageFormatGIF; text = "GIF"; },
+		AVKON_ENUMERATED_TEXT { value=EImageFormatMBM; text = "MBM"; }
+		};
+	}
+
+//
+// generic resources for video format selection
+//
+RESOURCE AVKON_SETTING_PAGE r_videoformatselection_setting_page
+	{
+    number = EAknSettingPageNoOrdinalDisplayed; 
+	type = EAknCtPopupSettingList;
+	editor_resource_id = r_popup_setting_list_editor;
+	}
+RESOURCE AVKON_POPUP_SETTING_TEXTS r_videoformatselection_setting_texts
+	{
+	setting_texts_resource = r_videoformatselection_text_array;
+	}
+RESOURCE ARRAY r_videoformatselection_text_array
+	{
+	items =
+		{
+		AVKON_ENUMERATED_TEXT { value=EVideoFormatAnimatedGIF; text = "Animated GIF"; }
+		};
+	}
+
+//
+// generic resources for memory selection
+//
+RESOURCE MEMORYSELECTIONDIALOG r_memoryselection_dialog
+    {
+    title = "Memory in use";
+    locations =
+        {
+        LOCATION
+            { 
+            root_path = text_phone_memory_root_path;
+			default_folder = text_images_path; 
+            },
+        LOCATION 
+            { 
+            root_path = text_memory_card_root_path;
+			default_folder = text_images_path;
+            }
+        };
+    }
+
+//
+// generic resources for filename selection
+//
+RESOURCE AVKON_SETTING_PAGE r_filenameselection_setting_page
+	{
+	type = EEikCtEdwin;
+	editor_resource_id = r_filename_text_editor;
+	}
+
+RESOURCE EDWIN r_filename_text_editor
+	{
+	lines = 0;  // expanding to multiple rows
+	maxlength = 63;
+	flags = EEikEdwinNoLineOrParaBreaks;
+	}
+
+//
+// generic resources for delay selection
+//
+RESOURCE AVKON_SETTING_PAGE r_delayselection_setting_page
+	{
+	type = EAknCtIntegerEdwin;
+	editor_resource_id = r_delay_integer_editor;
+	}
+
+RESOURCE AVKON_INTEGER_EDWIN r_delay_integer_editor
+	{
+	maxlength = 6;
+	min = 0;
+	max = 999999;
+	}
+
+//
+// ---------------------------------------------------------
+//
+
+RESOURCE DIALOG r_my_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_screengrabber_about_dialog
+//   About dialog - show version and copyright info etc.
+//
+// ---------------------------------------------------------
+//
+
+RESOURCE DIALOG r_screengrabber_about_dialog
+{
+    flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow;
+    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
+    items=
+    {
+        DLG_LINE
+        {
+            type = EAknCtPopupHeadingPane;
+            id = EAknMessageQueryHeaderId;
+            control = AVKON_HEADING
+            {
+                label = "About Scr.Grabber";
+                headinglayout = R_AVKON_WML_SIGN_QUERY_HEADING_PANE;
+            };
+        },
+        DLG_LINE
+        {
+            type = EAknCtMessageQuery;
+            id = EAknMessageQueryContentId;
+            control = AVKON_MESSAGE_QUERY
+            {
+                message = "Version 4.2.0 - 14th May 2009. Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. Licensed under Eclipse Public License v1.0.";
+            };
+        }
+    };
+}
+
+// ---------------------------------------------------------
+//   
+//    New framework:
+//    Secure platform and scalable UI changes 
+//
+// ---------------------------------------------------------
+//
+RESOURCE LOCALISABLE_APP_INFO r_screengrabber_localisable_app_info
+    {
+    short_caption = "Scr.Grabber";
+    caption_and_icon = 
+    CAPTION_AND_ICON_INFO
+        {
+        caption = "ScreenGrabber";
+
+        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"\\screengrabber_aif.mif";
+        };
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/data/screengrabber_reg.rss	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,36 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#include <screengrabber.rsg>
+#include <appinfo.rh>
+#include <data_caging_paths_strings.hrh>
+
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x101FB751
+
+
+
+RESOURCE APP_REGISTRATION_INFO
+    {
+    app_file = "ScreenGrabber";
+    localisable_resource_file = APP_RESOURCE_DIR"\\ScreenGrabber";
+    localisable_resource_id = R_SCREENGRABBER_LOCALISABLE_APP_INFO;
+    group_name = "RnD Tools";    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/envpatcher/EnvPatcher.pl	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,544 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies 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;    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/envpatcher/ReadMe.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,46 @@
+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/screengrabber/group/ReleaseNotes_ScreenGrabber.txt	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,141 @@
+===============================================================================
+
+RELEASE NOTES - SCREENGRABBER v4.2.0
+RELEASED 14th May 2009 
+
+SUPPORTS S60 3.0+
+
+===============================================================================
+
+Product Description:
+====================
+ScreenGrabber tool is used to capture images and video of the visible screen
+area in S60 platform. Captures can be handled with the Media Gallery
+application or with PC when the device is connected via PC suite.
+
+Main Features:
+==============
+- Image capture in single or in sequential mode supporting PNG, JPEG and BMP
+  formats
+- Video capture in animated GIF format
+- Configurable saving format, hotkey, time delta in sequential mode, target
+  memory and default filename
+- Ability to change the screen mode to one of the supported more by the device
+
+===============================================================================
+
+What's New in v4.2.0
+====================
+- Feature: Added a new SIS file for S60 3.2 devices and newer to support the
+  features in newer platforms
+- Feature: Added multidrive support in the settings dialog
+
+===============================================================================
+
+Installation Notes:
+===================
+ScreenGrabber is typically preinstalled on ROM. If not, it can be added to the
+ROM with the .iby file. Alternatively, the .sis file can be found under the sis-
+directory, but the user need 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:
+  WriteDeviceData
+  SwEvent
+
+When builing ScreenGrabber 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:
+=============
+
+Sluggish UI when capturing video
+--------------------------------
+- Video capturing requires huge amount of processing power and thus may cause
+  the UI to become sluggish. If supported by the device, try to decrease the
+  screen resolution.
+
+===============================================================================
+
+Version History:
+================
+
+Version 4.1.3 - 8th March 2009
+------------------------------
+- Fix: ScreenGrabber does not work in devices which do not have Media Gallery
+  (Media Gallery File Manager API dependency changed from static to dynamic)
+    
+Version 4.1.2 - 8th February 2008
+---------------------------------
+- Fix: Transparency errors in GIF animations (hopefully) finally fixed
+  
+Version 4.1.1 - 28th January 2008
+---------------------------------
+- Feature: Added hash+* and alternative camera key into selection of capture
+  keys
+- Change: Reimplemented settings handling so that AllFiles and WriteUserData
+  capabilities are no longer needed
+    
+Version 4.1.0 - 14th January 2008
+---------------------------------
+- Feature: Added support for GIF and MBM formats although it is always
+  recommended to capture screens in PNG format
+- Feature: JPEG format can now be selected as high quality (97%) or low quality
+  (60%) 
+- Feature: Added POC key under capturing key options
+- Change: Dimensions of a video will be grown if the screen resolution of the
+  device will grow during capturing
+- Change: Capturing is now done always from current focus screen which allows to
+  support secondary displays
+- Change: Send key is now the default key
+- Fix: Black color didn't always work correctly in GIF animation optimization
+  with transparency  
+- Fix: Capturing to JPEG format leaked memory
+
+Version 4.0.3 - 16th November 2007
+----------------------------------
+- Fix: Scroll bar in the main view can be scrolled on a touch UI
+- Fix: Application closes automatically when closed via open applications menu
+
+Version 4.0.2 - 9th October 2007
+--------------------------------
+- Fix: Main screen layout in mirrored mode
+  
+Version 4.0.1 - 14th February 2007
+----------------------------------
+- Fix: Help screen on larger displays
+  
+Version 4.0.0 - 25th October 2006
+---------------------------------
+- Feature: Support for sequential capture mode
+- Feature: Support for capturing video in animated GIF format
+- Feature: Ability to change screen mode to one of the supported more by the
+  device
+
+===============================================================================
+
+Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+All rights reserved.
+
+This component and the accompanying materials are made available
+under the terms 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/screengrabber/group/backup_registration.xml	Wed Sep 01 12:30:35 2010 +0100
@@ -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>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/group/bld.inf	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#include <platform_paths.hrh>
+
+
+PRJ_EXPORTS
+../group/backup_registration.xml    Z:/private/101fb751/backup_registration.xml
+../rom/screengrabber.iby CORE_IBY_EXPORT_PATH(tools,screengrabber.iby)
+
+
+PRJ_MMPFILES
+#if defined(__SERIES60_30__) || defined(__SERIES60_31__) || defined(__S60_32__)
+  gnumakefile screengrabber_icons_aif.mk
+
+  #ifdef MARM
+  gnumakefile screengrabber_stub_sis.mk
+  #endif
+#endif
+
+screengrabber.mmp
+
+
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__ && !defined __S60_32__)
+  PRJ_EXTENSIONS
+  START EXTENSION s60/mifconv
+  OPTION TARGETFILE screengrabber_aif.mif
+  OPTION SOURCEDIR ../icons
+  OPTION SOURCES -c8,8 qgn_menu_screengrabber
+  END
+
+  #ifdef MARM
+  START EXTENSION app-services/buildstubsis
+  OPTION SRCDIR ../sis
+  OPTION SISNAME ScreenGrabber_stub
+  END
+  #endif  
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/group/screengrabber.mmp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+
+TARGET            ScreenGrabber.exe
+TARGETTYPE        exe
+EPOCSTACKSIZE     0x5000
+EPOCHEAPSIZE      0x20000 0x1000000  // Min 128Kb, Max 16Mb
+
+UID               0x100039CE 0x101FB751
+
+VENDORID          VID_DEFAULT
+CAPABILITY        WriteDeviceData SwEvent
+
+SMPSAFE
+
+LANG              SC
+
+
+START RESOURCE    ../data/screengrabber.rss
+HEADER
+TARGETPATH        APP_RESOURCE_DIR
+END
+
+START RESOURCE    ../data/screengrabber_reg.rss
+DEPENDS           screengrabber.rsg
+TARGETPATH        /private/10003a3f/apps
+END
+
+APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE       ../inc
+SOURCEPATH        ../src
+
+
+SOURCE            SGApp.cpp
+SOURCE            SGDocument.cpp 
+SOURCE            SGAppUi.cpp
+SOURCE            SGMainView.cpp 
+SOURCE            SGMainContainer.cpp 
+SOURCE            SGSettingListView.cpp
+SOURCE            SGSettingListContainer.cpp
+SOURCE            SGModel.cpp
+SOURCE            SGGifAnimator.cpp
+
+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           mediaclientaudio.lib
+LIBRARY           estor.lib
+LIBRARY           gdi.lib
+LIBRARY           eikctl.lib
+LIBRARY           eikcdlg.lib
+
+
+// Multidrive support
+#if(!defined __SERIES60_30__ && !defined __SERIES60_31__)
+MACRO SCREENGRABBER_MULTIDRIVE_SUPPORT
+#endif
+
+// Screen resolution change support
+MACRO SCREENGRABBER_SCREEN_RESOLUTION_CHANGE_SUPPORT
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/group/screengrabber_icons_aif.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,54 @@
+#
+# 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:  
+#
+
+ifeq (WINS,$(findstring WINS, $(PLATFORM)))
+ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z
+else
+ZDIR=\epoc32\data\z
+endif
+
+TARGETDIR=$(ZDIR)\resource\apps
+ICONTARGETFILENAME=$(TARGETDIR)\screengrabber_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_screengrabber.svg
+	mifconv $(ICONTARGETFILENAME) \
+		/c8,8 ..\icons\qgn_menu_screengrabber.svg
+
+FREEZE : do_nothing
+
+SAVESPACE : do_nothing
+
+RELEASABLES :
+	@echo $(ICONTARGETFILENAME)
+
+FINAL : do_nothing
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/group/screengrabber_stub_sis.mk	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,56 @@
+#
+# 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:  
+#
+
+
+TARGETDIR=$(EPOCROOT)EPOC32\Data\Z\System\Install
+
+SISNAME=ScreenGrabber_stub
+PKGNAME=ScreenGrabber_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/screengrabber/inc/SG.hrh	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef SCREENGRABBER_HRH
+#define SCREENGRABBER_HRH
+
+enum TScreenGrabberCommandIds
+    {
+	EScreenGrabberCmdSendToBackground = 1,
+    EScreenGrabberCmdSettings,
+	EScreenGrabberCmdAbout,
+	EScreenGrabberCmdScreenResolution,
+    EScreenGrabberCmdScreenResolutionItem1,
+    EScreenGrabberCmdScreenResolutionItem2,
+    EScreenGrabberCmdScreenResolutionItem3,
+    EScreenGrabberCmdScreenResolutionItem4,
+    EScreenGrabberCmdScreenResolutionItem5,
+    EScreenGrabberCmdScreenResolutionItem6,
+    EScreenGrabberCmdScreenResolutionItem7,
+    EScreenGrabberCmdScreenResolutionItem8,
+    EScreenGrabberCmdScreenResolutionItem9,
+    EScreenGrabberCmdScreenResolutionItem10,
+    EScreenGrabberCmdScreenResolutionItem11,
+    EScreenGrabberCmdScreenResolutionItem12,
+	EScreenGrabberCmdSettingsChange,
+	EScreenGrabberCmdSettingsExit,
+	EScreenGrabberCmdSettingsBack,
+    EProgressNote
+    };
+
+enum TScreenGrabberSettingListIds
+    {
+	ESettingListCaptureModeSelection = 0,
+
+	ESettingListSingleCaptureHotkeySelection,
+    ESettingListSingleCaptureImageFormatSelection,
+	ESettingListSingleCaptureMemorySelection,
+	ESettingListSingleCaptureFileNameSelection,
+
+	ESettingListSequantialCaptureHotkeySelection,
+    ESettingListSequantialCaptureImageFormatSelection,
+    ESettingListSequantialCaptureDelaySelection,
+	ESettingListSequantialCaptureMemorySelection,
+	ESettingListSequantialCaptureFileNameSelection,
+
+	ESettingListVideoCaptureHotkeySelection,
+    ESettingListVideoCaptureVideoFormatSelection,
+	ESettingListVideoCaptureMemorySelection,
+	ESettingListVideoCaptureFileNameSelection
+    };
+
+enum TScreenGrabberSettingCaptureModes
+    {
+	ECaptureModeSingleCapture = 0,
+    ECaptureModeSequantialCapture,
+	ECaptureModeVideoCapture
+    };
+    
+enum TScreenGrabberSettingHotkeys
+    {
+	EHotkeySendKey = 0,
+	EHotkeyShiftStar,
+	EHotkeyHashStar,
+    EHotkeyShiftMenu,
+	EHotkeyPowerKey,
+	EHotkeySideKey,
+	EHotkeyCameraKey1,
+	EHotkeyCameraKey2,
+	EHotkeyPOC
+    };
+
+enum TScreenGrabberSettingImageFormats
+    {
+	EImageFormatPNG = 0,
+    EImageFormatJPGHQ,
+    EImageFormatJPGLQ,
+	EImageFormatBMP,
+	EImageFormatGIF,
+	EImageFormatMBM
+    };
+
+enum TScreenGrabberSettingVideoFormats
+    {
+	EVideoFormatAnimatedGIF = 0
+    };
+
+#endif      // SCREENGRABBER_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGApp.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 SCREENGRABBERAPP_H
+#define SCREENGRABBERAPP_H
+
+
+// INCLUDES
+#include <aknapp.h>
+
+// CONSTANTS
+// UID of the application
+const TUid KUidScreenGrabber = { 0x101FB751 };
+
+// CLASS DECLARATION
+
+/**
+* CScreenGrabberApp application class.
+* Provides factory to create concrete document object.
+* 
+*/
+class CScreenGrabberApp : 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 CScreenGrabberDocument document object.
+        * @return A pointer to the created document object.
+        */
+        CApaDocument* CreateDocumentL();
+        
+        /**
+        * From CApaApplication, returns application's UID (KUidScreenGrabber).
+        * @return The value of KUidScreenGrabber.
+        */
+        TUid AppDllUid() const;
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGAppUi.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+
+#ifndef SCREENGRABBERAPPUI_H
+#define SCREENGRABBERAPPUI_H
+
+// INCLUDES
+#include <eikapp.h>
+#include <eikdoc.h>
+#include <e32std.h>
+#include <coeccntx.h>
+#include <aknViewAppUi.h>
+#include <akntabgrp.h>
+#include <aknnavide.h>
+#include "SGStd.h"
+
+// FORWARD DECLARATIONS
+class CScreenGrabberMainContainer;
+class CScreenGrabberModel;
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+
+// CLASS DECLARATION
+
+
+class CScreenGrabberAppUi : public CAknViewAppUi
+    {
+    public: // // Constructors and destructor
+
+        /**
+        * EPOC default constructor.
+        */      
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */      
+        ~CScreenGrabberAppUi();
+        
+    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
+        CScreenGrabberModel*    iModel;
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGDocument.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef SCREENGRABBERDOCUMENT_H
+#define SCREENGRABBERDOCUMENT_H
+
+// INCLUDES
+#include <AknDoc.h>
+   
+// CONSTANTS
+
+// FORWARD DECLARATIONS
+class CEikAppUi;
+class CScreenGrabberModel;
+
+
+// CLASS DECLARATION
+
+/**
+*  CScreenGrabberDocument application class.
+*/
+class CScreenGrabberDocument : public CAknDocument
+    {
+    public: // Constructors and destructor
+        /**
+        * Two-phased constructor.
+        */
+        static CScreenGrabberDocument* NewL(CEikApplication& aApp);
+
+        /**
+        * Destructor.
+        */
+        virtual ~CScreenGrabberDocument();
+
+    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.
+        */
+        CScreenGrabberDocument(CEikApplication& aApp);
+        void ConstructL();
+
+    private:
+
+        /**
+        * From CEikDocument, create CScreenGrabberAppUi "App UI" object.
+        */
+        CEikAppUi* CreateAppUiL();
+
+    public:
+        CScreenGrabberModel* Model();
+
+    private:
+        CScreenGrabberModel* iModel;
+
+    };
+
+#endif
+
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGGifAnimator.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,98 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef __GIFANIMATOR_H__
+#define __GIFANIMATOR_H__
+
+#include <e32std.h>
+#include <e32base.h>
+#include "SGModel.h"
+#include "SGStd.h"
+
+
+class CImageEncoder;
+class CSavingProgressDialog;
+class CAknGlobalProgressDialog;
+
+class MDialogCallback
+    {
+public:
+    virtual void DialogDismissedL( TInt aButtonId ) = 0;
+    };
+
+
+class CGifAnimator : public CActive, public MDialogCallback
+	{
+public:
+	static int CreateGifAnimation(const TDesC& aFileName, TSize aDimensions, CVideoFrameArray* aVideoFrameArray);
+	~CGifAnimator();
+
+private:
+    CGifAnimator();
+    void StartL(const TDesC& aFileName, const TSize& aDimensions, CVideoFrameArray* aVideoFrameArray);
+    void WriteHeaderL(const TSize& aDimensions);
+    void WriteGraphicControlL(const TVideoFrame& aFrame);
+    void WriteImageDescriptorL(const TVideoFrame& aFrame);
+    CFbsBitmap* GetBitmapLC(TVideoFrame& aFrame, const TSize& aDimensions);
+    void WriteRasterDataL(CFbsBitmap* aBitmap);
+    void WriteFooterL();
+    void FinishL();
+    void WriteInt8L(TInt aValue);
+    void WriteInt16L(TInt aValue);
+    void RunL();
+	void DoCancel();
+	void DialogDismissedL(TInt aButtonId); // from MDialogCallback
+    
+private:
+    RFs                         iFs;
+    RFile                       iOutFile;
+	CImageEncoder*              iImageEncoder;
+	HBufC8*                     iGIFImageData;
+	CActiveSchedulerWait        iWait;
+    CSavingProgressDialog*      iSavingProgressDialog;
+    };
+
+
+class CSavingProgressDialog : public CActive
+    {
+public:
+    static CSavingProgressDialog* NewL(MDialogCallback* aDialogCallback);
+    ~CSavingProgressDialog();
+    void StartDisplayingL(const TDesC &aText, TInt aFinalValue);
+    void IncreaseProgressValueWithOne();
+    void ProcessFinished();
+
+private:
+    void DoCancel();
+    void RunL();
+
+private: 
+    CSavingProgressDialog();
+    void ConstructL(MDialogCallback* aDialogCallback);
+
+private:
+    MDialogCallback*            iDialogCallback;
+    CAknGlobalProgressDialog*   iGlobalProgressDialog;
+    TBool                       iVisible;
+    TInt                        iCurrentValue;
+    TInt                        iFinalValue;
+    };
+		
+	
+#endif // __GIFANIMATOR_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGMainContainer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 SCREENGRABBERMAINCONTAINER_H
+#define SCREENGRABBERMAINCONTAINER_H
+
+// INCLUDES
+#include <coecntrl.h>
+#include <eiksbobs.h>
+
+// FORWARD DECLARATIONS
+class CEikScrollBarFrame;
+class CAknsBasicBackgroundControlContext;
+
+
+// CLASS DECLARATION
+
+/**
+*  CScreenGrabberMainContainer  container control class.
+*  
+*/
+class CScreenGrabberMainContainer : public CCoeControl, MCoeControlObserver, MEikScrollBarObserver
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * EPOC default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect);
+
+        /**
+        * Destructor.
+        */
+        ~CScreenGrabberMainContainer();
+
+    public: // New functions
+
+        void PrintText(const TDesC& aDes);
+        void ClearOutputWindow();
+
+
+    public: // Functions from base classes
+
+    private: // Functions from base classes
+
+        void Draw(const TRect& aRect) const;
+        void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
+        TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
+
+    public:
+        void HandleResourceChange(TInt aType);
+        void HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType); // From MEikScrollBarObserver
+        
+	private:
+		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/);
+    
+    private:
+        void UpdateVisualContentL(TBool aScrollToBottom);
+
+    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;
+
+        CAknsBasicBackgroundControlContext* iSkinContext;
+
+
+    };
+
+#endif
+
+// End of File
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGMainView.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,99 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef SCREENGRABBERMAINVIEW_H
+#define SCREENGRABBERMAINVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include "SGStd.h"
+
+
+
+// CONSTANTS
+// UID of view
+const TUid KMainViewUID = {1};
+
+// FORWARD DECLARATIONS
+class CScreenGrabberMainContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CScreenGrabberMainView view class.
+* 
+*/
+class CScreenGrabberMainView : public CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * EPOC default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CScreenGrabberMainView();
+
+    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();
+
+#ifdef SCREENGRABBER_SCREEN_RESOLUTION_CHANGE_SUPPORT
+    private:
+        // From MEikMenuObserver
+        void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
+#endif
+        
+    private:
+
+        /**
+        * From AknView, ?member_description
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * From AknView, ?member_description
+        */
+        void DoDeactivate();
+
+    private: // Data
+        CScreenGrabberMainContainer* iContainer;
+        
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGModel.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,242 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef __SCREENGRABBER_MODEL_H__
+#define __SCREENGRABBER_MODEL_H__
+
+#include <e32std.h>
+#include <e32base.h>
+
+#include <CAknMemorySelectionSettingPage.h>
+#include <eikenv.h>
+#include <mdaaudiotoneplayer.h>
+#include <bamdesca.h>
+#include "SGStd.h"
+
+
+#define TRANSPARENCY_INDEX 30
+#define TRANSPARENCY_ALTERNATIVE_INDEX 24
+
+
+// setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
+const TUid KSGSettingCaptureMode                            = { 0x00 };
+
+const TUid KSGSettingSingleCaptureHotkey                    = { 0x01 };
+const TUid KSGSettingSingleCaptureImageFormat               = { 0x02 };
+const TUid KSGSettingSingleCaptureMemoryInUse               = { 0x03 };
+const TUid KSGSettingSingleCaptureMemoryInUseMultiDrive     = { 0x04 };
+const TUid KSGSettingSingleCaptureFileName                  = { 0x05 };
+
+const TUid KSGSettingSequantialCaptureHotkey                = { 0x06 };
+const TUid KSGSettingSequantialCaptureImageFormat           = { 0x07 };
+const TUid KSGSettingSequantialCaptureDelay                 = { 0x08 };
+const TUid KSGSettingSequantialCaptureMemoryInUse           = { 0x09 };
+const TUid KSGSettingSequantialCaptureMemoryInUseMultiDrive = { 0x0A };
+const TUid KSGSettingSequantialCaptureFileName              = { 0x0B };
+
+const TUid KSGSettingVideoCaptureHotkey                     = { 0x0C };
+const TUid KSGSettingVideoCaptureVideoFormat                = { 0x0D };
+const TUid KSGSettingVideoCaptureMemoryInUse                = { 0x0E };
+const TUid KSGSettingVideoCaptureMemoryInUseMultiDrive      = { 0x0F };
+const TUid KSGSettingVideoCaptureFileName                   = { 0x10 };
+
+
+class CImageEncoder;
+class CFbsBitmap;
+class CFrameImageData;
+class CAknGlobalConfirmationQuery;
+class CSavedQuery;
+class CDictionaryFileStore;
+class CMGXFileManager;
+class CMGXFileNotificationHandler;
+
+class TGrabSettings
+    {
+public:
+    TInt                                        iCaptureMode;
+    
+    TInt                                        iSingleCaptureHotkey;
+    TInt                                        iSingleCaptureImageFormat;
+    CAknMemorySelectionSettingPage::TMemory     iSingleCaptureMemoryInUse; 
+    TDriveNumber                                iSingleCaptureMemoryInUseMultiDrive;
+    TFileName                                   iSingleCaptureFileName;
+
+    TInt                                        iSequantialCaptureHotkey;
+    TInt                                        iSequantialCaptureImageFormat;
+    TInt                                        iSequantialCaptureDelay;
+    CAknMemorySelectionSettingPage::TMemory     iSequantialCaptureMemoryInUse; 
+    TDriveNumber                                iSequantialCaptureMemoryInUseMultiDrive;
+    TFileName                                   iSequantialCaptureFileName;
+
+    TInt                                        iVideoCaptureHotkey;
+    TInt                                        iVideoCaptureVideoFormat;
+    CAknMemorySelectionSettingPage::TMemory     iVideoCaptureMemoryInUse; 
+    TDriveNumber                                iVideoCaptureMemoryInUseMultiDrive;
+    TFileName                                   iVideoCaptureFileName;
+    };
+
+
+class TVideoFrame
+    {
+public:
+    TUint       iWidth;
+    TUint       iHeight;
+    TUint       iXPos;
+    TUint       iYPos;
+    TUint       iDelay; // 100 = 1 sec
+    TBool       iEnableTransparency;
+    TBool       iFillsWholeScreen;
+    TFileName   iFileStorePath;
+    };
+
+
+typedef CArrayFixSeg<TVideoFrame> CVideoFrameArray;
+
+
+class CScreenGrabberModel : public CActive, public MMdaAudioToneObserver
+	{
+	// active object states
+	enum TState 
+		{
+		EIdle = 0,              // do nothing
+		EEncodingImage,         // ICL encoding of an image
+		ESequenceDelay,         // waiting till next capture
+		ECancelCapturing,       // asking to cancel capturing
+		ENextVideoFrame,        // get next frame for video
+		ECancelVideoCapturing,  // asking to cancel video capturing  
+		EQueryDelay             // waiting till to remove query
+		};
+
+public:
+	static CScreenGrabberModel* NewL();
+	~CScreenGrabberModel();
+	void ActivateModelL();
+	void DeActivateModelL();
+
+private:
+	CScreenGrabberModel();
+	void ConstructL();
+
+	void RunL();
+	void DoCancel();
+
+    void LoadSettingsL();
+    void TakeScreenShotAndSaveL();
+    void CaptureFrameForVideoL();
+    void SaveVideoL(TInt aErr);
+    void CapturingFinishedL(TInt aErr);
+    void CleanTemporaryFilesL();
+    TBool MemoryCardOK();
+    TBool DriveOK(TDriveNumber aNumber);
+    void PlayBeepSound();
+    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);
+    TInt UpdateFileToGallery(const TDesC& aFullPath);
+
+public:
+    inline TGrabSettings GrabSettings() { return iGrabSettings; }
+    void SaveSettingsL(TGrabSettings aGrabSettings);
+    void ActivateCaptureKeysL(TBool aChangeKey=EFalse);
+    void CancelCapturing();
+    TBool HandleCaptureCommandsL(const TWsEvent& aEvent);
+    void MatoPrepareComplete(TInt aError);
+    void MatoPlayComplete(TInt aError);
+
+private:
+    CMdaAudioToneUtility*   iMdaAudioToneUtility;       // a tone player
+    TGrabSettings           iGrabSettings;              // a simple class to store the settings used in the screen capture
+    CEikonEnv*              iEnv;                       // pointer to our eikon environment
+	RWindowGroup            iRootWin;                   // application's window group
+	TInt                    iCapturedKey;               // a handle to the key which is captured
+	TInt                    iCapturedKeyUnD;            // a handle to the key which is captured, up and down
+	TInt                    iCapturedKeyHash;           // a handle to the hash key which is captured
+	TInt                    iCapturedKeyHashUnD;        // a handle to the hash key which is captured, up and down
+	CImageEncoder*          iImageEncoder;              // engine from ICL to do the image conversion
+    CFbsBitmap*             iPreviouslyCapturedBitmap;  // a previously captured bitmap
+	TState                  iState;                     // state of this active object
+    TFileName               iSaveFileName;              // target filename of the taken screen shot
+    CFrameImageData*        iFrameImageData;            // frame and image block data needed by ICL
+    CSavedQuery*            iSavedQuery;                // a class to display global queries
+	RTimer                  iTimer;                     // a timer for async delays
+    TBool 				    iCapturingInProgress;   	// boolean to check if capturing is in progress
+    TBool                   iStopCapturing;             // boolean to specify if to ask capturing
+    TUint                   iNumberOfTakenShots;        // a number of the taken screen shots in the sequantial mode
+    TUint                   iCurrentFrameNumber;        // a number of taken frames in video mode
+    TTime                   iPreviousFrameTaken;        // time when the last frame was taken
+    TSize                   iVideoDimensions;           // dimension of the video
+    TSize                   iPreviousFrameScreenDimension; // dimension of the screen in previous frame
+    CVideoFrameArray*       iVideoFrameArray;           // the frames of the video
+    TBool                   iHashKeyCapturingActivated; // captures hash key is activated
+    TBool                   iHashKeyDown;               // stores state if hash key is currently down
+    TBool                   iGalleryUpdaterSupported;   // specifies if it is possible to update the file to gallery
+    TBool                   iGalleryUpdaterInitialized; // specifies if gallery updater has been initialized or not
+    RLibrary                iGalleryUpdaterDLL;         // specifies pointer to Media Gallery File API DLL
+    CMGXFileManager*        iMGXFileManager;            // Media Gallery FileManager instance
+    };
+
+
+class CSavedQuery : public CActive
+    {
+public:
+    static CSavedQuery* NewL();
+    ~CSavedQuery();
+    void DisplayL(const TDesC &aText, TBool aDisplayErrorNote=EFalse);
+
+private:
+    void DoCancel();
+    void RunL();
+
+private: 
+    CSavedQuery();
+    void ConstructL();
+    void DisplayWithGraphicsL(const TDesC &aText, TBool aDisplayErrorNote);
+    void DisplayWithoutGraphicsL(const TDesC &aText);
+
+private:
+    CAknGlobalConfirmationQuery*    iGlobalConfirmationQuery;
+    TBool                           iVisible;
+    };
+
+
+// these classes have been copied Media Gallery File API
+
+class MGXFileManagerFactory
+    {
+    public:
+        static CMGXFileManager* NewFileManagerL( RFs& aFs );
+        static 
+            CMGXFileNotificationHandler* NewFileNotificationHandlerL();
+    };
+
+class CMGXFileManager : public CBase
+    {
+    public:
+        virtual TBool SuccessFileNameL( const TDesC& aFileName,
+                                        TDriveNumber aDrive ) = 0;
+        virtual void UpdateL() = 0;
+        virtual void UpdateL( const TDesC& aFullPath ) = 0;
+        virtual void UpdateL( const TDesC& aOldName,
+                              const TDesC& aNewName ) = 0;
+        virtual void UpdateL( const MDesCArray& aFileNameArray ) = 0;
+    };
+
+
+#endif // __SCREENGRABBER_MODEL_H__
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGSettingListContainer.h	Wed Sep 01 12:30:35 2010 +0100
@@ -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 SCREENGRABBERSETTINGLISTCONTAINER_H
+#define SCREENGRABBERSETTINGLISTCONTAINER_H
+
+
+// INCLUDES
+#include <aknsettingitemlist.h>
+#include "SGModel.h"
+ 
+// FORWARD DECLARATIONS
+class CScreenGrabberModel;
+
+// CLASS DECLARATION
+
+/**
+*  CScreenGrabberSettingListContainer  container control class.
+*  
+*/
+class CScreenGrabberSettingListContainer : public CAknSettingItemList
+    {
+    public: // Constructors and destructor
+        
+        /**
+        * EPOC default constructor.
+        * @param aRect Frame rectangle for container.
+        */
+        void ConstructL(const TRect& aRect);
+
+        /**
+        * Destructor.
+        */
+        ~CScreenGrabberSettingListContainer();
+
+    public: // New functions
+        void ShowSettingPageL(TInt aCalledFromMenu);
+
+    public: // Functions from base classes
+        void HandleResourceChange(TInt aType);
+
+    private: // Functions from base classes
+
+        CAknSettingItem* CreateSettingItemL( TInt aIdentifier );
+        void HandleListBoxEventL(CEikListBox *aListBox, TListBoxEvent aEventType);
+
+    private:
+        void UpdateSettingsL();
+        void SetVisibilitiesOfSettingItems(); 
+
+    private: //data
+        CScreenGrabberModel*    iModel;
+        TGrabSettings           iGrabSettings;
+
+
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGSettingListView.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef SCREENGRABBERSETTINGLISTVIEW_H
+#define SCREENGRABBERSETTINGLISTVIEW_H
+
+// INCLUDES
+#include <aknview.h>
+#include "SGStd.h"
+
+
+// CONSTANTS
+// UID of view
+const TUid KSettingListViewUID = {2};
+
+// FORWARD DECLARATIONS
+class CScreenGrabberSettingListContainer;
+
+// CLASS DECLARATION
+
+/**
+*  CScreenGrabberSettingListView view class.
+* 
+*/
+class CScreenGrabberSettingListView : public CAknView
+    {
+    public: // Constructors and destructor
+
+        /**
+        * EPOC default constructor.
+        */
+        void ConstructL();
+
+        /**
+        * Destructor.
+        */
+        ~CScreenGrabberSettingListView();
+
+    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 AknView, ?member_description
+        */
+        void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,
+            const TDesC8& aCustomMessage);
+
+        /**
+        * From AknView, ?member_description
+        */
+        void DoDeactivate();
+
+    private: // Data
+        CScreenGrabberSettingListContainer* iContainer;
+    };
+
+#endif
+
+// End of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/inc/SGStd.h	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,27 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#ifndef SCREENGRABBER_STD_H
+#define SCREENGRABBER_STD_H
+
+
+#endif
+
+// End of File
+
--- a/screengrabber/inc/application.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* 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 SGAPPLICATION_H
-#define SGAPPLICATION_H
-
-#include <e32keys.h>
-#include <w32std.h>
-
-#include <hbapplication.h>
-class EngineWrapper;
-
-class SGApplication : public HbApplication
-{
-public:
-    SGApplication(int argc, char *argv[]);//, EngineWrapper &engine);
-    ~SGApplication();
-#if defined(Q_WS_S60)
-
-#if defined(HB_QT_S60_EVENT_FILTER)
-    virtual bool s60EventFilter(TWsEvent *aEvent);
-#else
-    virtual bool symbianEventFilter(const QSymbianEvent *event);
-#endif // (HB_QT_S60_EVENT_FILTER)
-#endif//(Q_WS_S60)    
-    inline void SetEngineWrapper(EngineWrapper *aEngine){iEngine = aEngine;}
-private:
-	RWsSession    		iWsSession_a; 
-    RWindowGroup        iRootWin_a;  
-
-
-    EngineWrapper *iEngine;
-};
-
-#endif // SGAPPLICATION_H
--- a/screengrabber/inc/enginewrapper.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/*
-* 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 <s32file.h>
-#include <hbapplication.h>
-
-
-class SGEngine;
-class GrabSettings;
-class MainView;
-class TWsEvent;
-class HbDeviceProgressDialog;
-
-/**
- * class that is used for communicating between Symbian and Qt code.
- */
-class EngineWrapper{
-public:
-    
-    /**
-     * Constructor
-     */
-    EngineWrapper();
-    
-    /**
-     * Destructor
-     */
-    ~EngineWrapper();
-    
-    /**
-     * Initializes Engine Wrapper
-     * @return true if engine was started successfully
-     */
-    bool init();
-
-public: 
-    
-    /* Functions that are called from UI */
-
-    /**
-     * Fetches settings from engine and converts Symbian data types to Qt's types.
-     */
-    GrabSettings getGrabSettings();
-    
-    /**
-     * Converts given parameters into Symbian data types and saves them into ScreenGrabber engine
-     * @param settings new settings
-     */
-    bool saveSettings(const GrabSettings& settings); 
-    
-       
-    /*
-     * Sends received s60 event to engine
-     */
-#if defined(HB_QT_S60_EVENT_FILTER)
-	bool handleCaptureCommands(const TWsEvent* aEvent);
-#else
-	bool handleCaptureCommands(const QSymbianEvent *aEvent);
-#endif
-    
-    
-    /**
-     * Sends UI to background
-     */
-    void sendUIToBackground();
-	void EnableRcpOfFoc(TBool aState);
-    void LoadSettings(void);
-public:
-
-    /* Functions that are called from engine: */
-
-    /**
-     * uses Notifications class to show image captured note 
-     */
-    void ShowImageCapturedNote();
-    
-    /**
-     * uses Notifications class to show video captured note 
-     */
-    void ShowVideoCapturedNote();
-    
-    /** 
-     * uses Notifications class to show seguantial images captured note
-     */
-    void ShowSequantialImagesCapturedNote(TInt amount);
-    
-    /** 
-     * uses Notifications class to show error message 
-     */
-    void ShowErrorMessage(const TDesC16& aErrorMessage);
-
-    /**
-     * uses Notifications class to show progressbar
-     */
-    void ShowProgressBar(int max);
-    
-    /**
-     * increments shown progressbar's value
-     */
-    void IncrementProgressbarValue();
-    
-    /**
-     * closes progressbar
-     */
-    void CloseProgressbar();
-
-    
-private:
-    
-    bool convertTBoolToBool(TBool value);
-    
-private:
-    
-    
-    /* Screen grabber engine */
-    SGEngine *iSGEngine;
-    
-    /* progressnote that is shown */
-	HbDeviceProgressDialog *iProgressNote;
-    
-};
-
-#endif; 
-
--- a/screengrabber/inc/gifanimator.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* 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 __GIFANIMATOR_H__
-#define __GIFANIMATOR_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include "sgengine.h"
-
-
-
-class CImageEncoder;
-
-class MDialogCallback
-    {
-public:
-    virtual void DialogDismissedL( TInt aButtonId ) = 0;
-    };
-
-
-class CGifAnimator : public CBase 
-	{
-public:
-	static int CreateGifAnimation(const TDesC& aFileName, TSize aDimensions, CVideoFrameArray* aVideoFrameArray, EngineWrapper& aEngineWrapper);
-	~CGifAnimator();
-
-private:
-    CGifAnimator();
-    void StartL(const TDesC& aFileName, const TSize& aDimensions, CVideoFrameArray* aVideoFrameArray, EngineWrapper& aEngineWrapper);
-    void WriteHeaderL(const TSize& aDimensions);
-    void WriteGraphicControlL(const TVideoFrame& aFrame);
-    void WriteImageDescriptorL(const TVideoFrame& aFrame);
-    CFbsBitmap* GetBitmapLC(TVideoFrame& aFrame, const TSize& aDimensions);
-    void WriteRasterDataL(CFbsBitmap* aBitmap);
-    void WriteFooterL();
-    void FinishL();
-    void WriteInt8L(TInt aValue);
-    void WriteInt16L(TInt aValue);
-    
-    
-    
-private:
-    RFs                         iFs;
-    RFile                       iOutFile;
-	CImageEncoder*              iImageEncoder;
-	HBufC8*                     iGIFImageData;
-    
-    };
-
-		
-	
-#endif // __GIFANIMATOR_H__
--- a/screengrabber/inc/mainview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* 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 <hbmainwindow.h>
-
-class EngineWrapper;
-class HbMainWindow;
-class HbApplication;
-class SettingsView;
-class HbAction;
-
-
-
-/**
- * Class that implements the main view of Screen Grabber
- */
-class MainView : public HbView
-{
-    Q_OBJECT
-    
-public:
-    
-    /**
-     * Constructor
-     */
-    MainView(HbMainWindow &mainWindow, EngineWrapper &engineWrapper);
-    
-    /**
-     * Destructor
-     */
-	~MainView();
-
-	/**
-     * Initializes Engine Wrapper
-     * @param app application class of Screen Grabber
-     */
-    void init(HbApplication &app);
-    
-    inline void setSettingsView(SettingsView *aSettingsView){ mSettingsView = aSettingsView; }
-
-    
-private:
-    
-    /**
-     * Creates menu
-     */
-    void createMenu(HbApplication &app);
-    
-    /**
-     * Created info text ui components
-     */
-    void createInfoText();
-    
-    /**
-     * Creates toolbar components
-     */
-    void createToolbar();
-
-public slots:
-
-    
-    /**
-     * Shows about pop-up
-     */
-    void showAboutPopup();
-    
-    /**
-     * Sends UI to background
-     */
-    void sendToBackground();
-    
-    /**
-     * opens settings view
-     */
-    void showSettings();
-
-    void my_quit();
-    
-    void quitYesNoQuestionClosed(HbAction*);
-    
-
-public:
-    
-    /* Main windo of Screen Grabber */
-    HbMainWindow &mMainWindow;
-    
-    /* Settings view */
-    SettingsView *mSettingsView;
-    
-    /* Engine Wrapper */
-    EngineWrapper &mEngineWrapper;
-    
-    /* Actions that are used in toolbars and menus */
-    HbAction* actionSendToBg;
-    HbAction* actionSettings;
-    HbAction* actionAbout;
-    HbAction* actionExit;
-
-};
-
-#endif // MAINVIEW_H
--- a/screengrabber/inc/notifications.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* 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 about box
-     */
-    static void about();
-    
-    /**
-     * shows image captured note 
-     */
-    static void imageCaptured();
-    
-    /**
-     * shows video captured note 
-     */
-    static void videoCaptured();
-    
-    /** 
-     * shows seguantial images captured note
-     */
-    static void sequantialImagesCaptured(int amount);
-    
-    /** 
-     * shows error message 
-     */
-    static void error(const QString& errorMessage);
-    
-    /**
-     * to shows progressbar
-     */
-    static HbDeviceProgressDialog* showProgressBar(int max);
-    
-    };
-
-
-
-#endif // NOTIFICATIONS_H_
--- a/screengrabber/inc/settingsview.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-/*
-* 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 SETTINGS_H
-#define SETTINGS_H
-
-#include <f32file.h>
-#include <hbmainwindow.h>
-#include <hbview.h>
-
-class EngineWrapper;
-class HbDataFormModelItem;
-class HbDataFormModel;
-class HbDataForm;
-class HbDataFormViewItem;
-    
-const QStringList CAPTUREMODES = (QStringList() << "Single capture" << "Sequential capture" << "Video capture");
-const QStringList KEYS = (QStringList() << "Send key" << "Power key" << "Side key" << "Camera key");
-const QStringList VIDEOFORMATS = (QStringList() << "Animated GIF");
-const QStringList IMAGEFORMATS = (QStringList() << "PNG" << "JPEG high qual." << "JPEG low qual." << "BMP" << "GIF");
-const QStringList MEMORYMODES = (QStringList() << "Phone memory" << "Memory card");
-
-
-/**
- * Settings class that is used for 
- */
-class GrabSettings
-    {
-public:
-    int             mCaptureMode;
-    
-    int             mSingleCaptureHotkey;
-    int             mSingleCaptureImageFormat;
-    int             mSingleCaptureMemoryInUseMultiDrive;
-    QString         mSingleCaptureFileName;
-
-    int             mSequantialCaptureHotkey;
-    int             mSequantialCaptureImageFormat;
-    int             mSequantialCaptureDelay;
-    int             mSequantialCaptureMemoryInUseMultiDrive;
-    QString         mSequantialCaptureFileName;
-
-    int             mVideoCaptureHotkey;
-    int             mVideoCaptureVideoFormat;
-    int             mVideoCaptureMemoryInUseMultiDrive;
-    QString         mVideoCaptureFileName;
-    };
-
-/**
- * Class that creates settings view of Screen Grabber
- */
-class SettingsView : public HbView
-{
-    Q_OBJECT
-
-    enum CaptureMode{ SINGLE, SEQUENTIAL, VIDEO };
-
-public:
-     /**
-     * Constuctor
-     * @param mainView pointer to main view
-     * @param mainWindow pointer to main window
-     */
-    SettingsView(HbView &mainView, HbMainWindow &mainWindow, EngineWrapper &engineWrapper);
-
-    /**
-    * destructor
-    */
-    ~SettingsView();
-
-
-    /**
-     * Loads settings from engine and formats those settings into form items
-     */
-    void loadSettings();
-    
-    
-private slots:
-  
-    /**
-     * saves settings and closes view.
-     */
-    void saveAndClose();
-    
-    /**
-     * closes setting view
-     */
-    void close();
-
-    /**
-     * Slot that is called each time capture mode is changed
-     */
-//    void updateShownItems();
-private:
-    
-    /**
-     * Creates single capture related components
-     */
-    void createSingleCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent);
-    
-    /*
-     * Creates sequential capture related components.
-     */
-    void createSequentialCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent);
-    
-    /**
-     * creates video capture related components
-     */
-    void createVideoCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent);
-    
-    
-    
-    /**
-     * Reads form items and saves them into member variable mSettings
-     */
-    void readFormItems();
-
-private:
-    
-    /* Settings */
-    GrabSettings mSettings;
-    
-    /* EngineWrapper */
-    EngineWrapper &mEngineWrapper;
-    
-    /* Main Window of Screen Grabber */
-    HbMainWindow &mMainWindow;
-    
-    /* Main View of Screen Grabber */
-    HbView &mMainView;
-    
-    /* settingform */
-    HbDataForm *mSettingForm;
-    
-    /* model for settingform */
-    HbDataFormModel *mModel;
-    
-    /* model's components: */   
-    
-    /* mode selection item */
-    HbDataFormModelItem *mModeItem;
-    
-    /* groups that contain mode specific settings */
-    HbDataFormModelItem *mGroupImageCapture;
-    HbDataFormModelItem *mGroupSeguantialCapture;
-    HbDataFormModelItem *mGroupVideoCapture;
-    
-    /* Still image components */
-    HbDataFormModelItem *mImageHotKeyItem;
-    HbDataFormModelItem *mImageFormatItem;
-    HbDataFormModelItem *mImageMemoryInUseItem;
-    HbDataFormModelItem *mImageFileNameItem;
-       
-    /* Sequential image components */
-    HbDataFormModelItem *mSequantialHotKeyItem;
-    HbDataFormModelItem *mSequantialFormatItem;
-    HbDataFormModelItem *mSequantialDelayItem;
-    HbDataFormModelItem *mSequantialMemoryInUseItem;
-    HbDataFormModelItem *mSequantialFileNameItem;
-    
-    /* Video capture components */
-    HbDataFormModelItem *mVideoHotKeyItem;
-    HbDataFormModelItem *mVideoFormatItem;
-    HbDataFormModelItem *mVideoMemoryInUseItem;
-    HbDataFormModelItem *mVideoFileNameItem;
-    
-
-    
-    
-};
-
-#endif
--- a/screengrabber/inc/sgengine.h	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,271 +0,0 @@
-/*
-* 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 SGENGINE_H
-#define SGENGINE_H
-
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-#include <w32std.h>
-#include <mdaaudiotoneplayer.h> 
-#include <qsymbianevent.h>
-
-
-class CFrameImageData;
-class CDictionaryFileStore;
-class CImageEncoder;
-class EngineWrapper;
-
-
-// setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
-const TUid KSGSettingCaptureMode                            = { 0x00 };
-
-const TUid KSGSettingSingleCaptureHotkey                    = { 0x01 };
-const TUid KSGSettingSingleCaptureImageFormat               = { 0x02 };
-const TUid KSGSettingSingleCaptureMemoryInUseMultiDrive     = { 0x04 };
-const TUid KSGSettingSingleCaptureFileName                  = { 0x05 };
-
-const TUid KSGSettingSequantialCaptureHotkey                = { 0x06 };
-const TUid KSGSettingSequantialCaptureImageFormat           = { 0x07 };
-const TUid KSGSettingSequantialCaptureDelay                 = { 0x08 };
-const TUid KSGSettingSequantialCaptureMemoryInUseMultiDrive = { 0x0A };
-const TUid KSGSettingSequantialCaptureFileName              = { 0x0B };
-
-const TUid KSGSettingVideoCaptureHotkey                     = { 0x0C };
-const TUid KSGSettingVideoCaptureVideoFormat                = { 0x0D };
-const TUid KSGSettingVideoCaptureMemoryInUseMultiDrive      = { 0x0F };
-const TUid KSGSettingVideoCaptureFileName                   = { 0x10 };
-
-const TUid KUidScreenGrabber = { 0x101FB751 };
-
-
-#define TRANSPARENCY_INDEX 30
-#define TRANSPARENCY_ALTERNATIVE_INDEX 24
-
-enum TScreenGrabberSettingCaptureModes
-    {
-    ECaptureModeSingleCapture = 0,
-    ECaptureModeSequantialCapture,
-    ECaptureModeVideoCapture
-    };
-    
-enum TScreenGrabberSettingHotkeys
-    {
-    EHotkeySendKey = 0,
-    EHotkeyPowerKey,
-    EHotkeySideKey,
-    EHotkeyCameraKey1
-    };
-
-enum TScreenGrabberSettingImageFormats
-    {
-    EImageFormatPNG = 0,
-    EImageFormatJPGHQ,
-    EImageFormatJPGLQ,
-    EImageFormatBMP,
-    EImageFormatGIF,
-    EImageFormatMBM
-    };
-
-enum TScreenGrabberSettingVideoFormats
-    {
-    EVideoFormatAnimatedGIF = 0
-    };
-
-enum TScreenGrabberSettingMultiDrive
-	{
-	EPhoneMemory = 0,
-	EMemoryCard
-	};
-	
-
-class TGrabSettings
-    {
-public:
-    TInt            iCaptureMode;
-    
-    TInt            iSingleCaptureHotkey;
-    TInt            iSingleCaptureImageFormat;
-    TInt            iSingleCaptureMemoryInUseMultiDrive;
-    TFileName       iSingleCaptureFileName;
-
-    TInt            iSequantialCaptureHotkey;
-    TInt            iSequantialCaptureImageFormat;
-    TInt            iSequantialCaptureDelay;
-    TInt            iSequantialCaptureMemoryInUseMultiDrive;
-    TFileName       iSequantialCaptureFileName;
-
-    TInt            iVideoCaptureHotkey;
-    TInt            iVideoCaptureVideoFormat;
-    TInt		    iVideoCaptureMemoryInUseMultiDrive;
-    TFileName       iVideoCaptureFileName;
-    };
-
-class TVideoFrame
-    {
-public:
-    TUint       iWidth;
-    TUint       iHeight;
-    TUint       iXPos;
-    TUint       iYPos;
-    TUint       iDelay; // 1000 = 1 sec
-    TBool       iEnableTransparency;
-    TBool       iFillsWholeScreen;
-    TFileName   iFileStorePath;
-    };
-
-
-typedef CArrayFixSeg<TVideoFrame> CVideoFrameArray;
-
-/**
- *  CEngine
- * 
- */
-class SGEngine : public CActive //, public MMdaAudioToneObserver
-    {
-    
-    // active object states
-
-    enum TState 
-        {
-        EIdle = 0,              // do nothing
-        EEncodingImage,         // ICL encoding of an image
-        ESequenceDelay,         // waiting till next capture
-        ECancelCapturing,       // asking to cancel capturing
-        ENextVideoFrame,        // get next frame for video
-        ECancelVideoCapturing,  // asking to cancel video capturing  
-        EQueryDelay             // waiting till to remove query
-        };
-    
-public:
-    // Constructors and destructor
-
-    /**
-     * Destructor.
-     */
-    ~SGEngine();
-
-    /**
-     * Two-phased constructor.
-     */
-    static SGEngine* NewL(EngineWrapper *aEngineWrapper);
-
-    /**
-     * Two-phased constructor.
-     */
-    static SGEngine* NewLC(EngineWrapper *aEngineWrapper);
-    
-    /**
-     * returns current settings
-     */
-    inline TGrabSettings GrabSettings(){ return iGrabSettings; };
-    
-    /**
-     * saves settings to engine
-     */
-    void SaveSettingsL(TGrabSettings aGrabSettings);
-    
-    /**
-     * takes one screen shot
-     */
-    bool TakeScreenShotAndSaveL();
-
-    TBool DriveOK(TDriveNumber aNumber);
-    
-    TBool IsDriveMMC(TDriveNumber aDrive);
-    
-#if defined(HB_QT_S60_EVENT_FILTER)
-    TBool HandleCaptureCommandsL(const TWsEvent* aEvent);
-#else
-    TBool HandleCaptureCommandsL(const QSymbianEvent *event);
-#endif
-	
-    
-    void ActivateModelL();
-    void DeActivateModelL();
-    void ActivateCaptureKeysL(TBool aChangeKey=EFalse);
-	void EnableRcpOfFoc(TBool aState);
-    void LoadSettingsL();
-	
-private:
-
-    void CapturingFinishedL(TInt aErr);
-
-    void RunL();
-    void DoCancel();
-    void SaveVideoL(TInt aErr);
-    void CleanTemporaryFilesL();
-    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);
-
-    void CancelCapturing();
-    void CaptureFrameForVideoL();
-	
-    
-    /**
-     * Constructor for performing 1st stage construction
-     */
-    SGEngine();
-
-    /**
-     * EPOC default constructor for performing 2nd stage construction
-     */
-    void ConstructL(EngineWrapper *aEngineWrapper);
-    
-    
-private:
-	RFs 		  iFileSession;
-
-    CActiveScheduler* iActiveScheduler;
-	CActiveSchedulerWait* iWait;
- 
-    TGrabSettings           iGrabSettings;              // a simple class to store the settings used in the screen capture
-    RWindowGroup            iRootWin;                   // application's window group
-    TInt                    iCapturedKey;               // a handle to the key which is captured
-    TInt                    iCapturedKeyUnD;            // a handle to the key which is captured, up and down
-    TInt                    iCapturedKeyHash;           // a handle to the hash key which is captured
-    TInt                    iCapturedKeyHashUnD;        // a handle to the hash key which is captured, up and down
-    TBool                   iHashKeyCapturingActivated; // captures hash key is activated    
-    CFbsBitmap*             iPreviouslyCapturedBitmap;  // a previously captured bitmap
-    TFileName               iSaveFileName;   
-    CImageEncoder*          iImageEncoder;              // engine from ICL to do the image conversion// target filename of the taken screen shot
-    CFrameImageData*        iFrameImageData;            // frame and image block data needed by ICL
-    TState                  iState;                     // state of this active object
-    TBool                   iHashKeyDown;               // stores state if hash key is currently down
-    TBool                   iCapturingInProgress;       // boolean to check if capturing is in progress
-    TBool                   iStopCapturing;             // boolean to specify if to ask capturing
-    TUint                   iNumberOfTakenShots;        // a number of the taken screen shots in the sequantial mode
-    RTimer                  iTimer;                     // a timer for async delays
-    TUint                   iCurrentFrameNumber;        // a number of taken frames in video mode
-    TTime                   iPreviousFrameTaken;        // time when the last frame was taken
-    TSize                   iVideoDimensions;           // dimension of the video
-    TSize                   iPreviousFrameScreenDimension; // dimension of the screen in previous frame
-    CVideoFrameArray*       iVideoFrameArray;           // the frames of the video
-    EngineWrapper*          iEngineWrapper;             // Eninewrapper that is used for communicating between QT and Symbian
-    };
-
-
-
-
-
-#endif // SGENGINE_H
--- a/screengrabber/rom/backup_registration.xml	Tue Aug 31 15:15:20 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/screengrabber/rom/screengrabber.iby	Tue Aug 31 15:15:20 2010 +0300
+++ b/screengrabber/rom/screengrabber.iby	Wed Sep 01 12:30:35 2010 +0100
@@ -20,15 +20,14 @@
 #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)
-//#ifdef S60_UPGRADABLE_APP_REG_RSC
-//  S60_UPGRADABLE_APP_REG_RSC(ScreenGrabber)
-//#else
-//  S60_APP_AIF_RSC(ScreenGrabber)
-//#endif
+#ifdef S60_UPGRADABLE_APP_REG_RSC
+  S60_UPGRADABLE_APP_REG_RSC(ScreenGrabber)
+#else
+  S60_APP_AIF_RSC(ScreenGrabber)
+#endif
 
-data=ZPRIVATE\10003a3f\import\APPS\ScreenGrabber_reg.RSC Private\10003a3f\import\Apps\ScreenGrabber_reg.rsc 
 data=ZPRIVATE\101FB751\backup_registration.xml        	private\101FB751\backup_registration.xml
 data=ZSYSTEM\Install\ScreenGrabber_stub.sis             \system\install\ScreenGrabber_stub.sis
 
--- a/screengrabber/screengrabber.pro	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-#
-# 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 = ScreenGrabber
-DEPENDPATH += src
-INCLUDEPATH += inc
-INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
-load(hb.prf)
-symbian:CONFIG -= symbian_i18n
-
-HEADERS += inc/mainview.h \
-					 inc/settingsview.h \
-					 inc/application.h \
-					 inc/notifications.h
-
-SOURCES += main.cpp \
-					 mainview.cpp \
-					 application.cpp \
-					 settingsview.cpp \
-					 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 -lefsrv -lapparc -lcone
-
-		HEADERS += inc/sgengine.h \
-   				   inc/enginewrapper.h \
-				   inc/gifanimator.h
-
-		SOURCES += sgengine.cpp \
-				   enginewrapper.cpp \
-				   gifanimator.cpp
-
-		RSS_RULES += "group_name = \"RnD Tools\"";
-
-    TARGET.CAPABILITY = WriteDeviceData SwEvent
-
-    TARGET.UID2 = 0x100039CE
-    TARGET.UID3 = 0x101FB751
-    TARGET.SID = 0x101FB751
-    TARGET.VID = 0x101FB657 // Nokia
-	
-	
-    TARGET.EPOCHEAPSIZE = 0x20000 0x1000000  // Min 128Kb, Max 16Mb
-
-    ICON = ./icons/qgn_menu_screengrabber.svg 
-
-} else {
-    error("Only Symbian supported!")
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/sis/ScreenGrabber_S60-30.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+;
+
+; 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/sis/ScreenGrabber_S60-32.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -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:
+;
+
+; 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	Tue Aug 31 15:15:20 2010 +0300
+++ b/screengrabber/sis/ScreenGrabber_stub.pkg	Wed Sep 01 12:30:35 2010 +0100
@@ -28,7 +28,7 @@
 
 ; normal stuff:
 ""-"z:\sys\bin\ScreenGrabber.exe"
-""-"z:\Resource\Apps\ScreenGrabber.mif"
+""-"z:\Resource\Apps\ScreenGrabber_aif.mif"
 ""-"z:\Resource\Apps\ScreenGrabber.rsc"
 ""-"z:\private\10003a3f\import\apps\ScreenGrabber_reg.rsc"
 ""-"z:\private\101FB751\backup_registration.xml"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/src/SGApp.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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    "SGApp.h"
+#include    "SGDocument.h"
+
+#include <eikstart.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CScreenGrabberApp::AppDllUid()
+// Returns application UID
+// ---------------------------------------------------------
+//
+TUid CScreenGrabberApp::AppDllUid() const
+    {
+    return KUidScreenGrabber;
+    }
+
+// ---------------------------------------------------------
+// CDictionaryStore* CScreenGrabberApp::OpenIniFileLC(RFs& aFs) const
+// overrides CAknApplication::OpenIniFileLC to enable INI file support
+// ---------------------------------------------------------
+//
+CDictionaryStore* CScreenGrabberApp::OpenIniFileLC(RFs& aFs) const
+{
+    return CEikApplication::OpenIniFileLC(aFs);
+}
+   
+// ---------------------------------------------------------
+// CScreenGrabberApp::CreateDocumentL()
+// Creates CScreenGrabberDocument object
+// ---------------------------------------------------------
+//
+CApaDocument* CScreenGrabberApp::CreateDocumentL()
+    {
+    return CScreenGrabberDocument::NewL( *this );
+    }
+
+// ================= OTHER EXPORTED FUNCTIONS ==============
+
+LOCAL_C CApaApplication* NewApplication()
+    {
+    return new CScreenGrabberApp;
+    }
+
+
+GLDEF_C TInt E32Main()
+    {
+    return EikStart::RunApplication(NewApplication);
+    }
+   
+
+// End of File  
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/src/SGAppUi.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "SGAppUi.h"
+#include "SGMainView.h"
+#include "SGSettingListView.h"
+#include <screengrabber.rsg>
+#include "SG.hrh"
+#include "SGModel.h"
+#include "SGDocument.h"
+
+#include <avkon.hrh>
+#include <AknQueryDialog.h>
+
+// ================= MEMBER FUNCTIONS =======================
+//
+// ----------------------------------------------------------
+// CScreenGrabberAppUi::ConstructL()
+// ?implementation_description
+// ----------------------------------------------------------
+//
+void CScreenGrabberAppUi::ConstructL()
+    {
+    // disable window server priority control for this application
+    iEikonEnv->WsSession().ComputeMode( RWsSession::EPriorityControlDisabled );
+
+    BaseConstructL(EAknEnableSkin);
+
+    iModel = static_cast<CScreenGrabberDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+
+    CScreenGrabberMainView* view1 = new (ELeave) CScreenGrabberMainView;
+
+    CleanupStack::PushL( view1 );
+    view1->ConstructL();
+    AddViewL( view1 );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // view1
+
+    CScreenGrabberSettingListView* view2 = new (ELeave) CScreenGrabberSettingListView;
+
+    CleanupStack::PushL( view2 );
+    view2->ConstructL();
+    AddViewL( view2 );      // transfer ownership to CAknViewAppUi
+    CleanupStack::Pop();    // view2
+
+    SetDefaultViewL(*view1);
+
+    // notify the model that everything has been constructed
+    iModel->ActivateModelL();
+    }
+
+// ----------------------------------------------------
+// CScreenGrabberAppUi::~CScreenGrabberAppUi()
+// Destructor
+// Frees reserved resources
+// ----------------------------------------------------
+//
+CScreenGrabberAppUi::~CScreenGrabberAppUi()
+    {
+    // notify the model that app ui will be deconstructed
+    if (iModel)
+        TRAP_IGNORE(iModel->DeActivateModelL());
+    }
+
+// ------------------------------------------------------------------------------
+// CScreenGrabberAppUi::::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 CScreenGrabberAppUi::DynInitMenuPaneL(
+    TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
+    {
+    }
+
+// ----------------------------------------------------
+// CScreenGrabberAppUi::HandleKeyEventL(
+//     const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
+// ?implementation_description
+// ----------------------------------------------------
+//
+TKeyResponse CScreenGrabberAppUi::HandleKeyEventL(
+    const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
+    {
+    return EKeyWasNotConsumed;
+    }
+
+// ----------------------------------------------------
+// CScreenGrabberAppUi::HandleCommandL(TInt aCommand)
+// ?implementation_description
+// ----------------------------------------------------
+//
+void CScreenGrabberAppUi::HandleCommandL(TInt aCommand)
+    {
+    switch ( aCommand )
+        {
+        // a normal way to close an application
+        case EAknCmdExit:
+        case EEikCmdExit: 
+			{
+            CAknQueryDialog* exitQuery = CAknQueryDialog::NewL();
+            exitQuery->SetPromptL(_L("Stop taking screen shots and exit?"));
+            if (exitQuery->ExecuteLD(R_MY_GENERAL_CONFIRMATION_QUERY))
+                {
+                // pressed yes, exit
+		        Exit();
+                }
+            else
+                {
+                // pressed no, do nothing
+                }
+			}
+            break;
+
+        default:
+            break;      
+        }
+    }
+
+// ----------------------------------------------------
+// CScreenGrabberAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination)
+// ?implementation_description
+// ----------------------------------------------------
+//
+void CScreenGrabberAppUi::HandleWsEventL(const TWsEvent& aEvent, CCoeControl* aDestination)
+    {
+    if (iModel->HandleCaptureCommandsL(aEvent))
+      	CAknAppUi::HandleWsEventL(aEvent, aDestination);  //continue the event loop if needed
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/src/SGDocument.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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 FILES
+#include "SGDocument.h"
+#include "SGAppUi.h"
+#include "SGModel.h"
+
+// ================= MEMBER FUNCTIONS =======================
+
+// constructor
+CScreenGrabberDocument::CScreenGrabberDocument(CEikApplication& aApp)
+: CAknDocument(aApp)    
+    {
+    }
+
+// destructor
+CScreenGrabberDocument::~CScreenGrabberDocument()
+    {
+    delete iModel;
+    }
+
+// EPOC default constructor can leave.
+void CScreenGrabberDocument::ConstructL()
+    {
+    iModel = CScreenGrabberModel::NewL();
+    }
+
+// Two-phased constructor.
+CScreenGrabberDocument* CScreenGrabberDocument::NewL(
+        CEikApplication& aApp)     // CScreenGrabberApp reference
+    {
+    CScreenGrabberDocument* self = new (ELeave) CScreenGrabberDocument( aApp );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop();
+
+    return self;
+    }
+    
+// ----------------------------------------------------
+// CScreenGrabberDocument::CreateAppUiL()
+// constructs CScreenGrabberAppUi
+// ----------------------------------------------------
+//
+CEikAppUi* CScreenGrabberDocument::CreateAppUiL()
+    {
+    return new (ELeave) CScreenGrabberAppUi;
+    }
+
+// ----------------------------------------------------
+// CScreenGrabberDocument::OpenFileL
+// Overrides CAknDocument::OpenFileL to support document file
+// ----------------------------------------------------
+//
+CFileStore* CScreenGrabberDocument::OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs)
+    {
+    return CEikDocument::OpenFileL(aDoOpen, aFilename, aFs);
+    }
+
+
+// ----------------------------------------------------
+
+CScreenGrabberModel* CScreenGrabberDocument::Model()
+    {
+    return iModel;
+    }
+
+// ----------------------------------------------------
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/src/SGGifAnimator.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,413 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#include "SGGifAnimator.h"
+
+#include <s32file.h>
+#include <fbs.h>
+#include <gdi.h>
+#include <imageconversion.h>
+#include <aknenv.h>
+#include <AknGlobalProgressDialog.h>
+#include <AknQueryDialog.h> 
+#include <avkon.rsg>
+
+_LIT(KSavingText, "Saving");
+    
+// ---------------------------------------------------------------------------
+
+TInt CGifAnimator::CreateGifAnimation(const TDesC& aFileName, TSize aDimensions, CVideoFrameArray* aVideoFrameArray)
+    {
+	CGifAnimator* self = new(ELeave) CGifAnimator;
+	CleanupStack::PushL(self);
+	TRAPD(err, self->StartL(aFileName, aDimensions, aVideoFrameArray));
+	CleanupStack::PopAndDestroy();
+	return err;
+    }
+
+// ---------------------------------------------------------------------------
+
+CGifAnimator::CGifAnimator() : CActive(EPriorityStandard)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::StartL(const TDesC& aFileName, const TSize& aDimensions, CVideoFrameArray* aVideoFrameArray)
+    {
+    __ASSERT_ALWAYS(aFileName.Length() > 0, User::Panic(_L("GifAnim"), 100));
+    __ASSERT_ALWAYS(aDimensions.iHeight > 0, User::Panic(_L("GifAnim"), 101));
+    __ASSERT_ALWAYS(aDimensions.iWidth > 0, User::Panic(_L("GifAnim"), 102));
+    __ASSERT_ALWAYS(aVideoFrameArray != NULL, User::Panic(_L("GifAnim"), 103));
+    
+    CActiveScheduler::Add(this);
+    
+    // show a progress dialog
+    iSavingProgressDialog = CSavingProgressDialog::NewL(this);
+    iSavingProgressDialog->StartDisplayingL(KSavingText, aVideoFrameArray->Count()-1);
+
+    // open the file for writing
+    User::LeaveIfError(iFs.Connect());
+    User::LeaveIfError(iOutFile.Replace(iFs, aFileName, EFileWrite));
+    
+    // write header
+    WriteHeaderL(aDimensions);
+    
+    // process each frame of the animation
+    for (TInt i=0; i<aVideoFrameArray->Count(); i++)
+        {
+        // write headers and raster block
+        TVideoFrame frame = aVideoFrameArray->At(i);
+        WriteGraphicControlL(frame);
+        CFbsBitmap* bitmap = GetBitmapLC(frame, aDimensions);
+        WriteImageDescriptorL(frame);
+        WriteRasterDataL(bitmap);
+        CleanupStack::PopAndDestroy(); //bitmap
+
+        // update the progress bar
+        iSavingProgressDialog->IncreaseProgressValueWithOne();
+        }
+
+    // write footer and finish
+    WriteFooterL();
+    FinishL();
+    
+    // remove the progress dialog from the screen
+    iSavingProgressDialog->ProcessFinished();
+    }    
+
+// ---------------------------------------------------------------------------
+
+CGifAnimator::~CGifAnimator()
+    {
+    Cancel();
+    
+    if (iImageEncoder)
+        delete iImageEncoder;
+    
+    if (iGIFImageData)
+        delete iGIFImageData;
+    
+    delete iSavingProgressDialog;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::WriteHeaderL(const TSize& aDimensions)
+    {
+    WriteInt8L('G');
+    WriteInt8L('I');
+    WriteInt8L('F');
+    WriteInt8L('8');
+    WriteInt8L('9');
+    WriteInt8L('a');
+
+    WriteInt16L(aDimensions.iWidth);  // width of animation
+    WriteInt16L(aDimensions.iHeight); // height of animation
+    
+    // logical screen descriptor
+    TUint8 packedFlags = 0;
+	packedFlags |= 8 - 1; // size of colour table is number of bits in each color table minus one (bits 0-2)
+	packedFlags |= (8 - 1) << 4; // colour resolution ie maximum size of the original colour palette (bits 4-6)
+	packedFlags |= 0x80; // use global colour table (bit 7)
+    
+    WriteInt8L(packedFlags);
+    
+    WriteInt8L(TRANSPARENCY_INDEX); // background color index
+    
+    WriteInt8L(0); // pixel aspect ratio, 0=not used
+    
+    // write the Symbian default palette since that's what is used
+    CPalette* palette = CPalette::NewDefaultL(EColor256);
+    CleanupStack::PushL(palette);
+    
+    for (TInt i=0; i<palette->Entries(); i++)
+        {
+        TRgb entry = palette->GetEntry(i);
+
+        WriteInt8L(entry.Red());
+        WriteInt8L(entry.Green());
+        WriteInt8L(entry.Blue());
+        }
+    
+    CleanupStack::PopAndDestroy(); //palette
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::WriteGraphicControlL(const TVideoFrame& aFrame)
+    {
+    TInt packedFlags(0);
+    
+    // enable transparency if needed
+    if (aFrame.iEnableTransparency)
+        packedFlags |= 0x01; 
+
+    // set disposal method:
+    // 0 = disposal method not specified, 1 = do not dispose of graphic,
+    // 2 = overwrite graphic with background color, 3 = overwrite graphic with previous graphic
+    TInt disposalMethod = 1;
+    packedFlags |= ((disposalMethod << 2) & 0x1c);
+    
+    WriteInt8L(0x21); // GIF extension
+    WriteInt8L(0xf9); // GIF graphic control block
+    WriteInt8L(0x04); // block size
+    WriteInt8L(packedFlags); // packed
+    WriteInt16L(aFrame.iDelay); // delay
+    WriteInt8L(TRANSPARENCY_INDEX); // transparent color index
+    WriteInt8L(0); // block terminator, always 0
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::WriteImageDescriptorL(const TVideoFrame& aFrame)
+    {
+    WriteInt8L(0x2c); // GIF image descriptor
+    WriteInt16L(aFrame.iXPos);
+    WriteInt16L(aFrame.iYPos);
+    WriteInt16L(aFrame.iWidth);
+    WriteInt16L(aFrame.iHeight);
+    WriteInt8L(0); // packed flags, none specified in this case
+    }
+    
+// ---------------------------------------------------------------------------
+
+CFbsBitmap* CGifAnimator::GetBitmapLC(TVideoFrame& aFrame, const TSize& aDimensions)
+    {
+    CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
+    CleanupStack::PushL(bitmap);
+    
+    // read the bitmap from the temporary file
+    RFile bitmapFile;
+    User::LeaveIfError( bitmapFile.Open(iFs, aFrame.iFileStorePath, EFileRead) );
+    RFileReadStream readStream(bitmapFile);
+    bitmap->InternalizeL(readStream);
+    readStream.Close();
+    bitmapFile.Close();
+
+    // delete the temporary file since it's not needed anymore
+    iFs.Delete(aFrame.iFileStorePath);
+    
+    // resize the bitmap to match the video dimensions if it is a full screen one
+    if (aFrame.iFillsWholeScreen && (aFrame.iWidth != aDimensions.iWidth || aFrame.iHeight != aDimensions.iHeight))
+        {
+        if (bitmap->Resize(aDimensions) == KErrNone)
+            {
+            // also update dimensions of this frame to match the dimensions of the video            
+            aFrame.iWidth = aDimensions.iWidth;
+            aFrame.iHeight = aDimensions.iHeight;
+            }
+        }
+    
+    return bitmap;
+    }
+    
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::WriteRasterDataL(CFbsBitmap* aBitmap)
+    {
+    // reset the encoder
+    if (iImageEncoder)
+        {
+	    delete iImageEncoder;
+        iImageEncoder = NULL;
+        }
+    
+    // make sure the buffer for conversion is empty    
+    if (iGIFImageData)
+        {
+	    delete iGIFImageData;
+        iGIFImageData = NULL;
+        }        
+        
+    // init & convert the bitmap to GIF format
+    iImageEncoder = CImageEncoder::DataNewL(iGIFImageData, CImageEncoder::EOptionNone, KImageTypeGIFUid);
+    iImageEncoder->Convert( &iStatus, *aBitmap );
+
+    // execute the async operation and wait till it's finished    
+    SetActive();
+    iWait.Start();
+    
+    // check any erros in active object
+    User::LeaveIfError( iStatus.Int() );
+    
+    // check if we have valid data
+    if (iGIFImageData == NULL || iGIFImageData->Des().Length()<793)
+        User::Leave(KErrNoMemory);
+    
+    // in GIF files generated by Symbian, the raster data always starts at offset 791,
+    // initial code size in GIF encoding should be 8 since we have a 8bpp image,
+    // also check that the second last byte is the terminator 0,
+    // if this check fails in newer releases of S60, proper parsing of GIF format is probably needed
+    TUint8* imagePtr = &iGIFImageData->Des()[0];
+    if (imagePtr[791] != 8 || imagePtr[iGIFImageData->Des().Length()-2] != 0)
+        User::Leave(KErrNotSupported);
+    
+    // write the raster data block to the file
+    TUint writeLength = iGIFImageData->Des().Length() - 1 - 791;
+    imagePtr+=791;
+    TPtr8 writePtr(imagePtr, writeLength, writeLength);
+    User::LeaveIfError( iOutFile.Write(writePtr) );
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::WriteFooterL()
+    {
+    WriteInt8L(0x3b); // GIF trailer
+    }
+    
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::FinishL()
+    {
+    iOutFile.Close();
+    iFs.Close();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::WriteInt8L(TInt aValue)
+    {
+    HBufC8* buf = HBufC8::NewMaxLC(1);
+
+    TUint8* ptr = &buf->Des()[0];
+    ptr[0] = TUint8(aValue);
+    
+    User::LeaveIfError( iOutFile.Write(buf->Des()) );
+    
+    CleanupStack::PopAndDestroy(); // buf
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::WriteInt16L(TInt aValue)
+    {
+    HBufC8* buf = HBufC8::NewMaxLC(2);
+
+    TUint8* ptr = &buf->Des()[0];
+    ptr[0] = TUint8(aValue);
+    ptr[1] = TUint8(aValue>>8);
+        
+    User::LeaveIfError( iOutFile.Write(buf->Des()) );
+    
+    CleanupStack::PopAndDestroy(); // buf
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::DoCancel()
+    {
+    CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::RunL()
+    {
+    CAknEnv::StopSchedulerWaitWithBusyMessage( iWait );
+    }
+
+// ---------------------------------------------------------------------------
+
+void CGifAnimator::DialogDismissedL(TInt aButtonId)
+    {
+    // check if cancel button was pressed
+    if (aButtonId == EAknSoftkeyCancel)
+        {
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+/*************************************************************************************************/
+// a helper class to display the progress dialog on the screen
+
+CSavingProgressDialog::CSavingProgressDialog() : CActive(EPriorityLow)
+    {
+	CActiveScheduler::Add(this);
+    }
+
+void CSavingProgressDialog::ConstructL(MDialogCallback* aDialogCallback)
+    {
+    iGlobalProgressDialog = CAknGlobalProgressDialog::NewL();
+    iDialogCallback = aDialogCallback;
+    }
+
+CSavingProgressDialog* CSavingProgressDialog::NewL(MDialogCallback* aDialogCallback)
+    {
+    CSavingProgressDialog* self = new(ELeave) CSavingProgressDialog();
+    CleanupStack::PushL(self);
+    self->ConstructL(aDialogCallback);
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CSavingProgressDialog::~CSavingProgressDialog()
+    {
+    Cancel();
+    delete iGlobalProgressDialog;
+    }
+
+void CSavingProgressDialog::StartDisplayingL(const TDesC &aText, TInt aFinalValue)
+    {
+    if (!iVisible)
+        {
+        iFinalValue = aFinalValue;
+        iCurrentValue = 0;
+        
+        iGlobalProgressDialog->ShowProgressDialogL(iStatus, aText, R_AVKON_SOFTKEYS_EMPTY,
+            aFinalValue, CAknNoteDialog::ENoTone);
+            
+        iVisible = ETrue;
+        SetActive();
+        }
+    }
+
+void CSavingProgressDialog::DoCancel()
+    {
+    if (iGlobalProgressDialog)
+        {
+        iGlobalProgressDialog->CancelProgressDialog();
+        }
+    iVisible = EFalse;
+    }
+
+void CSavingProgressDialog::RunL()
+    {
+    if (iGlobalProgressDialog && iStatus.Int() == KErrNotFound)
+        {
+        // user dismissed the dialog
+        iDialogCallback->DialogDismissedL(EAknSoftkeyCancel);
+        }
+    }
+
+void CSavingProgressDialog::IncreaseProgressValueWithOne()
+    {
+    iCurrentValue++;
+    iGlobalProgressDialog->UpdateProgressDialog(iCurrentValue, iFinalValue);
+    }
+
+void CSavingProgressDialog::ProcessFinished()
+    {
+    iGlobalProgressDialog->ProcessFinished();
+    iVisible = EFalse;
+    }
+
+/*************************************************************************************************/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/src/SGMainContainer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include "SGMainContainer.h"
+
+
+#include <AknBidiTextUtils.h>
+#include <AknUtils.h>
+#include <aknnotewrappers.h>
+#include <eiksbfrm.h>
+#include <AknsDrawUtils.h> 
+#include <AknsBasicBackgroundControlContext.h>
+#include <akntitle.h>
+#include <eikspane.h>  
+#include <AknDef.h>
+
+const TUint KLeftMargin = 2;
+const TUint KRightMargin = 2;
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+
+void CScreenGrabberMainContainer::ConstructL(const TRect& aRect)
+    {
+    iSkinContext = NULL;
+
+    CreateWindowL();
+    Window().SetShadowDisabled(EFalse);
+    
+    SetBlank();
+    
+    // set title of the app
+    CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* title = static_cast<CAknTitlePane*>( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    title->SetTextL( _L("Screen Grabber") );
+
+    iText = HBufC::NewL(200000);
+    iCurrentLine = 0;
+    iLineCount = 0;
+    iNumberOfLinesFitsScreen = 0;
+    iX_factor = 1;
+    iY_factor = 1;
+    iLeftDrawingPosition = KLeftMargin;
+
+    // get font
+    iFont = AknLayoutUtils::FontFromId(EAknLogicalFontSecondaryFont);
+
+    iWrappedArray = new(ELeave) CArrayFixFlat<TPtrC>(500);
+    
+    SetRect(aRect);
+    ActivateL(); 
+
+    PrintText(_L("Please use the settings screen to define the capture mode and any other related settings such capture hotkey and saving format. Using the PNG format for screen shots is recommended, since it is compressed but lossless. The captures can be managed with the Media Gallery application.\n\nYou may start taking screenshots or capturing video now. Please press the Applications key to go back to the Application menu or send this application to the background via the Options menu. To be able to take screenshots or capture video, this applications needs to stay running in the background.\n"));
+    }
+
+CScreenGrabberMainContainer::~CScreenGrabberMainContainer()
+    {
+    if (iSkinContext)
+    	delete iSkinContext;
+    
+	if (iWrappedArray)
+		{
+    	iWrappedArray->Reset();
+    	delete iWrappedArray;
+		}
+
+	if (iText)
+    	delete iText;
+
+    if (iScrollBarFrame)
+        delete iScrollBarFrame;
+
+    if (iWrapperString)
+        delete iWrapperString;
+    }
+
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::UpdateVisualContentL()
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainContainer::UpdateVisualContentL(TBool aScrollToBottom)
+    {
+    TSize rectSize;
+    AknLayoutUtils::LayoutMetricsSize(AknLayoutUtils::EMainPane, rectSize);
+    TRect rect(rectSize);
+
+    // set the correct drawing area for the skin background
+    if(iSkinContext)
+        {
+        delete iSkinContext;
+        iSkinContext = NULL;
+        }  
+    iSkinContext = CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgAreaMain, rectSize, EFalse);
+
+    // 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 && iCurrentLine < iLineCount - iNumberOfLinesFitsScreen)
+        {
+        iCurrentLine = iLineCount-iNumberOfLinesFitsScreen;
+        }
+
+    // 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();
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::Draw(const TRect& aRect) const
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainContainer::Draw(const TRect& aRect) const
+    {
+    CWindowGc& gc = SystemGc();
+
+    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+    if (iSkinContext)
+	    {
+        // draws the skin background
+	    AknsDrawUtils::Background(skin, iSkinContext, this, gc, aRect);
+	    }
+    else
+        {
+        gc.Clear(aRect);
+        }
+
+
+    // get the text color from the skin   
+    TRgb skinPenColor;
+    if (AknsUtils::GetCachedColor( skin, skinPenColor, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) == KErrNone)
+        {
+		gc.SetPenColor(skinPenColor);
+		}	
+    else
+        {
+        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))));
+        }
+
+    gc.DiscardFont();
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::HandleControlEventL(
+//     CCoeControl* aControl,TCoeEvent aEventType)
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainContainer::HandleControlEventL(
+    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
+    {
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::PrintText(const TDesC& aDes)
+// Print text into output window.
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainContainer::PrintText(const TDesC& aDes)
+    {
+    iText->Des().Append( aDes );
+    UpdateVisualContentL(EFalse);  // do not automatically scroll to the bottom
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::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 CScreenGrabberMainContainer::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;
+    }
+
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::ClearOutputWindow()
+// Clear the output window.
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainContainer::ClearOutputWindow()
+    {
+    iText->Des() = _L("");
+    UpdateVisualContentL(ETrue);
+    }
+
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::HandleResourceChange(TInt aType)
+// Handle layout change of the screen
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainContainer::HandleResourceChange(TInt aType)
+    {
+    if (aType == KEikDynamicLayoutVariantSwitch || aType == KAknsMessageSkinChange)
+        {
+        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;
+            }
+        UpdateVisualContentL(EFalse);
+        }
+    else
+        {
+        CCoeControl::HandleResourceChange(aType);
+        }
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::MopSupplyObject(TTypeUid aId)
+// Pass skin information if needed
+// ---------------------------------------------------------
+//
+TTypeUid::Ptr CScreenGrabberMainContainer::MopSupplyObject(TTypeUid aId)
+    {
+    if (aId.iUid == MAknsControlContext::ETypeId && iSkinContext)
+        {
+        return MAknsControlContext::SupplyMopObject(aId, iSkinContext);
+        }
+
+    return CCoeControl::MopSupplyObject(aId);
+    }
+
+
+// ---------------------------------------------------------
+// CScreenGrabberMainContainer::HandleScrollEventL()
+// Capture touch events on the scroll bar
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainContainer::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  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/src/SGMainView.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -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:  
+*
+*/
+
+
+
+// INCLUDE FILES
+#include  <aknViewAppUi.h>
+#include  <avkon.hrh>
+#include  <apgtask.h>
+#include  <aknmessagequerydialog.h> 
+
+#include  <screengrabber.rsg>
+#include  "SG.hrh"
+#include  "SGMainView.h"
+#include  "SGMainContainer.h"
+#include  "SGSettingListView.h"
+#include  "SGDocument.h" 
+#include  "SGModel.h"
+
+#ifdef SCREENGRABBER_SCREEN_RESOLUTION_CHANGE_SUPPORT
+ #include <AknSgcc.h>
+ #include <AknLayoutConfig.h>
+ #include <e32property.h>
+ #include <UikonInternalPSKeys.h>
+#endif
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CScreenGrabberMainView::ConstructL(const TRect& aRect)
+// EPOC two-phased constructor
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainView::ConstructL()
+    {
+    BaseConstructL( R_SCREENGRABBER_VIEW1 );
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainView::~CScreenGrabberMainView()
+// ---------------------------------------------------------
+//
+CScreenGrabberMainView::~CScreenGrabberMainView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        }
+
+    delete iContainer;
+    }
+
+// ---------------------------------------------------------
+// TUid CScreenGrabberMainView::Id()
+// ---------------------------------------------------------
+//
+TUid CScreenGrabberMainView::Id() const
+    {
+    return KMainViewUID;
+    }
+
+
+
+#ifdef SCREENGRABBER_SCREEN_RESOLUTION_CHANGE_SUPPORT
+
+// ---------------------------------------------------------
+// TUid CScreenGrabberMainView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+// ---------------------------------------------------------
+//
+
+void CScreenGrabberMainView::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
+    {
+    if (aResourceId == R_SCREENGRABBER_RESOLUTION_SUBMENU)
+        {
+        // generate list of supported screen resolutions
+        TInt state = 0;
+        TInt width = 0;
+        TInt height = 0;
+        TInt screenMode = 0;
+        
+        const CAknLayoutConfig& config = CAknSgcClient::LayoutConfig();
+        const CAknLayoutConfig::THardwareStateArray& hwStates = config.HardwareStates();
+        const CAknLayoutConfig::TScreenModeArray& screenModes = config.ScreenModes();
+
+        CWsScreenDevice* screenDevice = CEikonEnv::Static()->ScreenDevice();
+        TInt currentHwState = screenDevice->CurrentScreenMode();
+            
+        for (TInt i=0; i<hwStates.Count(); i++)
+            {
+            // get an entry entry
+            const CAknLayoutConfig::THardwareState& hwState = hwStates.At(i);
+            screenMode = hwState.ScreenMode();
+            const CAknLayoutConfig::TScreenMode& mode = screenModes.Find(screenMode);
+            
+            // get more info
+            state = hwState.StateNumber();
+            width = mode.PixelsTwipsAndRotation().iPixelSize.iWidth;
+            height = mode.PixelsTwipsAndRotation().iPixelSize.iHeight;
+            
+            // generate new menu text
+            TBuf<64> menuText;
+            menuText.Format(_L("%dx%d  (%d)"), width, height, state);
+            
+            // create new menu item
+            CEikMenuPaneItem::SData menuItem;
+            menuItem.iFlags = 0;
+            menuItem.iText = menuText;
+            menuItem.iCommandId = EScreenGrabberCmdScreenResolutionItem1 + state;
+            menuItem.iCascadeId = 0;
+            aMenuPane->AddMenuItemL(menuItem);
+            }
+        }
+    }
+
+#endif
+    
+// ---------------------------------------------------------
+// CScreenGrabberMainView::HandleCommandL(TInt aCommand)
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EScreenGrabberCmdSendToBackground:
+            {
+            TApaTask selfTask(iEikonEnv->WsSession());
+            selfTask.SetWgId(iEikonEnv->RootWin().Identifier());
+            selfTask.SendToBackground();
+            break;
+            }
+
+#ifdef SCREENGRABBER_SCREEN_RESOLUTION_CHANGE_SUPPORT
+        case EScreenGrabberCmdScreenResolutionItem1:
+        case EScreenGrabberCmdScreenResolutionItem2:
+        case EScreenGrabberCmdScreenResolutionItem3:
+        case EScreenGrabberCmdScreenResolutionItem4:
+        case EScreenGrabberCmdScreenResolutionItem5:
+        case EScreenGrabberCmdScreenResolutionItem6:
+        case EScreenGrabberCmdScreenResolutionItem7:
+        case EScreenGrabberCmdScreenResolutionItem8:
+        case EScreenGrabberCmdScreenResolutionItem9:
+        case EScreenGrabberCmdScreenResolutionItem10:
+        case EScreenGrabberCmdScreenResolutionItem11:
+        case EScreenGrabberCmdScreenResolutionItem12:
+            {
+            // change resolution
+            const CAknLayoutConfig& config = CAknSgcClient::LayoutConfig();
+            const CAknLayoutConfig::THardwareStateArray& hwStates = config.HardwareStates();
+            const CAknLayoutConfig::TScreenModeArray& screenModes = config.ScreenModes();
+        
+            const CAknLayoutConfig::THardwareState& hwState = hwStates.At(aCommand-EScreenGrabberCmdScreenResolutionItem1);
+            TInt screenMode = hwState.ScreenMode();
+            TInt state = hwState.StateNumber();
+            
+            CWsScreenDevice* screenDevice = CEikonEnv::Static()->ScreenDevice();
+            TInt err = RProperty::Define(KPSUidUikon, KUikLayoutState, RProperty::EInt);
+            err = RProperty::Set(KPSUidUikon, KUikLayoutState, state);
+
+            screenDevice->SetScreenMode(screenMode);
+
+            break;
+            }
+#endif
+            
+        case EScreenGrabberCmdSettings:
+            {
+            AppUi()->ActivateLocalViewL( KSettingListViewUID );
+            break;
+            }
+
+        case EScreenGrabberCmdAbout:
+            {
+	        CAknMessageQueryDialog* dialog = new (ELeave) CAknMessageQueryDialog;
+            dialog->ExecuteLD(R_SCREENGRABBER_ABOUT_DIALOG);
+            }
+            break;
+        
+        case EAknSoftkeyExit:
+            {
+            AppUi()->HandleCommandL( EEikCmdExit );
+            break;
+            }
+
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainView::HandleClientRectChange()
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainView::DoActivateL(...)
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CScreenGrabberMainContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        AppUi()->AddToStackL( *this, iContainer );
+        } 
+   }
+
+// ---------------------------------------------------------
+// CScreenGrabberMainView::HandleCommandL(TInt aCommand)
+// ---------------------------------------------------------
+//
+void CScreenGrabberMainView::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/screengrabber/src/SGModel.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,1604 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  
+*
+*/
+
+
+
+#include "SGModel.h"
+#include "SGApp.h"
+#include "SG.hrh"
+#include "SGGifAnimator.h"
+
+#include <w32std.h>
+#include <e32keys.h>
+#include <imageconversion.h>
+#include <pathinfo.h>
+#include <AknGlobalConfirmationQuery.h>
+#include <aknnotewrappers.h>
+#include <textresolver.h>
+#include <bautils.h>
+#include <coeutils.h>
+#include <s32file.h>
+#include <AknGlobalNote.h>
+
+
+_LIT(KSingleShotSaved, "Screen shot saved to Media Gallery");
+_LIT(KMultipleShotsSaved, "%u screen shots saved to Media Gallery");
+_LIT(KVideoSaved, "Video saved to Media Gallery");
+_LIT(KErrorOccured, "Grabber error: ");
+_LIT(KDefaultImageFileName, "Shot");
+_LIT(KDefaultVideoFileName, "Video");
+_LIT(KScreenShotsSubDirectory, "Screen Shots\\");
+_LIT(KSGTemporaryDirectory, "\\system\\temp\\screengrabber\\");
+
+#define HIGH_QUALITY_JPEG 97
+#define LOW_QUALITY_JPEG 60
+#define DEFAULT_SEQ_CAPTURE_DELAY_MS 5000   // 5.000 secs
+#define VIDEO_CAPTURE_DELAY 250             // 0.25 secs
+#define VIDEO_CAPTURE_MINIMUM_DELAY 200     // 0.20 secs
+#define KEY_CAPTURE_PRIORITY 100            // do not change, this is for window server
+
+const TInt KSettingsDrive = EDriveC;
+_LIT(KSettingsFileName, "screengrabber_settings.ini");
+
+// ---------------------------------------------------------------------------
+
+CScreenGrabberModel* CScreenGrabberModel::NewL()
+	{
+	CScreenGrabberModel* self = new(ELeave) CScreenGrabberModel;
+	CleanupStack::PushL(self);
+	self->ConstructL();
+	CleanupStack::Pop();
+	return self;
+	}
+
+// ---------------------------------------------------------------------------
+
+CScreenGrabberModel::CScreenGrabberModel() : CActive(EPriorityStandard)
+	{
+	}
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::ConstructL()
+	{
+    User::LeaveIfError(iTimer.CreateLocal());
+
+    // init audio utility
+  	iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this);
+
+    iSavedQuery = CSavedQuery::NewL();
+    iVideoFrameArray = new(ELeave) CVideoFrameArray(10000);
+
+	iPreviouslyCapturedBitmap = new(ELeave) CFbsBitmap;
+
+    iEnv = CEikonEnv::Static();
+  	iRootWin = iEnv->RootWin();
+  	iCapturingInProgress = EFalse;
+  	iStopCapturing = EFalse;
+  	iNumberOfTakenShots = 0;
+  	iCurrentFrameNumber = 0;
+  	iHashKeyCapturingActivated = EFalse;
+  	iHashKeyDown = EFalse;
+  	iGalleryUpdaterSupported = ETrue;
+  	iGalleryUpdaterInitialized = EFalse;
+
+	CActiveScheduler::Add(this);
+	}
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::ActivateModelL()
+	{
+    // clean temporary files
+    TRAP_IGNORE( CleanTemporaryFilesL() );
+            
+    // load settings
+    TRAP_IGNORE( LoadSettingsL() );
+
+    // start capturing
+    ActivateCaptureKeysL();
+	}
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::DeActivateModelL()
+	{
+    CancelCapturing();
+
+    // for a faster exit, send the application to background
+    TApaTask selfTask(iEnv->WsSession());
+    selfTask.SetWgId(iEnv->RootWin().Identifier());
+    selfTask.SendToBackground();
+	}
+	
+// ---------------------------------------------------------------------------
+
+CScreenGrabberModel::~CScreenGrabberModel()
+	{
+	Cancel();
+
+    // deactivate Media Gallery DLL
+    if (iGalleryUpdaterInitialized)
+        {
+        if (iMGXFileManager)
+            delete iMGXFileManager;
+            
+        iGalleryUpdaterDLL.Close();
+        }
+
+	TRAP_IGNORE( CleanTemporaryFilesL() );
+
+    iTimer.Close();
+
+    if (iFrameImageData)
+        delete iFrameImageData;
+
+    if (iPreviouslyCapturedBitmap)
+        delete iPreviouslyCapturedBitmap;
+
+    if (iImageEncoder)
+        delete iImageEncoder;
+        
+    delete iVideoFrameArray;
+
+    delete iSavedQuery;
+
+    delete iMdaAudioToneUtility;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::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 CScreenGrabberModel::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 CScreenGrabberModel::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 CScreenGrabberModel::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 CScreenGrabberModel::LoadSettingsL()
+    {
+    // set defaults
+    iGrabSettings.iCaptureMode = ECaptureModeSingleCapture;
+    
+    iGrabSettings.iSingleCaptureHotkey = EHotkeySendKey;
+    iGrabSettings.iSingleCaptureImageFormat = EImageFormatPNG;
+    iGrabSettings.iSingleCaptureMemoryInUse = CAknMemorySelectionSettingPage::EPhoneMemory; 
+    iGrabSettings.iSingleCaptureMemoryInUseMultiDrive = EDriveC;
+    iGrabSettings.iSingleCaptureFileName.Copy( KDefaultImageFileName );
+
+    iGrabSettings.iSequantialCaptureHotkey = EHotkeySendKey;
+    iGrabSettings.iSequantialCaptureImageFormat = EImageFormatPNG;
+    iGrabSettings.iSequantialCaptureDelay = DEFAULT_SEQ_CAPTURE_DELAY_MS;
+    iGrabSettings.iSequantialCaptureMemoryInUse = CAknMemorySelectionSettingPage::EPhoneMemory; 
+    iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive = EDriveC;
+    iGrabSettings.iSequantialCaptureFileName.Copy( KDefaultImageFileName );
+
+    iGrabSettings.iVideoCaptureHotkey = EHotkeySendKey;
+    iGrabSettings.iVideoCaptureVideoFormat = EVideoFormatAnimatedGIF;
+    iGrabSettings.iVideoCaptureMemoryInUse = CAknMemorySelectionSettingPage::EPhoneMemory; 
+    iGrabSettings.iVideoCaptureMemoryInUseMultiDrive = EDriveC;
+    iGrabSettings.iVideoCaptureFileName.Copy( KDefaultVideoFileName );
+       
+        
+    // make sure that the private path of this app in c-drive exists
+    iEnv->FsSession().CreatePrivatePath( KSettingsDrive ); // c:\\private\\101fb751\\
+    
+    // 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, KUidScreenGrabber);
+
+        LoadDFSValueL(settingsStore, KSGSettingCaptureMode,                             iGrabSettings.iCaptureMode);
+        
+        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureHotkey,                     iGrabSettings.iSingleCaptureHotkey);
+        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureImageFormat,                iGrabSettings.iSingleCaptureImageFormat);
+        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureMemoryInUse,                (TInt&)iGrabSettings.iSingleCaptureMemoryInUse);
+        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureMemoryInUseMultiDrive,      (TInt&)iGrabSettings.iSingleCaptureMemoryInUseMultiDrive);
+        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureFileName,                   iGrabSettings.iSingleCaptureFileName);
+        
+        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureHotkey,                 iGrabSettings.iSequantialCaptureHotkey);
+        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureImageFormat,            iGrabSettings.iSequantialCaptureImageFormat);
+        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureDelay,                  iGrabSettings.iSequantialCaptureDelay);
+        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureMemoryInUse,            (TInt&)iGrabSettings.iSequantialCaptureMemoryInUse);
+        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureMemoryInUseMultiDrive,  (TInt&)iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive);
+        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureFileName,               iGrabSettings.iSequantialCaptureFileName);
+
+        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureHotkey,                      iGrabSettings.iVideoCaptureHotkey);
+        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureVideoFormat,                 iGrabSettings.iVideoCaptureVideoFormat);
+        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureMemoryInUse,                 (TInt&)iGrabSettings.iVideoCaptureMemoryInUse);
+        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureMemoryInUseMultiDrive,       (TInt&)iGrabSettings.iVideoCaptureMemoryInUseMultiDrive);
+        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureFileName,                    iGrabSettings.iVideoCaptureFileName);
+
+        CleanupStack::PopAndDestroy(); // settingsStore         
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::SaveSettingsL(TGrabSettings aGrabSettings)
+    {
+    // set the new settings
+    iGrabSettings = aGrabSettings;
+
+    // handle settings always in c:\\private\\101fb751\\
+    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, KUidScreenGrabber);
+
+        SaveDFSValueL(settingsStore, KSGSettingCaptureMode,                             iGrabSettings.iCaptureMode);
+        
+        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureHotkey,                     iGrabSettings.iSingleCaptureHotkey);
+        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureImageFormat,                iGrabSettings.iSingleCaptureImageFormat);
+        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureMemoryInUse,                (TInt&)iGrabSettings.iSingleCaptureMemoryInUse);
+        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureMemoryInUseMultiDrive,      (TInt&)iGrabSettings.iSingleCaptureMemoryInUseMultiDrive);
+        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureFileName,                   iGrabSettings.iSingleCaptureFileName);
+        
+        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureHotkey,                 iGrabSettings.iSequantialCaptureHotkey);
+        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureImageFormat,            iGrabSettings.iSequantialCaptureImageFormat);
+        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureDelay,                  iGrabSettings.iSequantialCaptureDelay);
+        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureMemoryInUse,            (TInt&)iGrabSettings.iSequantialCaptureMemoryInUse);
+        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureMemoryInUseMultiDrive,  (TInt&)iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive);
+        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureFileName,               iGrabSettings.iSequantialCaptureFileName);
+
+        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureHotkey,                      iGrabSettings.iVideoCaptureHotkey);
+        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureVideoFormat,                 iGrabSettings.iVideoCaptureVideoFormat);
+        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureMemoryInUse,                 (TInt&)iGrabSettings.iVideoCaptureMemoryInUse);
+        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureMemoryInUseMultiDrive,       (TInt&)iGrabSettings.iVideoCaptureMemoryInUseMultiDrive);
+        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureFileName,                    iGrabSettings.iVideoCaptureFileName);
+        
+        settingsStore->CommitL();
+        CleanupStack::PopAndDestroy(); // settingsStore             
+        }
+    }
+    	
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::DoCancel()
+	{
+    iTimer.Cancel();
+	}
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::ActivateCaptureKeysL(TBool aChangeKey)
+    {
+    // if changing the capture key, capturing needs to be cancelled first
+    if (aChangeKey)
+        {
+        CancelCapturing();
+        }
+
+    // get hotkey of the capture
+    TInt captureHotkey(0);
+    if (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture)
+        captureHotkey = iGrabSettings.iSingleCaptureHotkey;
+    else if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
+        captureHotkey = iGrabSettings.iSequantialCaptureHotkey;
+    else if (iGrabSettings.iCaptureMode == ECaptureModeVideoCapture)
+        captureHotkey = iGrabSettings.iVideoCaptureHotkey;
+    else
+        User::Panic(_L("Wrong mode"), 40);
+    
+    
+    // capture hash key if needed
+    if (captureHotkey == EHotkeyHashStar)
+        {
+        iCapturedKeyHash    = iRootWin.CaptureKey(EStdKeyHash, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+        iCapturedKeyHashUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyHash, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+        iHashKeyCapturingActivated = ETrue;
+        }
+    
+
+    // start capturing based on user selected key
+    switch (captureHotkey)
+        {
+        case EHotkeyShiftStar:
+            {
+            iCapturedKey    = iRootWin.CaptureKey('*', EModifierCtrl|EModifierShift|EModifierFunc, EModifierShift, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns('*', EModifierCtrl|EModifierShift|EModifierFunc, EModifierShift, KEY_CAPTURE_PRIORITY);
+            break;
+            }
+        case EHotkeyHashStar:
+            {
+            iCapturedKey    = iRootWin.CaptureKey('*', EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns('*', EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            break;
+            }
+        case EHotkeyShiftMenu:
+            {
+            iCapturedKey    = iRootWin.CaptureKey(EStdKeyApplication0, EModifierCtrl|EModifierShift|EModifierFunc, EModifierShift, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyApplication0, EModifierCtrl|EModifierShift|EModifierFunc, EModifierShift, KEY_CAPTURE_PRIORITY);
+            break;
+            }
+        case EHotkeySendKey:
+            {
+            iCapturedKey    = iRootWin.CaptureKey(EStdKeyYes, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyYes, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            break;
+            }
+        case EHotkeyPowerKey:
+            {
+            iCapturedKey    = iRootWin.CaptureKey(EStdKeyDevice2, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyDevice2, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            break;
+            }
+        case EHotkeySideKey:
+            {
+            iCapturedKey    = iRootWin.CaptureKey(EStdKeyDevice6, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyDevice6, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            break;            
+            }
+        case EHotkeyCameraKey1:
+            {
+            iCapturedKey    = iRootWin.CaptureKey(EStdKeyDevice7, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyDevice7, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            break;            
+            }
+        case EHotkeyCameraKey2:
+            {
+            iCapturedKey    = iRootWin.CaptureKey(EStdKeyApplication1A, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyApplication1A, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            break;            
+            }
+       	case EHotkeyPOC:
+        	{
+        	iCapturedKey    = iRootWin.CaptureKey(EStdKeyApplication1, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyApplication1, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
+           	break;
+        	}  
+        default:
+            {
+            User::Panic(_L("Key not supported"), 100);
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::CancelCapturing()
+    {
+	// cancel all captures
+    iRootWin.CancelCaptureKey(iCapturedKey);
+    iRootWin.CancelCaptureKeyUpAndDowns(iCapturedKeyUnD);
+    
+    if (iHashKeyCapturingActivated)
+        {
+        iRootWin.CancelCaptureKey(iCapturedKeyHash);
+        iRootWin.CancelCaptureKeyUpAndDowns(iCapturedKeyHashUnD);
+        
+        iHashKeyCapturingActivated = EFalse;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+TBool CScreenGrabberModel::HandleCaptureCommandsL(const TWsEvent& aEvent)
+    {
+    TBool continueEventLoop(ETrue);
+    
+    // get hotkey of the capture
+    TInt captureHotkey(0);
+    if (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture)
+        captureHotkey = iGrabSettings.iSingleCaptureHotkey;
+    else if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
+        captureHotkey = iGrabSettings.iSequantialCaptureHotkey;
+    else if (iGrabSettings.iCaptureMode == ECaptureModeVideoCapture)
+        captureHotkey = iGrabSettings.iVideoCaptureHotkey;
+    else
+        User::Panic(_L("Wrong mode"), 41);
+
+
+    // ignore any errors
+    if (aEvent.Type()==EEventErrorMessage)
+	    {
+	    // error
+	    }
+	
+	// check if hash key has been pushed down
+	else if (iHashKeyCapturingActivated && aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode==EStdKeyHash)
+	    {
+        iHashKeyDown = ETrue;	    
+	    }
+
+	// check if hash key has been released
+	else if (iHashKeyCapturingActivated && aEvent.Type()==EEventKeyUp && aEvent.Key()->iScanCode==EStdKeyHash)
+	    {
+        iHashKeyDown = EFalse;	    
+	    }
+	    	
+    // handle captured keys, we are interested here only of the keydown events
+    else if (
+              ( captureHotkey == EHotkeyShiftStar &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode=='*' &&
+                aEvent.Key()->iModifiers & EModifierShift)
+            ||
+              ( captureHotkey == EHotkeyHashStar &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode=='*' &&
+                iHashKeyDown)
+            ||
+              ( captureHotkey == EHotkeyShiftMenu &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode==EStdKeyApplication0 &&
+                aEvent.Key()->iModifiers & EModifierShift)
+            ||
+              ( captureHotkey == EHotkeySendKey &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode==EStdKeyYes )
+            ||
+              ( captureHotkey == EHotkeyPowerKey &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode==EStdKeyDevice2 )
+            ||
+              ( captureHotkey == EHotkeySideKey &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode==EStdKeyDevice6 )
+            ||
+              ( captureHotkey == EHotkeyCameraKey1 &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode==EStdKeyDevice7 )
+            ||
+              ( captureHotkey == EHotkeyCameraKey2 &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode==EStdKeyDevice7 )
+            ||
+              ( captureHotkey == EHotkeyPOC &&
+                aEvent.Type()==EEventKeyDown && aEvent.Key()->iScanCode==EStdKeyApplication1A )
+            )
+		{
+		
+		// check if already capturing images in sequence
+		if ( iCapturingInProgress && !iStopCapturing && iNumberOfTakenShots!=0 && iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture )
+            {
+            // asking to stop capturing
+            iStopCapturing = ETrue;
+            
+            // cancel the active object, this will cancel any timer delays and ICL stuff
+            Cancel();
+            
+            // set status
+            iState = ECancelCapturing; 
+            
+            // jump smoothly to RunL()
+            iTimer.After(iStatus, 50);
+            SetActive(); 
+
+       		// do not continue the event loop in HandleWsEventL for these events
+           	continueEventLoop = EFalse;
+            }
+
+		// check if already capturing video
+		else if ( iCapturingInProgress && !iStopCapturing && iGrabSettings.iCaptureMode == ECaptureModeVideoCapture )
+            {
+            // asking to stop capturing
+            iStopCapturing = ETrue;
+            
+            // cancel the active object, this will cancel any timer delays and ICL stuff
+            Cancel();
+
+            // set status
+            iState = ECancelVideoCapturing;
+            
+            // jump smoothly to RunL()
+            iTimer.After(iStatus, 50);
+            SetActive(); 
+
+       		// do not continue the event loop in HandleWsEventL for these events
+           	continueEventLoop = EFalse;
+            }        
+        else if (!iCapturingInProgress && (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture || iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture ))
+            {
+            // not capturing anything, so start doing that
+            iCapturingInProgress = ETrue;    
+
+			// take a screen shot and save it
+    	    TakeScreenShotAndSaveL();                
+
+       		// do not continue the event loop in HandleWsEventL for these events
+           	continueEventLoop = EFalse;
+            }
+        
+        else if (!iCapturingInProgress && iGrabSettings.iCaptureMode == ECaptureModeVideoCapture )
+            {
+            // not capturing anything, so start doing that
+            iCapturingInProgress = ETrue;
+            
+            // clean temporary files
+            TRAP_IGNORE( CleanTemporaryFilesL() );
+            
+            // get initial dimensions for the video
+            CWsScreenDevice* screenDevice = new(ELeave) CWsScreenDevice ( CEikonEnv::Static()->WsSession() );
+            CleanupStack::PushL(screenDevice);
+            User::LeaveIfError( screenDevice->Construct( iEnv->WsSession().GetFocusScreen() ) );
+            iVideoDimensions = screenDevice->SizeInPixels();
+            iPreviousFrameScreenDimension = screenDevice->SizeInPixels();
+            CleanupStack::PopAndDestroy(); // screenDevice
+
+			// capture the first frame
+			CaptureFrameForVideoL();              
+
+       		// do not continue the event loop in HandleWsEventL for these events
+           	continueEventLoop = EFalse;
+            }
+
+		}
+
+    // catch other event types as well so that we can ignore them
+    else if (
+              ( captureHotkey == EHotkeyShiftStar &&
+                aEvent.Key()->iScanCode=='*' &&
+                aEvent.Key()->iModifiers & EModifierShift)
+            ||
+              ( captureHotkey == EHotkeyHashStar &&
+                aEvent.Key()->iScanCode=='*' &&
+                iHashKeyDown)
+            ||
+              ( captureHotkey == EHotkeyShiftMenu &&
+                aEvent.Key()->iScanCode==EStdKeyApplication0 &&
+                aEvent.Key()->iModifiers & EModifierShift)
+            ||
+              ( captureHotkey == EHotkeySendKey &&
+                aEvent.Key()->iScanCode==EStdKeyYes )
+            ||
+              ( captureHotkey == EHotkeyPowerKey &&
+                aEvent.Key()->iScanCode==EStdKeyDevice2 )
+            ||
+              ( captureHotkey == EHotkeySideKey &&
+                aEvent.Key()->iScanCode==EStdKeyDevice6 )
+            ||
+              ( captureHotkey == EHotkeyCameraKey1 &&
+                aEvent.Key()->iScanCode==EStdKeyDevice7 )
+            ||
+              ( captureHotkey == EHotkeyCameraKey2 &&
+                aEvent.Key()->iScanCode==EStdKeyApplication1A )
+            ||
+    		  ( captureHotkey == EHotkeyPOC &&
+                aEvent.Key()->iScanCode==EStdKeyApplication1 )
+            )
+		{
+		// do not continue the event loop in HandleWsEventL for these events
+        continueEventLoop = EFalse;
+		}
+
+    return continueEventLoop;
+    }
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::TakeScreenShotAndSaveL()
+    {
+	// take a screen shot
+	CWsScreenDevice* screenDevice = new( ELeave ) CWsScreenDevice( CEikonEnv::Static()->WsSession() );
+	CleanupStack::PushL( screenDevice );
+	User::LeaveIfError( screenDevice->Construct( iEnv->WsSession().GetFocusScreen() ) );
+	User::LeaveIfError( iPreviouslyCapturedBitmap->Create(screenDevice->SizeInPixels(), screenDevice->DisplayMode()) );
+	User::LeaveIfError( screenDevice->CopyScreenToBitmap(iPreviouslyCapturedBitmap) );
+	CleanupStack::PopAndDestroy(); // screenDevice
+
+    // play a beep sound for each shot when capturing in sequantial mode
+    if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
+        PlayBeepSound();
+
+
+    // get memory in use & image format of the screen capture
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT            
+    TDriveNumber memoryInUse(EDriveC);
+#else
+    TInt memoryInUse(0);
+#endif
+    TInt imageFormat(0);
+    TFileName fileName;
+    
+    if (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture)
+        {
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT            
+        memoryInUse = iGrabSettings.iSingleCaptureMemoryInUseMultiDrive;
+#else
+        memoryInUse = iGrabSettings.iSingleCaptureMemoryInUse;
+#endif
+        imageFormat = iGrabSettings.iSingleCaptureImageFormat;
+        fileName = iGrabSettings.iSingleCaptureFileName;
+        }
+    else if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
+        {
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT            
+        memoryInUse = iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive;
+#else
+        memoryInUse = iGrabSettings.iSequantialCaptureMemoryInUse;
+#endif
+
+        imageFormat = iGrabSettings.iSequantialCaptureImageFormat;
+        fileName = iGrabSettings.iSequantialCaptureFileName;
+        }
+    else
+        User::Panic(_L("Wrong mode"), 30);  
+
+
+    // init the path for saving the file
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT
+    if (PathInfo::GetRootPath(iSaveFileName, memoryInUse) != KErrNone || !DriveOK(memoryInUse))
+        iSaveFileName.Copy( PathInfo::PhoneMemoryRootPath() );
+#else
+    if (memoryInUse == CAknMemorySelectionSettingPage::EPhoneMemory || !MemoryCardOK())
+        iSaveFileName.Copy( PathInfo::PhoneMemoryRootPath() );
+    else
+        iSaveFileName.Copy( PathInfo::MemoryCardRootPath() );
+#endif
+
+    iSaveFileName.Append( PathInfo::ImagesPath() );
+    iSaveFileName.Append( KScreenShotsSubDirectory );
+    
+    
+    // a quick check that filename is valid
+    if (fileName.Length() > 0 && fileName.Length() <= 255) 
+        iSaveFileName.Append( fileName );
+    else
+        iSaveFileName.Append( KDefaultImageFileName );
+
+    iSaveFileName.Append( _L(".") );
+
+
+    // reset the encoder
+    if (iImageEncoder)
+        {
+	    delete iImageEncoder;
+        iImageEncoder = NULL;
+        }
+        
+    
+    switch (imageFormat)
+        {
+        case EImageFormatPNG:
+            {
+            // set filename
+            iSaveFileName.Append(_L("png"));
+            CApaApplication::GenerateFileName(iEnv->FsSession(), iSaveFileName );  // unique filename
+
+            // init & convert
+            iImageEncoder = CImageEncoder::FileNewL(iEnv->FsSession(), iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypePNGUid);
+            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap );
+            }
+            break;
+        
+        case EImageFormatJPGHQ:
+        case EImageFormatJPGLQ:
+            {
+            // reset frameimagedata
+            if (iFrameImageData)
+                {
+                delete iFrameImageData;
+                iFrameImageData = NULL;
+                }
+            
+            // set filename
+            iSaveFileName.Append(_L("jpg"));
+            CApaApplication::GenerateFileName(iEnv->FsSession(), iSaveFileName );  // unique filename
+
+            // init 
+            iImageEncoder = CImageEncoder::FileNewL(iEnv->FsSession(), iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypeJPGUid);
+
+            // JPEG properties
+            TJpegImageData* imageData = new(ELeave) TJpegImageData;
+            imageData->iSampleScheme = TJpegImageData::EColor444;
+            imageData->iQualityFactor = (imageFormat==EImageFormatJPGHQ) ? HIGH_QUALITY_JPEG : LOW_QUALITY_JPEG;
+            iFrameImageData = CFrameImageData::NewL();
+            User::LeaveIfError(iFrameImageData->AppendImageData(imageData));  //ownership of imageData is transferred
+
+            // convert
+            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap, iFrameImageData );
+            }
+            break;
+        
+        case EImageFormatBMP:
+            {
+            // set filename
+            iSaveFileName.Append(_L("bmp"));
+            CApaApplication::GenerateFileName(iEnv->FsSession(), iSaveFileName );  // unique filename
+
+            // init & convert
+            iImageEncoder = CImageEncoder::FileNewL(iEnv->FsSession(), iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypeBMPUid);
+            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap );
+            }
+            break;
+
+        case EImageFormatGIF:
+            {
+            // set filename
+            iSaveFileName.Append(_L("gif"));
+            CApaApplication::GenerateFileName(iEnv->FsSession(), iSaveFileName );  // unique filename
+
+            // init & convert
+            iImageEncoder = CImageEncoder::FileNewL(iEnv->FsSession(), iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypeGIFUid);
+            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap );
+            }
+            break;
+            
+        case EImageFormatMBM:
+            {
+            // set filename
+            iSaveFileName.Append(_L("mbm"));
+            CApaApplication::GenerateFileName(iEnv->FsSession(), iSaveFileName );  // unique filename
+
+            // init & convert
+            iImageEncoder = CImageEncoder::FileNewL(iEnv->FsSession(), iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypeMBMUid);
+            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap );
+            }
+            break;
+            
+        default:
+            {
+            User::Panic(_L("Invalid Img Type"), 20);
+            }
+        }
+
+    // set the state of the active object
+	iState = EEncodingImage;
+
+    // indicate an outstanding request
+    SetActive();
+    }
+    
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::CaptureFrameForVideoL()
+    {
+    // record time
+    TTime timeNow;
+    timeNow.HomeTime();
+    
+    // take a screen shot	
+ 	CFbsBitmap* currentCapturedBitmap = new(ELeave) CFbsBitmap;
+ 	CleanupStack::PushL(currentCapturedBitmap);
+
+	CWsScreenDevice* screenDevice = new(ELeave) CWsScreenDevice( CEikonEnv::Static()->WsSession() );
+	CleanupStack::PushL( screenDevice );
+	User::LeaveIfError( screenDevice->Construct( iEnv->WsSession().GetFocusScreen() ) );
+	
+    TSize currentScreenSize = screenDevice->SizeInPixels();
+
+	User::LeaveIfError( currentCapturedBitmap->Create(currentScreenSize, EColor256) );
+	User::LeaveIfError( screenDevice->CopyScreenToBitmap(currentCapturedBitmap) );
+	CleanupStack::PopAndDestroy(); // screenDevice
+
+	// grow video's dimensions if the size has changed
+	if (currentScreenSize.iWidth > iVideoDimensions.iWidth)
+	    {
+	    iVideoDimensions.iWidth = currentScreenSize.iWidth;
+	    }
+	if (currentScreenSize.iHeight > iVideoDimensions.iHeight)
+	    {
+	    iVideoDimensions.iHeight = currentScreenSize.iHeight;
+	    }
+
+    TInt64 currentDelay(0);
+ 
+    // play a beep sound every 30th frame
+    if (iCurrentFrameNumber%30 == 0)
+        PlayBeepSound();
+
+    // create a new frame
+    TVideoFrame frame;
+    frame.iDelay = 500; // use default delay 5.00 secs
+    
+    // get info of the RAM drive
+    TDriveNumber ramDrive = EDriveD;
+    TVolumeInfo ramDriveInfo;
+    iEnv->FsSession().Volume(ramDriveInfo, ramDrive);
+    
+    // init the directory for saving the file, preferably use ram drive if there is enough disk space, otherwise use always C drive
+    TFileName tempDirectory;
+    TFileName sessionPath;
+    
+    if (ramDriveInfo.iFree > (iVideoDimensions.iWidth*iVideoDimensions.iHeight+50000))
+        sessionPath.Copy( _L("D:") );
+    else
+        sessionPath.Copy( _L("C:") );
+    
+    sessionPath.Append(KSGTemporaryDirectory);
+    tempDirectory.Copy(KSGTemporaryDirectory);
+    
+    iEnv->FsSession().MkDirAll(sessionPath);
+    iEnv->FsSession().SetSessionPath(sessionPath);
+
+    // create a temp file, path to the bitmap is saved automatically to frame.iFileStorePath
+    RFile file;
+    User::LeaveIfError( file.Temp(iEnv->FsSession(), tempDirectory, frame.iFileStorePath, EFileWrite) );
+    RFileWriteStream writeStream(file);
+    
+    TBool ignoreFrame(EFalse);
+    
+    // check if is this the first frame
+    if (iCurrentFrameNumber == 0)
+        {
+        // first frame is always the full one
+        frame.iWidth = currentScreenSize.iWidth;    
+        frame.iHeight = currentScreenSize.iHeight;  
+        frame.iXPos = 0;
+        frame.iYPos = 0;
+        frame.iEnableTransparency = EFalse;
+        frame.iFillsWholeScreen = ETrue;
+        
+        currentCapturedBitmap->ExternalizeL(writeStream);  
+
+        }
+    
+    else
+        {
+        // next frame is a difference between the previous one
+        currentDelay = timeNow.MicroSecondsFrom(iPreviousFrameTaken).Int64();
+        
+        // get reference to previos frame
+        TVideoFrame& prevFrame = iVideoFrameArray->At(iVideoFrameArray->Count()-1);
+        
+        
+        // check if video dimensions have changed
+        if (currentScreenSize.iWidth != iPreviousFrameScreenDimension.iWidth
+            || currentScreenSize.iHeight != iPreviousFrameScreenDimension.iHeight)
+            {
+            // dimensions have changed -> save a full bitmap
+            frame.iWidth = currentScreenSize.iWidth;    
+            frame.iHeight = currentScreenSize.iHeight;  
+            frame.iXPos = 0;
+            frame.iYPos = 0;
+            frame.iEnableTransparency = EFalse;
+            frame.iFillsWholeScreen = ETrue;
+            
+            currentCapturedBitmap->ExternalizeL(writeStream);            
+
+            // update the previous frame to contain the new delay value
+            prevFrame.iDelay = TUint( (double) currentDelay / 10000 );
+            }
+
+        else
+            {
+            // compare the bitmaps
+            HBufC8* curImgScanLineBuf = HBufC8::NewLC(currentScreenSize.iWidth*3);
+            TPtr8 curImgScanLinePtr = curImgScanLineBuf->Des();
+            HBufC8* prevImgScanLineBuf = HBufC8::NewLC(currentScreenSize.iWidth*3);
+            TPtr8 prevImgScanLinePtr = prevImgScanLineBuf->Des();
+            
+            TPoint pt(0,0);
+            TBool differenceFound(EFalse);
+            TPoint leftTopDifferencePoint(0,0);
+            TPoint rightBottomDifferencePoint(currentScreenSize.iWidth,currentScreenSize.iHeight);
+            
+            // scan the image from top to bottom
+            for (TInt i=0; i<currentScreenSize.iHeight; i++)
+                {
+                pt.iY = i;
+                
+                currentCapturedBitmap->GetScanLine(curImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
+                iPreviouslyCapturedBitmap->GetScanLine(prevImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
+                
+                if (curImgScanLinePtr != prevImgScanLinePtr)
+                    {
+                    differenceFound = ETrue;
+                    
+                    // get the y-coordinate
+                    leftTopDifferencePoint.iY = i;
+
+                    break;    
+                    }
+                }
+                
+            if (differenceFound)
+                {
+                // now we know that there is some difference between those two captured frames,
+                // get the bottom value by scaning from bottom to top
+                for (TInt i=currentScreenSize.iHeight-1; i>=0; i--)
+                    {
+                    pt.iY = i;
+                    
+                    currentCapturedBitmap->GetScanLine(curImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
+                    iPreviouslyCapturedBitmap->GetScanLine(prevImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
+                    
+                    if (curImgScanLinePtr != prevImgScanLinePtr)
+                        {
+                        // get the y-coordinate
+                        rightBottomDifferencePoint.iY = i+1;
+
+                        break;    
+                        }
+                    }
+                    
+                // check that the height of the cropped image will be at least 1
+                if (rightBottomDifferencePoint.iY <= leftTopDifferencePoint.iY)
+                    rightBottomDifferencePoint.iY = leftTopDifferencePoint.iY+1;  
+                
+                      
+                // get also the x-coordinates by scanning vertical scan lines
+                HBufC8* curImgVerticalScanLineBuf = HBufC8::NewLC(currentScreenSize.iHeight*3);
+                TPtr8 curImgVerticalScanLinePtr = curImgScanLineBuf->Des();
+                HBufC8* prevImgVerticalScanLineBuf = HBufC8::NewLC(currentScreenSize.iHeight*3);
+                TPtr8 prevImgVerticalScanLinePtr = prevImgScanLineBuf->Des();
+                        
+                // first scan by from left to right
+                for (TInt i=0; i<currentScreenSize.iWidth; i++)
+                    {
+                    currentCapturedBitmap->GetVerticalScanLine(curImgVerticalScanLinePtr, i, EColor256);
+                    iPreviouslyCapturedBitmap->GetVerticalScanLine(prevImgVerticalScanLinePtr, i, EColor256);
+                    
+                    if (curImgVerticalScanLinePtr != prevImgVerticalScanLinePtr)
+                        {
+                        leftTopDifferencePoint.iX = i;
+                        break;
+                        }
+                    }
+
+                // finally scan from right to left
+                for (TInt i=currentScreenSize.iWidth-1; i>=0; i--)
+                    {
+                    currentCapturedBitmap->GetVerticalScanLine(curImgVerticalScanLinePtr, i, EColor256);
+                    iPreviouslyCapturedBitmap->GetVerticalScanLine(prevImgVerticalScanLinePtr, i, EColor256);
+                    
+                    if (curImgVerticalScanLinePtr != prevImgVerticalScanLinePtr)
+                        {
+                        rightBottomDifferencePoint.iX = i+1;
+                        break;
+                        }
+                    }
+                    
+                CleanupStack::PopAndDestroy(2); //curImgVerticalScanLineBuf,prevImgVerticalScanLineBuf               
+
+                
+                // check that the width of the cropped image will be at least 1
+                if (rightBottomDifferencePoint.iX <= leftTopDifferencePoint.iX)
+                    rightBottomDifferencePoint.iX = leftTopDifferencePoint.iX+1;
+                   
+                
+                // record dimensions and position of the image           
+                frame.iWidth = rightBottomDifferencePoint.iX - leftTopDifferencePoint.iX;    
+                frame.iHeight = rightBottomDifferencePoint.iY - leftTopDifferencePoint.iY;  
+                frame.iXPos = leftTopDifferencePoint.iX;
+                frame.iYPos = leftTopDifferencePoint.iY;
+                frame.iEnableTransparency = ETrue;
+                frame.iFillsWholeScreen = EFalse;
+            
+            
+                // take a copy of the current frame
+             	CFbsBitmap* workingBitmap = new(ELeave) CFbsBitmap;
+             	CleanupStack::PushL(workingBitmap);
+                User::LeaveIfError( workingBitmap->Create(currentScreenSize, EColor256) );
+
+                HBufC8* tempScanLineBuf = HBufC8::NewLC(currentScreenSize.iWidth*3);
+                TPtr8 tempScanLinePtr = tempScanLineBuf->Des();
+                
+                for (TInt i=0; i<currentScreenSize.iHeight; i++)
+                    {
+                    pt.iY = i;
+                    currentCapturedBitmap->GetScanLine(tempScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
+                    workingBitmap->SetScanLine(tempScanLinePtr, i);
+                    }
+                    
+                CleanupStack::PopAndDestroy(); //tempScanLineBuf
+                
+                
+                // mark the non-changed areas with transparency color
+                TUint8* curPtr = NULL;
+                TUint8* prevPtr = NULL;
+                for (TInt i=frame.iYPos; i<frame.iYPos+frame.iHeight; i++)
+                    {
+                    pt.iY = i;
+                    
+                    workingBitmap->GetScanLine(curImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
+                    iPreviouslyCapturedBitmap->GetScanLine(prevImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
+                    
+                    // check single pixels in the scanline
+                    for (TInt j=frame.iXPos; j<frame.iXPos+frame.iWidth; j++)
+                        {
+                        curPtr = &curImgScanLinePtr[j];
+                        prevPtr = &prevImgScanLinePtr[j];
+                        
+                        // check that our transparency index isn't already in use
+                        if (curPtr[0] == TRANSPARENCY_INDEX)
+                            curPtr[0] = TRANSPARENCY_ALTERNATIVE_INDEX;
+                        
+                        // replace with transparency index if there is no change compared to the previous frame
+                        if (curPtr[0] == prevPtr[0])
+                            curPtr[0] = TRANSPARENCY_INDEX;
+                        }
+                        
+                    // set new scanline    
+                    workingBitmap->SetScanLine(curImgScanLinePtr, i);
+                    }
+
+
+                // externalize the bitmap
+                TRect changedRect(leftTopDifferencePoint, rightBottomDifferencePoint);
+                workingBitmap->ExternalizeRectangleL(writeStream, changedRect);
+                
+                CleanupStack::PopAndDestroy(); //workingBitmap
+ 
+                // update the previous frame to contain the new delay value
+                prevFrame.iDelay = TUint( (double) currentDelay / 10000 );
+                }
+
+            else
+                {
+                // frames are identical, we can just ignore this one
+                ignoreFrame = ETrue;     
+                }
+            
+            CleanupStack::PopAndDestroy(2); //curImgScanLineBuf,prevImgScanLineBuf
+
+            } // if (videoDimensionsHaveChanged)
+
+        } //if (iCurrentFrameNumber == 0)
+            
+    // close the stream
+    writeStream.CommitL();
+    writeStream.Close();
+    file.Close();
+    
+
+    if (ignoreFrame)
+        {
+        // delete the temp file since we don't need that
+        iEnv->FsSession().Delete(frame.iFileStorePath);
+        }
+    else
+        {
+        // remember for the next frame when this frame was taken
+        iPreviousFrameTaken = timeNow;
+
+        // take a copy of currentCapturedBitmap to iPreviouslyCapturedBitmap
+        User::LeaveIfError( iPreviouslyCapturedBitmap->Create(iVideoDimensions, EColor256) );
+
+        TPoint pt(0,0);
+        HBufC8* tempScanLineBuf = HBufC8::NewMaxLC(iVideoDimensions.iWidth);
+        TPtr8 tempScanLinePtr = tempScanLineBuf->Des();
+        
+        for (TInt i=0; i<iVideoDimensions.iHeight; i++)
+            {
+            pt.iY = i;
+            currentCapturedBitmap->GetScanLine(tempScanLinePtr, pt, iVideoDimensions.iWidth, EColor256);
+            iPreviouslyCapturedBitmap->SetScanLine(tempScanLinePtr, i);
+            }
+            
+        CleanupStack::PopAndDestroy(); //tempScanLineBuf
+        
+        // append frame information to the array
+        iVideoFrameArray->AppendL(frame);
+        
+        // remember screen size
+        iPreviousFrameScreenDimension = currentScreenSize;
+        }    
+
+    
+    CleanupStack::PopAndDestroy(); //currentCapturedBitmap
+    
+
+    // set the state of the active object
+	iState = ENextVideoFrame;
+	
+    // check time spent on the work above (probably this is not so important)
+	TTime timeNow2;
+    timeNow2.HomeTime();
+    TInt64 handlingDelay = timeNow2.MicroSecondsFrom(timeNow).Int64();
+    
+	// calculate delay till next frame
+	TUint idealDelay = VIDEO_CAPTURE_DELAY*1000;
+	TInt usedDelay; 
+	if (currentDelay > idealDelay)
+	    usedDelay = idealDelay - (currentDelay - idealDelay) - handlingDelay;
+	else
+	    usedDelay = idealDelay - handlingDelay;
+	
+	// check that the delay is atleast minimum delay anyway
+	if (usedDelay < VIDEO_CAPTURE_MINIMUM_DELAY*1000)
+	    usedDelay = VIDEO_CAPTURE_MINIMUM_DELAY*1000;
+	
+	iTimer.After(iStatus, usedDelay);
+
+    // indicate an outstanding request
+    SetActive();
+    }
+    
+// ---------------------------------------------------------------------------
+    
+void CScreenGrabberModel::RunL()
+    {
+	switch (iState) 
+		{
+        // encoding of the image is now finished
+		case EEncodingImage: 
+			{
+            if (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture)
+                {
+                // single shot done
+                CapturingFinishedL( iStatus.Int() );
+                }
+
+            else if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
+                {
+                // increase the counter    
+                iNumberOfTakenShots++;
+                
+                // check if we can take more shots or just finish
+                if (!iStopCapturing && iStatus.Int()==KErrNone)
+                    {
+                    // notify the new file to Media Gallery
+                    UpdateFileToGallery(iSaveFileName);
+        
+                    // some delay before the next shot can be taken    
+                    iState = ESequenceDelay;
+                    
+                    // some checking that the value of delay is valid
+                    TInt delay(iGrabSettings.iSequantialCaptureDelay); //ms
+                    if (delay<0 && delay > 999999)
+                        delay = DEFAULT_SEQ_CAPTURE_DELAY_MS;
+                      
+                    iTimer.After(iStatus, delay*1000);
+                    SetActive();  
+                    }
+                else
+                    {
+                    // finished
+                    CapturingFinishedL( iStatus.Int() );
+                    }                       
+               }
+            else
+                User::Panic(_L("Wrong mode"), 32);            
+
+            break;
+			}
+
+        // delay finished, ready to take the next shot
+		case ESequenceDelay: 
+			{
+			TakeScreenShotAndSaveL();
+
+            break;
+			}
+			
+		// asked to cancel capturing	
+		case ECancelCapturing:
+			{
+            // finished
+            CapturingFinishedL( iStatus.Int() );
+
+            break;
+			}
+			
+		case ENextVideoFrame:
+		    {
+		    // increase the counter
+		    iCurrentFrameNumber++;
+		    
+            // check if we can take more frames or just finish
+            if (!iStopCapturing && iStatus.Int()==KErrNone)
+                {
+                // take next frame
+                CaptureFrameForVideoL();
+                }
+            else
+                {
+                // finished, save video
+                SaveVideoL( iStatus.Int() );
+                } 		        
+		    }
+		    break;
+
+		case ECancelVideoCapturing:
+		    {
+            // finished, save video
+            SaveVideoL( iStatus.Int() ); 		        
+		    }
+		    break;
+		    			        
+        // delay of the query is now finished
+        case EQueryDelay:
+			{
+    		iState = EIdle;
+
+            // now remove the query
+            iSavedQuery->Cancel();
+
+            // capturing can now be restarted
+            iCapturingInProgress = EFalse;
+            iStopCapturing = EFalse;
+
+            break;
+			}
+
+		default:
+			{
+            break;
+			}
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::SaveVideoL(TInt aErr)
+    {
+    if (aErr)
+        CapturingFinishedL(aErr);   
+   
+    else if (iGrabSettings.iVideoCaptureVideoFormat == EVideoFormatAnimatedGIF)
+        {
+        TInt err(KErrNone);
+        
+        // init the path for saving the file
+
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT
+        if (PathInfo::GetRootPath(iSaveFileName, iGrabSettings.iVideoCaptureMemoryInUseMultiDrive) != KErrNone || !DriveOK(iGrabSettings.iVideoCaptureMemoryInUseMultiDrive))
+            iSaveFileName.Copy( PathInfo::PhoneMemoryRootPath() );
+#else
+        if (iGrabSettings.iVideoCaptureMemoryInUse == CAknMemorySelectionSettingPage::EPhoneMemory || !MemoryCardOK())
+            iSaveFileName.Copy( PathInfo::PhoneMemoryRootPath() );
+        else
+            iSaveFileName.Copy( PathInfo::MemoryCardRootPath() );
+#endif
+
+        iSaveFileName.Append( PathInfo::ImagesPath() );     // animated gif is actually an image, not a video
+        iSaveFileName.Append( KScreenShotsSubDirectory );
+ 
+    
+        // a quick check that filename is valid
+        if (iGrabSettings.iVideoCaptureFileName.Length() > 0 && iGrabSettings.iVideoCaptureFileName.Length() <= 255) 
+            iSaveFileName.Append( iGrabSettings.iVideoCaptureFileName );
+        else
+            iSaveFileName.Append( KDefaultVideoFileName );
+
+        iSaveFileName.Append( _L(".gif") );
+
+        CApaApplication::GenerateFileName(iEnv->FsSession(), iSaveFileName );  // unique filename
+
+        // create and save the gif animation
+        err = CGifAnimator::CreateGifAnimation(iSaveFileName, iVideoDimensions, iVideoFrameArray);
+        
+        // remove the saved file in case of errors since it's likely corrupted
+        if (err != KErrNone)
+            iEnv->FsSession().Delete(iSaveFileName);
+        
+        CapturingFinishedL(err);   
+        }
+        
+    else
+        CapturingFinishedL(KErrNotSupported);
+    }
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::CleanTemporaryFilesL()
+    {
+    // delete temporary files from C and D drives    
+    CFileMan* fileMan = CFileMan::NewL(iEnv->FsSession());
+
+    TFileName delFilesPath;
+        
+    for (TInt i=0; i<1; i++)
+        {
+        delFilesPath.Copy(KNullDesC);
+        delFilesPath.Append('C'+i);
+        delFilesPath.Append(_L(":"));
+        delFilesPath.Append(KSGTemporaryDirectory);
+        delFilesPath.Append(_L("*.$$$"));
+        
+        fileMan->Delete(delFilesPath);
+        }
+
+    delete fileMan;    
+    }
+
+// ---------------------------------------------------------------------------
+    
+void CScreenGrabberModel::CapturingFinishedL(TInt aErr)
+    {
+    // display a global query to show the results
+
+    if (aErr == KErrNone)
+        {
+        switch (iGrabSettings.iCaptureMode)
+            {
+            case ECaptureModeSingleCapture:
+                {
+                iSavedQuery->DisplayL(KSingleShotSaved);
+                }
+                break;
+            
+            case ECaptureModeSequantialCapture:
+                {
+                if (iNumberOfTakenShots == 1)
+                    iSavedQuery->DisplayL(KSingleShotSaved);
+                else
+                    {
+                    TBuf<256> note;
+                    note.Format(KMultipleShotsSaved, iNumberOfTakenShots);
+                    iSavedQuery->DisplayL(note);
+                    }
+                }
+                break;            
+    
+            case ECaptureModeVideoCapture:
+                {
+                iSavedQuery->DisplayL(KVideoSaved);
+                }
+                break;             
+    
+            default:
+                User::Panic(_L("Inv.capt.mode"), 51);
+                break;
+            }            
+       
+        // notify the new file to Media Gallery
+        UpdateFileToGallery(iSaveFileName);
+        }
+    else
+        {
+        TBuf<256> errorNote;
+        errorNote.Copy( KErrorOccured );
+
+        CTextResolver* textResolver = CTextResolver::NewLC();
+        errorNote.Append( textResolver->ResolveErrorString(aErr) );
+        CleanupStack::PopAndDestroy();  //textResolver    
+          
+        iSavedQuery->DisplayL(errorNote, ETrue);
+        }
+
+    // reset values
+    iNumberOfTakenShots = 0;
+    iCurrentFrameNumber = 0;
+    iVideoFrameArray->Reset();
+
+
+    // remove the query after 2.0 secs
+    iState = EQueryDelay;
+    iTimer.After(iStatus, 2000000);
+    SetActive();
+
+    }
+    
+// ---------------------------------------------------------------------------
+
+TBool CScreenGrabberModel::MemoryCardOK()
+	{
+	return DriveOK(EDriveE); // hardcoding EDriveE here maybe is not so good idea..   
+	}
+
+// ---------------------------------------------------------------------------
+
+TBool CScreenGrabberModel::DriveOK(TDriveNumber aNumber)
+	{
+	TBool isOK(EFalse);
+
+    TVolumeInfo vInfo;
+
+	// check if we can access the drive
+	if (iEnv->FsSession().Volume(vInfo, aNumber) == KErrNone)
+		isOK = ETrue;
+
+	// returns ETrue if memory card working properly
+	return isOK;
+	}
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::PlayBeepSound()
+    {
+    TMdaAudioToneUtilityState toneState = iMdaAudioToneUtility->State();
+    
+    if (toneState == EMdaAudioToneUtilityPlaying)
+        iMdaAudioToneUtility->CancelPlay();
+    else if (toneState == EMdaAudioToneUtilityNotReady)
+        iMdaAudioToneUtility->CancelPrepare();
+
+    iMdaAudioToneUtility->PrepareToPlayTone(500, TTimeIntervalMicroSeconds(100000));
+    }
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::MatoPrepareComplete(TInt aError)
+    {
+    if (aError == KErrNone)
+        iMdaAudioToneUtility->Play();
+    }
+
+// ---------------------------------------------------------------------------
+
+void CScreenGrabberModel::MatoPlayComplete(TInt /*aError*/)
+    {
+    }
+
+// ---------------------------------------------------------------------------
+
+TInt CScreenGrabberModel::UpdateFileToGallery(const TDesC& aFullPath)
+    {
+    // first check if this feature is supported    
+    if (iGalleryUpdaterSupported)
+        {
+        // check if has been initialized
+        if (!iGalleryUpdaterInitialized)
+            {
+            // not initialized, first try to load the DLL    
+            if (iGalleryUpdaterDLL.Load(_L("MGXMediaFileAPI.dll")) == KErrNone)
+                {
+                // construct the object, equals:
+                // CMGXFileManager* mgxFileManager = (MGXFileManagerFactory::NewFileManagerL)(NewFileManagerLEntry)(iEnv->FsSession());
+            
+                typedef CMGXFileManager* (*TMyFunc)(RFs& aFs);
+                TMyFunc theFunc = (TMyFunc)iGalleryUpdaterDLL.Lookup(1);
+                if (theFunc)
+                    {
+                    TRAPD( err, iMGXFileManager = theFunc(iEnv->FsSession()) );
+                    if (iMGXFileManager && err == KErrNone)
+                        {
+                        // construction completed succesfully
+                        iGalleryUpdaterInitialized = ETrue;
+                        }
+                    else
+                        {
+                        // out of memory or other unknown error?    
+                        iGalleryUpdaterDLL.Close();
+                        }
+                    }
+                else
+                    {
+                    // ordinal not found from the DLL 
+                    iGalleryUpdaterDLL.Close();
+                    }    
+                }
+            else
+                {
+                // DLL does not exist in the device
+                }
+            }
+
+        // update the file if gallery updater has been initialized
+        if (iGalleryUpdaterInitialized)
+            {
+            TRAPD(err, iMGXFileManager->UpdateL(aFullPath));
+            return err;    
+            }
+        else
+            {
+            // gallery updater not supported if initialization failed    
+            iGalleryUpdaterSupported = EFalse;
+            return KErrNotSupported;    
+            }            
+        }
+    else
+        {
+        return KErrNotSupported;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+
+/*************************************************************************************************/
+// a class to display an info message that the screen shot was saved to disk
+
+CSavedQuery::CSavedQuery() : CActive(EPriorityLow)
+    {
+	CActiveScheduler::Add(this);
+    }
+
+void CSavedQuery::ConstructL()
+    {
+    iGlobalConfirmationQuery = CAknGlobalConfirmationQuery::NewL();
+    }
+
+CSavedQuery* CSavedQuery::NewL()
+    {
+    CSavedQuery* self = new(ELeave) CSavedQuery();
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    CleanupStack::Pop(self);
+    return self;
+    }
+
+CSavedQuery::~CSavedQuery()
+    {
+    delete iGlobalConfirmationQuery;
+    }
+
+void CSavedQuery::DisplayL(const TDesC &aText, TBool aDisplayErrorNote)
+    {
+    if (!iVisible)
+        {
+        TRAPD(err, DisplayWithGraphicsL(aText, aDisplayErrorNote));
+        if (err != KErrNone)
+            {
+            DisplayWithoutGraphicsL(aText);
+            }
+        iVisible = ETrue;
+        SetActive();
+        }
+    }
+
+void CSavedQuery::DoCancel()
+    {
+    if (iGlobalConfirmationQuery)
+        {
+        iGlobalConfirmationQuery->CancelConfirmationQuery();
+        }
+    iVisible = EFalse;
+    }
+
+void CSavedQuery::RunL()
+    {
+    iVisible = EFalse;
+    }
+
+void CSavedQuery::DisplayWithGraphicsL(const TDesC &aText, TBool aDisplayErrorNote)
+    {
+    if (aDisplayErrorNote)
+        {
+        iGlobalConfirmationQuery->ShowConfirmationQueryL
+            (iStatus, aText, R_AVKON_SOFTKEYS_EMPTY, R_QGN_NOTE_ERROR_ANIM,
+            KNullDesC, 0, 0, CAknQueryDialog::EErrorTone, ETrue);
+        }
+    else
+        {
+        iGlobalConfirmationQuery->ShowConfirmationQueryL
+            (iStatus, aText, R_AVKON_SOFTKEYS_EMPTY, R_QGN_NOTE_OK_ANIM,
+            KNullDesC, 0, 0, CAknQueryDialog::EConfirmationTone, ETrue);
+        }
+    }
+
+void CSavedQuery::DisplayWithoutGraphicsL(const TDesC &aText)
+    {
+	iGlobalConfirmationQuery->ShowConfirmationQueryL
+        (iStatus, aText, R_AVKON_SOFTKEYS_OK_EMPTY);
+    }
+
+/*************************************************************************************************/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/src/SGSettingListContainer.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,318 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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 "SGSettingListContainer.h"
+#include <screengrabber.rsg>
+#include "SG.hrh"
+#include "SGDocument.h"
+
+
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT
+  #include <CAknMemorySelectionSettingItemMultiDrive.h>
+#else
+  #include <CAknMemorySelectionSettingItem.h>
+#endif
+
+#include <eikappui.h>
+#include <akntitle.h>
+#include <eikspane.h> 
+
+#include <AknDef.h>
+
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListContainer::ConstructL(const TRect& aRect)
+// EPOC two phased constructor
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListContainer::ConstructL(const TRect& aRect)
+    {
+    CreateWindowL();
+    
+    // set title of the app
+    CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane();
+    CAknTitlePane* title = static_cast<CAknTitlePane*>( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+    title->SetTextL( _L("Settings") );
+
+    // get an instance of the engine
+    iModel = static_cast<CScreenGrabberDocument*>(reinterpret_cast<CEikAppUi*>(iEikonEnv->AppUi())->Document())->Model();
+
+    // get the settings from the engine
+    iGrabSettings = iModel->GrabSettings();
+
+    // construct the settings list from resources
+    ConstructFromResourceL(R_SCREENGRABBER_SETTINGLIST);
+    
+    // set visibilities
+    SetVisibilitiesOfSettingItems();
+
+    // set correct drawing area for the listbox
+    SetRect(aRect);
+    HandleResourceChange(KEikDynamicLayoutVariantSwitch);
+
+    ActivateL();
+    }
+
+
+// Destructor
+CScreenGrabberSettingListContainer::~CScreenGrabberSettingListContainer()
+    {
+    }
+
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::CreateSettingItemL( TInt aIdentifier )
+// ---------------------------------------------------------
+//
+CAknSettingItem* CScreenGrabberSettingListContainer::CreateSettingItemL( TInt aIdentifier )
+    {
+    CAknSettingItem* settingItem = NULL;
+
+    switch (aIdentifier)
+        {
+        case ESettingListCaptureModeSelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier, iGrabSettings.iCaptureMode);
+            break;
+      
+            
+        case ESettingListSingleCaptureHotkeySelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier, iGrabSettings.iSingleCaptureHotkey);
+            break;
+        
+        case ESettingListSingleCaptureImageFormatSelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier, iGrabSettings.iSingleCaptureImageFormat);
+            break;
+        
+        case ESettingListSingleCaptureMemorySelection:
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT
+            settingItem = new(ELeave) CAknMemorySelectionSettingItemMultiDrive(aIdentifier, iGrabSettings.iSingleCaptureMemoryInUseMultiDrive);
+#else
+            settingItem = new(ELeave) CAknMemorySelectionSettingItem(aIdentifier, iGrabSettings.iSingleCaptureMemoryInUse);
+#endif
+            break;
+
+        case ESettingListSingleCaptureFileNameSelection:
+            settingItem = new(ELeave) CAknTextSettingItem(aIdentifier, iGrabSettings.iSingleCaptureFileName);
+            break;
+
+
+        case ESettingListSequantialCaptureHotkeySelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier, iGrabSettings.iSequantialCaptureHotkey);
+            break;
+        
+        case ESettingListSequantialCaptureImageFormatSelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier, iGrabSettings.iSequantialCaptureImageFormat);
+            break;
+
+        case ESettingListSequantialCaptureDelaySelection:
+            settingItem = new(ELeave) CAknIntegerEdwinSettingItem(aIdentifier, iGrabSettings.iSequantialCaptureDelay);
+            break;
+                    
+        case ESettingListSequantialCaptureMemorySelection:
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT
+            settingItem = new(ELeave) CAknMemorySelectionSettingItemMultiDrive(aIdentifier, iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive);
+#else
+            settingItem = new(ELeave) CAknMemorySelectionSettingItem(aIdentifier, iGrabSettings.iSequantialCaptureMemoryInUse);
+#endif
+            break;
+
+        case ESettingListSequantialCaptureFileNameSelection:
+            settingItem = new(ELeave) CAknTextSettingItem(aIdentifier, iGrabSettings.iSequantialCaptureFileName);
+            break;
+
+
+        case ESettingListVideoCaptureHotkeySelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier, iGrabSettings.iVideoCaptureHotkey);
+            break;
+        
+        case ESettingListVideoCaptureVideoFormatSelection:
+            settingItem = new(ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier, iGrabSettings.iVideoCaptureVideoFormat);
+            break;
+        
+        case ESettingListVideoCaptureMemorySelection:
+#ifdef SCREENGRABBER_MULTIDRIVE_SUPPORT
+            settingItem = new(ELeave) CAknMemorySelectionSettingItemMultiDrive(aIdentifier, iGrabSettings.iVideoCaptureMemoryInUseMultiDrive);
+#else
+            settingItem = new(ELeave) CAknMemorySelectionSettingItem(aIdentifier, iGrabSettings.iVideoCaptureMemoryInUse);
+#endif
+            break;
+
+        case ESettingListVideoCaptureFileNameSelection:
+            settingItem = new(ELeave) CAknTextSettingItem(aIdentifier, iGrabSettings.iVideoCaptureFileName);
+            break;
+
+        }
+
+    return settingItem;
+    }
+
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::UpdateSettings()
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListContainer::UpdateSettingsL()
+    {
+    // get the modified settings to our own variables
+    StoreSettingsL();  // from CAknSettingItemList
+
+    // store new settings in engine and save the settings in disk
+    TRAP_IGNORE(iModel->SaveSettingsL(iGrabSettings));
+    
+    // Change the keys used for capturing
+    iModel->ActivateCaptureKeysL(ETrue);
+    }
+
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType)
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEventType)
+    {
+    switch (aEventType) 
+        {
+        case EEventEnterKeyPressed:
+        case EEventItemDoubleClicked:
+            ShowSettingPageL(EFalse);
+            break;
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::ShowSettingPageL(TInt aCalledFromMenu)
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListContainer::ShowSettingPageL(TInt aCalledFromMenu) 
+    {
+    // open the setting page
+    TInt listIndex = ListBox()->CurrentItemIndex();
+    TInt realIndex = SettingItemArray()->ItemIndexFromVisibleIndex(listIndex);
+    EditItemL(realIndex, aCalledFromMenu);
+
+    // update and save the settings
+    UpdateSettingsL();
+    
+    // set visibilities
+    SetVisibilitiesOfSettingItems();
+
+    // refresh the screen 
+    DrawNow();
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListContainer::SetVisibilitiesOfSettingItems()
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListContainer::SetVisibilitiesOfSettingItems() 
+    {
+
+    switch (iGrabSettings.iCaptureMode)
+        {
+        case ECaptureModeSingleCapture:
+            {
+            ((*SettingItemArray())[ESettingListSingleCaptureHotkeySelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListSingleCaptureImageFormatSelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListSingleCaptureMemorySelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListSingleCaptureFileNameSelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListSequantialCaptureHotkeySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureImageFormatSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureDelaySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureMemorySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureFileNameSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListVideoCaptureHotkeySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListVideoCaptureVideoFormatSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListVideoCaptureMemorySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListVideoCaptureFileNameSelection])->SetHidden(ETrue);
+            }
+            break;
+        
+        case ECaptureModeSequantialCapture:
+            {
+            ((*SettingItemArray())[ESettingListSingleCaptureHotkeySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSingleCaptureImageFormatSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSingleCaptureMemorySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSingleCaptureFileNameSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureHotkeySelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListSequantialCaptureImageFormatSelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListSequantialCaptureDelaySelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListSequantialCaptureMemorySelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListSequantialCaptureFileNameSelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListVideoCaptureHotkeySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListVideoCaptureVideoFormatSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListVideoCaptureMemorySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListVideoCaptureFileNameSelection])->SetHidden(ETrue);
+            }
+            break;            
+
+        case ECaptureModeVideoCapture:
+            {
+            ((*SettingItemArray())[ESettingListSingleCaptureHotkeySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSingleCaptureImageFormatSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSingleCaptureMemorySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSingleCaptureFileNameSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureHotkeySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureImageFormatSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureDelaySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureMemorySelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListSequantialCaptureFileNameSelection])->SetHidden(ETrue);
+            ((*SettingItemArray())[ESettingListVideoCaptureHotkeySelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListVideoCaptureVideoFormatSelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListVideoCaptureMemorySelection])->SetHidden(EFalse);
+            ((*SettingItemArray())[ESettingListVideoCaptureFileNameSelection])->SetHidden(EFalse);
+            }
+            break;             
+
+        default:
+            User::Panic(_L("Inv.capt.mode"), 50);
+            break;
+        }
+        
+    HandleChangeInItemArrayOrVisibilityL(); 
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::HandleResourceChange(TInt aType)
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListContainer::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);
+        ListBox()->SetRect(outputRect);
+        }
+    else
+        {
+        CCoeControl::HandleResourceChange(aType);
+        }
+    }
+
+// End of File  
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/screengrabber/src/SGSettingListView.cpp	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,155 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this 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  <screengrabber.rsg>
+#include  "SGSettingListView.h"
+#include  "SGSettingListContainer.h"
+#include  "SGMainView.h"
+#include  "SG.hrh"
+ 
+
+// ================= MEMBER FUNCTIONS =======================
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::ConstructL(const TRect& aRect)
+// EPOC two-phased constructor
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListView::ConstructL()
+    {
+    BaseConstructL( R_SCREENGRABBER_VIEW2 );
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::~CScreenGrabberSettingListView()
+// ?implementation_description
+// ---------------------------------------------------------
+//
+CScreenGrabberSettingListView::~CScreenGrabberSettingListView()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        }
+
+    delete iContainer;
+    }
+
+// ---------------------------------------------------------
+// TUid CScreenGrabberSettingListView::Id()
+// ?implementation_description
+// ---------------------------------------------------------
+//
+TUid CScreenGrabberSettingListView::Id() const
+    {
+    return KSettingListViewUID;
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::HandleCommandL(TInt aCommand)
+// ?implementation_description
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListView::HandleCommandL(TInt aCommand)
+    {   
+    switch ( aCommand )
+        {
+        case EScreenGrabberCmdSettingsExit:
+            {
+            // exit the application
+            AppUi()->HandleCommandL( EAknCmdExit );
+
+            break;
+            }
+
+        case EScreenGrabberCmdSettingsBack:
+            {
+            // switch back to the main view
+            AppUi()->ActivateLocalViewL( KMainViewUID );
+
+            break;
+            }
+
+        case EScreenGrabberCmdSettingsChange:
+            {
+            // show the setting page
+            iContainer->ShowSettingPageL(ETrue);
+
+            break;
+            }
+
+        default:
+            {
+            AppUi()->HandleCommandL( aCommand );
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::HandleClientRectChange()
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListView::HandleClientRectChange()
+    {
+    if ( iContainer )
+        {
+        iContainer->SetRect( ClientRect() );
+        }
+    }
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::DoActivateL(...)
+// ?implementation_description
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListView::DoActivateL(
+   const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
+   const TDesC8& /*aCustomMessage*/)
+    {
+    if (!iContainer)
+        {
+        iContainer = new (ELeave) CScreenGrabberSettingListContainer;
+        iContainer->SetMopParent(this);
+        iContainer->ConstructL( ClientRect() );
+        AppUi()->AddToStackL( *this, iContainer );
+        }
+   }
+
+// ---------------------------------------------------------
+// CScreenGrabberSettingListView::HandleCommandL(TInt aCommand)
+// ?implementation_description
+// ---------------------------------------------------------
+//
+void CScreenGrabberSettingListView::DoDeactivate()
+    {
+    if ( iContainer )
+        {
+        AppUi()->RemoveFromViewStack( *this, iContainer );
+        }
+    
+    delete iContainer;
+    iContainer = NULL;
+    }
+
+// End of File
+
--- a/screengrabber/src/application.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* 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 "application.h"
-#include "enginewrapper.h"
-
-#define KEY_CAPTURE_PRIORITY 100
-
-SGApplication::SGApplication(int argc, char *argv[])  
-    : HbApplication(argc, argv) 
-     {
-	 
-	
-     }
-
-	 
-SGApplication::~SGApplication()  
-{
-		
-}	
-	 
-// ---------------------------------------------------------------------------
-
-#if defined(Q_WS_S60)
-#if defined(HB_QT_S60_EVENT_FILTER)
-bool SGApplication::s60EventFilter(TWsEvent *aEvent)
-#else
-bool SGApplication::symbianEventFilter(const QSymbianEvent *aEvent)
-#endif // (HB_QT_S60_EVENT_FILTER)
-{
-    // pass event to engine, if engine returns true(event was not handled),
-    // forward it.
-    if(!iEngine->handleCaptureCommands(aEvent)) 
-        {
-        return false;
-        }
-    else
-        {
-#if defined(HB_QT_S60_EVENT_FILTER)
-        return HbApplication::s60EventFilter(aEvent);
-#else
-		return HbApplication::symbianEventFilter(aEvent);
-#endif		
-        }
-    
-    }
-#endif
-
-// ---------------------------------------------------------------------------
--- a/screengrabber/src/enginewrapper.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-/*
-* 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 <apgtask.h>
-#include <hbdeviceprogressdialog.h>
-#include "enginewrapper.h"
-
-#include "settingsview.h"
-#include "sgengine.h"
-#include "mainview.h"
-#include "notifications.h"
-
-
-// ---------------------------------------------------------------------------
-
-EngineWrapper::EngineWrapper()
-: iSGEngine(0), iProgressNote(0)
-{
-}
-
-// ---------------------------------------------------------------------------
-
-EngineWrapper::~EngineWrapper()
-{
-    if (iSGEngine) {
-        iSGEngine->DeActivateModelL();
-        delete iSGEngine;
-    }
-    if(iProgressNote){
-        delete iProgressNote;
-    }
-}
-
-// ---------------------------------------------------------------------------
-
-bool EngineWrapper::init()
-{
-    TRAPD(error, iSGEngine = SGEngine::NewL(this));
-	
-    
-    if (error == KErrNone) {
-        TRAP(error, iSGEngine->ActivateModelL());
-    }
-    
-    if (error != KErrNone) {
-        return false;
-    }
-    else {
-        return true;
-    }
-	
-}
-
-// ---------------------------------------------------------------------------
-
-GrabSettings EngineWrapper::getGrabSettings()
-{
-    TGrabSettings tSettings = iSGEngine->GrabSettings();
-    GrabSettings settings;
-    
-    // Convert TGrabSettings to GrabSettings
-    settings.mCaptureMode = tSettings.iCaptureMode;
-    
-    // Single image settings
-    settings.mSingleCaptureHotkey = tSettings.iSingleCaptureHotkey;
-    settings.mSingleCaptureImageFormat = tSettings.iSingleCaptureImageFormat;
-	settings.mSingleCaptureMemoryInUseMultiDrive = tSettings.iSingleCaptureMemoryInUseMultiDrive;
-    settings.mSingleCaptureFileName = QString((QChar*)tSettings.iSingleCaptureFileName.Ptr(),tSettings.iSingleCaptureFileName.Length());
-    
-    //Seguantial image settings
-    settings.mSequantialCaptureDelay = tSettings.iSequantialCaptureDelay;
-    settings.mSequantialCaptureHotkey = tSettings.iSequantialCaptureHotkey;
-    settings.mSequantialCaptureImageFormat = tSettings.iSequantialCaptureImageFormat;
-	settings.mSequantialCaptureMemoryInUseMultiDrive = tSettings.iSequantialCaptureMemoryInUseMultiDrive;
-    settings.mSequantialCaptureDelay = tSettings.iSequantialCaptureDelay;
-    //convert TFilename to QString
-    settings.mSequantialCaptureFileName = QString((QChar*)tSettings.iSequantialCaptureFileName.Ptr(),tSettings.iSequantialCaptureFileName.Length());
-    
-    
-    // Video settings
-    settings.mVideoCaptureHotkey = tSettings.iVideoCaptureHotkey;
-    settings.mVideoCaptureVideoFormat = tSettings.iVideoCaptureVideoFormat;
-	settings.mVideoCaptureMemoryInUseMultiDrive = tSettings.iVideoCaptureMemoryInUseMultiDrive;
-    //convert TFilename to QString
-    settings.mVideoCaptureFileName = QString((QChar*)tSettings.iVideoCaptureFileName.Ptr(),tSettings.iVideoCaptureFileName.Length());
-    
-    return settings;
-}
-
-// ---------------------------------------------------------------------------
-
-bool EngineWrapper::saveSettings(const GrabSettings& settings)
-{
-    TGrabSettings tSettings;
-    // Convert GrabSettings to TGrabSettings
-    tSettings.iCaptureMode = settings.mCaptureMode;
-    
-    tSettings.iSingleCaptureHotkey = settings.mSingleCaptureHotkey;
-    tSettings.iSingleCaptureImageFormat = settings.mSingleCaptureImageFormat;
-    tSettings.iSingleCaptureMemoryInUseMultiDrive = settings.mSingleCaptureMemoryInUseMultiDrive;
-    //convert TFilename to QString
-    tSettings.iSingleCaptureFileName = TFileName(settings.mSingleCaptureFileName.utf16());
-    tSettings.iSequantialCaptureDelay = settings.mSequantialCaptureDelay;
-    tSettings.iSequantialCaptureHotkey = settings.mSequantialCaptureHotkey;
-    tSettings.iSequantialCaptureImageFormat = settings.mSequantialCaptureImageFormat;
-    tSettings.iSequantialCaptureMemoryInUseMultiDrive = settings.mSequantialCaptureMemoryInUseMultiDrive; 
-    tSettings.iSequantialCaptureDelay = settings.mSequantialCaptureDelay;
-    //convert TFilename to QString
-    tSettings.iSequantialCaptureFileName = TFileName(settings.mSequantialCaptureFileName.utf16());
-    
-    tSettings.iVideoCaptureHotkey = settings.mVideoCaptureHotkey;
-    tSettings.iVideoCaptureVideoFormat = settings.mVideoCaptureVideoFormat;
-    tSettings.iVideoCaptureMemoryInUseMultiDrive = settings.mVideoCaptureMemoryInUseMultiDrive; 
-    //convert TFilename to QString
-    tSettings.iVideoCaptureFileName = TFileName(settings.mVideoCaptureFileName.utf16());
-    TRAPD(error, iSGEngine->SaveSettingsL(tSettings));
-    
-    if (error == KErrNone) {
-        TRAP(error, iSGEngine->ActivateCaptureKeysL(true));
-    }
-    
-    if (error == KErrNone) {
-        return true;
-    }
-    else {
-        return false;
-    }
-    
-    
-}
-
-// ---------------------------------------------------------------------------
-
-
-void EngineWrapper::ShowImageCapturedNote()
-{
-    Notifications::imageCaptured();
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::ShowErrorMessage(const TDesC16& aErrorMessage)
-{
-    QString errorMessage((QChar*)aErrorMessage.Ptr(),aErrorMessage.Length());
-    Notifications::error(errorMessage);
- 
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::sendUIToBackground()
-{
-    CCoeEnv* coeEnv = CCoeEnv::Static();
-    TApaTask selfTask(coeEnv->WsSession());
-    selfTask.SetWgId(coeEnv->RootWin().Identifier());
-    selfTask.SendToBackground();
-}
-
-// ---------------------------------------------------------------------------
-
-
-#if defined(HB_QT_S60_EVENT_FILTER)
-bool EngineWrapper::handleCaptureCommands(const TWsEvent* aEvent)
-#else
-bool EngineWrapper::handleCaptureCommands(const QSymbianEvent *aEvent)
-#endif
-{
-    TBool retVal = ETrue;
-    TRAPD(errorCode, retVal = iSGEngine->HandleCaptureCommandsL(aEvent));
-    if (errorCode != KErrNone) {
-        Notifications::error("Error occured when capturing screen.");
-    }
-    
-    return convertTBoolToBool(retVal);
-    
-}
-
-// ---------------------------------------------------------------------------
-
-bool EngineWrapper::convertTBoolToBool(TBool value)
-{
-    if (value) {
-        return true;
-    }
-    else {
-        return false;
-    }
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::ShowSequantialImagesCapturedNote(TInt amount)
-{
-    Notifications::sequantialImagesCaptured(amount);
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::ShowVideoCapturedNote()
-{
-    Notifications::videoCaptured();
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::ShowProgressBar(int max)
-{
-    iProgressNote = Notifications::showProgressBar(max);
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::IncrementProgressbarValue()
-{
-    iProgressNote->setProgressValue(iProgressNote->progressValue() + 1);
-}
-
-// ---------------------------------------------------------------------------
-
-void EngineWrapper::CloseProgressbar()
-{
-    delete iProgressNote;
-    iProgressNote = 0;
-}
-
-void EngineWrapper::EnableRcpOfFoc(TBool aState)
-{
-    iSGEngine->EnableRcpOfFoc(aState);
-}
-
-void EngineWrapper::LoadSettings(void)
-{
-	iSGEngine->LoadSettingsL();
-}
-
-// ---------------------------------------------------------------------------
--- a/screengrabber/src/gifanimator.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,308 +0,0 @@
-/*
-* 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 "gifanimator.h"
-
-#include <s32file.h>
-#include <fbs.h>
-#include <gdi.h>
-#include <imageconversion.h>
-#include "enginewrapper.h"
-
-    
-// ---------------------------------------------------------------------------
-
-TInt CGifAnimator::CreateGifAnimation(const TDesC& aFileName, TSize aDimensions, CVideoFrameArray* aVideoFrameArray, EngineWrapper& aEngineWrapper)
-    {
-	CGifAnimator* self = new(ELeave) CGifAnimator;
-	CleanupStack::PushL(self);
-	TRAPD(err, self->StartL(aFileName, aDimensions, aVideoFrameArray, aEngineWrapper));
-	CleanupStack::PopAndDestroy();
-	return err;
-    }
-
-// ---------------------------------------------------------------------------
-
-CGifAnimator::CGifAnimator()   
-    {
-    }
-
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::StartL(const TDesC& aFileName, const TSize& aDimensions, CVideoFrameArray* aVideoFrameArray, EngineWrapper& aEngineWrapper)
-    {
-    
-    __ASSERT_ALWAYS(aFileName.Length() > 0, User::Panic(_L("GifAnim"), 100));
-    __ASSERT_ALWAYS(aDimensions.iHeight > 0, User::Panic(_L("GifAnim"), 101));
-    __ASSERT_ALWAYS(aDimensions.iWidth > 0, User::Panic(_L("GifAnim"), 102));
-    __ASSERT_ALWAYS(aVideoFrameArray != NULL, User::Panic(_L("GifAnim"), 103));
-    
-    
-    // show a progress dialog
-    aEngineWrapper.ShowProgressBar(aVideoFrameArray->Count()-1);
-    
-    // open the file for writing
-    User::LeaveIfError(iFs.Connect());
-    User::LeaveIfError(iOutFile.Replace(iFs, aFileName, EFileWrite));
-    
-    // write header
-    WriteHeaderL(aDimensions);
-    
-    // process each frame of the animation
-    for (TInt i=0; i<aVideoFrameArray->Count(); i++)
-        {
-        // write headers and raster block
-        TVideoFrame frame = aVideoFrameArray->At(i);
-        WriteGraphicControlL(frame);
-        CFbsBitmap* bitmap = GetBitmapLC(frame, aDimensions);
-        WriteImageDescriptorL(frame);
-        WriteRasterDataL(bitmap);
-        CleanupStack::PopAndDestroy(); //bitmap
-
-        // update the progress bar
-        aEngineWrapper.IncrementProgressbarValue();
-        }
-
-    // write footer and finish
-    WriteFooterL();
-    FinishL();
-    
-    // remove the progress dialog from the screen
-    aEngineWrapper.CloseProgressbar();
-    }    
-
-// ---------------------------------------------------------------------------
-
-CGifAnimator::~CGifAnimator()
-    {
-    
-    if (iImageEncoder)
-        delete iImageEncoder;
-    
-    if (iGIFImageData)
-        delete iGIFImageData;
-    
-    }
-
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::WriteHeaderL(const TSize& aDimensions)
-    {
-    WriteInt8L('G');
-    WriteInt8L('I');
-    WriteInt8L('F');
-    WriteInt8L('8');
-    WriteInt8L('9');
-    WriteInt8L('a');
-
-    WriteInt16L(aDimensions.iWidth);  // width of animation
-    WriteInt16L(aDimensions.iHeight); // height of animation
-    
-    // logical screen descriptor
-    TUint8 packedFlags = 0;
-	packedFlags |= 8 - 1; // size of colour table is number of bits in each color table minus one (bits 0-2)
-	packedFlags |= (8 - 1) << 4; // colour resolution ie maximum size of the original colour palette (bits 4-6)
-	packedFlags |= 0x80; // use global colour table (bit 7)
-    
-    WriteInt8L(packedFlags);
-    
-    WriteInt8L(TRANSPARENCY_INDEX); // background color index
-    
-    WriteInt8L(0); // pixel aspect ratio, 0=not used
-    
-    // write the Symbian default palette since that's what is used
-    CPalette* palette = CPalette::NewDefaultL(EColor256);
-    CleanupStack::PushL(palette);
-    
-    for (TInt i=0; i<palette->Entries(); i++)
-        {
-        TRgb entry = palette->GetEntry(i);
-
-        WriteInt8L(entry.Red());
-        WriteInt8L(entry.Green());
-        WriteInt8L(entry.Blue());
-        }
-    
-    CleanupStack::PopAndDestroy(); //palette
-    }
-
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::WriteGraphicControlL(const TVideoFrame& aFrame)
-    {
-    TInt packedFlags(0);
-    
-    // enable transparency if needed
-    if (aFrame.iEnableTransparency)
-        packedFlags |= 0x01; 
-
-    // set disposal method:
-    // 0 = disposal method not specified, 1 = do not dispose of graphic,
-    // 2 = overwrite graphic with background color, 3 = overwrite graphic with previous graphic
-    TInt disposalMethod = 1;
-    packedFlags |= ((disposalMethod << 2) & 0x1c);
-    
-    WriteInt8L(0x21); // GIF extension
-    WriteInt8L(0xf9); // GIF graphic control block
-    WriteInt8L(0x04); // block size
-    WriteInt8L(packedFlags); // packed
-    WriteInt16L(aFrame.iDelay); // delay
-    WriteInt8L(TRANSPARENCY_INDEX); // transparent color index
-    WriteInt8L(0); // block terminator, always 0
-    }
-
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::WriteImageDescriptorL(const TVideoFrame& aFrame)
-    {
-    WriteInt8L(0x2c); // GIF image descriptor
-    WriteInt16L(aFrame.iXPos);
-    WriteInt16L(aFrame.iYPos);
-    WriteInt16L(aFrame.iWidth);
-    WriteInt16L(aFrame.iHeight);
-    WriteInt8L(0); // packed flags, none specified in this case
-    }
-    
-// ---------------------------------------------------------------------------
-
-CFbsBitmap* CGifAnimator::GetBitmapLC(TVideoFrame& aFrame, const TSize& aDimensions)
-    {
-    CFbsBitmap* bitmap = new(ELeave) CFbsBitmap;
-    CleanupStack::PushL(bitmap);
-    
-    // read the bitmap from the temporary file
-    RFile bitmapFile;
-    User::LeaveIfError( bitmapFile.Open(iFs, aFrame.iFileStorePath, EFileRead) );
-    RFileReadStream readStream(bitmapFile);
-    bitmap->InternalizeL(readStream);
-    readStream.Close();
-    bitmapFile.Close();
-
-    // delete the temporary file since it's not needed anymore
-    iFs.Delete(aFrame.iFileStorePath);
-    
-    // resize the bitmap to match the video dimensions if it is a full screen one
-    if (aFrame.iFillsWholeScreen && (aFrame.iWidth != aDimensions.iWidth || aFrame.iHeight != aDimensions.iHeight))
-        {
-        if (bitmap->Resize(aDimensions) == KErrNone)
-            {
-            // also update dimensions of this frame to match the dimensions of the video            
-            aFrame.iWidth = aDimensions.iWidth;
-            aFrame.iHeight = aDimensions.iHeight;
-            }
-        }
-    
-    return bitmap;
-    }
-    
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::WriteRasterDataL(CFbsBitmap* aBitmap)
-    {
-    // reset the encoder
-    if (iImageEncoder)
-        {
-	    delete iImageEncoder;
-        iImageEncoder = NULL;
-        }
-    
-    // make sure the buffer for conversion is empty    
-    if (iGIFImageData)
-        {
-	    delete iGIFImageData;
-        iGIFImageData = NULL;
-        }        
-
-    
-    TRequestStatus Stat = KRequestPending;
-    
-    // init & convert the bitmap to GIF format
-    iImageEncoder = CImageEncoder::DataNewL(iGIFImageData, CImageEncoder::EOptionAlwaysThread, KImageTypeGIFUid);
-    iImageEncoder->Convert( &Stat, *aBitmap );
-    User::WaitForRequest(Stat);
-   
-   
-    // check any erros in converting 
-    User::LeaveIfError( Stat.Int() );
-    
-    // check if we have valid data
-    if (iGIFImageData == NULL || iGIFImageData->Des().Length()<793)
-        User::Leave(KErrNoMemory);
-    
-    // in GIF files generated by Symbian, the raster data always starts at offset 791,
-    // initial code size in GIF encoding should be 8 since we have a 8bpp image,
-    // also check that the second last byte is the terminator 0,
-    // if this check fails in newer releases of S60, proper parsing of GIF format is probably needed
-    TUint8* imagePtr = &iGIFImageData->Des()[0];
-    if (imagePtr[791] != 8 || imagePtr[iGIFImageData->Des().Length()-2] != 0)
-        User::Leave(KErrNotSupported);
-    
-    // write the raster data block to the file
-    TUint writeLength = iGIFImageData->Des().Length() - 1 - 791;
-    imagePtr+=791;
-    TPtr8 writePtr(imagePtr, writeLength, writeLength);
-    User::LeaveIfError( iOutFile.Write(writePtr) );
-    }
-
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::WriteFooterL()
-    {
-    WriteInt8L(0x3b); // GIF trailer
-    }
-    
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::FinishL()
-    {
-    iOutFile.Close();
-    iFs.Close();
-    }
-
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::WriteInt8L(TInt aValue)
-    {
-    HBufC8* buf = HBufC8::NewMaxLC(1);
-
-    TUint8* ptr = &buf->Des()[0];
-    ptr[0] = TUint8(aValue);
-    
-    User::LeaveIfError( iOutFile.Write(buf->Des()) );
-    
-    CleanupStack::PopAndDestroy(); // buf
-    }
-
-// ---------------------------------------------------------------------------
-
-void CGifAnimator::WriteInt16L(TInt aValue)
-    {
-    HBufC8* buf = HBufC8::NewMaxLC(2);
-
-    TUint8* ptr = &buf->Des()[0];
-    ptr[0] = TUint8(aValue);
-    ptr[1] = TUint8(aValue>>8);
-        
-    User::LeaveIfError( iOutFile.Write(buf->Des()) );
-    
-    CleanupStack::PopAndDestroy(); // buf
-    }
-
-// ---------------------------------------------------------------------------
-
--- a/screengrabber/src/main.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
-* 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 <QtGui/QMessageBox>
-
-#include <hbmainwindow.h>
-#include <hbview.h>
-#include <hbmessagebox.h>
-#include <coecntrl.h>
-
-#include "mainview.h"
-#include "application.h"
-#include "enginewrapper.h"
-#include "settingsview.h"
-
-
-
-int main(int argc, char *argv[])
-{
-    
-    SGApplication app(argc, argv);
-	
-    EngineWrapper engineWrapper;
-	app.SetEngineWrapper(&engineWrapper);
-    if (!engineWrapper.init()) {
-      return EXIT_FAILURE;
-    }
-
-	
-	
-    HbMainWindow mainWindow;
-    
-    //Create main view
-    MainView* view = new MainView(mainWindow, engineWrapper);
-    //initialize main view
-    view->init(app);
-
-	
-    SettingsView* settingsView = new SettingsView(*view, mainWindow, engineWrapper);
-	
-	view->setSettingsView(settingsView);
-    
-	// Add Views to main window and reveal it.
-    mainWindow.addView(view);
-    mainWindow.addView(settingsView);
-
-    
-    mainWindow.show();
-     
-    int result = app.exec();
-   
-    return result;
-}
-
--- a/screengrabber/src/mainview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-/*
-* 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 <hbmessagebox.h>
-#include <qgraphicslinearlayout.h>
-#include "enginewrapper.h"
-#include "settingsview.h"
-#include "mainview.h"
-#include "notifications.h"
-#include "hbtoolbar.h"
-
-// ---------------------------------------------------------------------------
-
-MainView::MainView(HbMainWindow &mainWindow, EngineWrapper &engineWrapper):
-    mMainWindow(mainWindow),
-    mSettingsView(0),
-    mEngineWrapper(engineWrapper)
-{
-}
-
-// ---------------------------------------------------------------------------
-
-MainView::~MainView()
-{
-}
-
-// ---------------------------------------------------------------------------
-
-void MainView::init(HbApplication &app)
-{
-    this->setTitle("Screen Grabber");
-    createMenu(app);
-    createInfoText();
-    createToolbar();
-
-}
-
-void MainView::createMenu(HbApplication& app)
-{
-    
-    HbMenu* menu = this->menu();
-   
-    if (menu != NULL) {
-    
-        actionSendToBg = menu->addAction("Send to background");
-        connect(actionSendToBg, SIGNAL( triggered() ), this, SLOT( sendToBackground() ) );
-        
-        actionSettings = menu->addAction("Settings");
-        connect(actionSettings, SIGNAL( triggered() ), this, SLOT( showSettings() ) );
-    
-        actionAbout = menu->addAction("About");
-        connect(actionAbout, SIGNAL( triggered() ), this, SLOT( showAboutPopup() ) );
-    
-        actionExit = menu->addAction("Exit");
-        connect(actionExit, SIGNAL(triggered()), this, SLOT( my_quit() ) );
-
-		HbAction *mDefaultNavigationAction = new HbAction(Hb::QuitNaviAction, this);
-		connect(mDefaultNavigationAction,SIGNAL(triggered()), this, SLOT(my_quit()));
-		setNavigationAction(mDefaultNavigationAction);
-        
-    	//setNavigationAction(actionExit);
-    }
-}
-
-
-void MainView::quitYesNoQuestionClosed(HbAction* action)
-    {
-    HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
-    if(action == dlg->primaryAction())
-        {
-        qApp->quit(); 
-        }
-    }
-
-void MainView::my_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)
-        );
-	}
-
-// ---------------------------------------------------------------------------
-
-void MainView::createInfoText()
-{
-    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical, this);
-    if (layout != NULL) {
-        HbTextEdit* edit = new HbTextEdit(this);
-        if(edit != NULL) {
-            edit->setPlainText("Please use the settings screen to define the "
-                               "capture mode and any other related settings "
-                               "such as capture hotkey and saving format. "
-                               "Using the PNG format for screen shots is "
-                               "recommended, since it is compressed but "
-                               "lossless. The captures can be managed with "
-                               "the Media Gallery application.\n\nYou may "
-                               "start taking screenshots or capturing video "
-                               "now. Please press the Applications key to go back "
-                               "to the Application menu or send this application "
-                               "to the background via the Options menu. To be "
-                               "able to take screenshots or capture video, this "
-                               "application needs to stay running in the "
-                               "background.");
-            edit->setReadOnly(true);
-            //TODO edit->setCursorHidden(true);
-            //TODO edit->setAttribute(Qt::WA_InputMethodEnabled, false);
-            layout->addItem(edit);
-            layout->setContentsMargins(5, 5, 5, 5);
-            this->setLayout(layout);
-        }
-        
-    }
-    
-}
-
-// ---------------------------------------------------------------------------
-
-void MainView::showSettings()
-{
-    mEngineWrapper.EnableRcpOfFoc(ETrue);
-	mEngineWrapper.LoadSettings();	
-	mSettingsView->loadSettings();
-	mMainWindow.setCurrentView(mSettingsView);
-}
-
-// ---------------------------------------------------------------------------
-
-void MainView::createToolbar()
-{
-    HbToolBar *toolbar = new HbToolBar(this); // main view takes the ownership
-    toolbar->addAction(actionSettings);
-    toolbar->addAction(actionSendToBg);
-    setToolBar(toolbar);
-}
-
-// ---------------------------------------------------------------------------
-
-void MainView::showAboutPopup()
-{
-    Notifications::about();
-}
-
-// ---------------------------------------------------------------------------
-
-void MainView::sendToBackground()
-    {
-    mEngineWrapper.sendUIToBackground();
-    }
-
-
--- a/screengrabber/src/notifications.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
-* 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 <hbdevicemessagebox.h>
-#include <hblabel.h>
-#include <hbdeviceprogressdialog.h>
-
-#include "notifications.h"
-
-
-
-// ---------------------------------------------------------------------------
-
-void Notifications::imageCaptured()
-{
-    HbDeviceMessageBox::information("Screen shot saved to Media Gallery");
-}
-
-// ---------------------------------------------------------------------------
-
-void Notifications::about()
-{
-    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)
-{
-    HbDeviceMessageBox::warning(errorMessage);
-
-}
-
-// ---------------------------------------------------------------------------
-
-void Notifications::sequantialImagesCaptured(int amount){
-    // Code below launches a global note
-    QString text;
-    text.setNum(amount, 10);
-    text.append(" screen shots saved to Media Gallery");
-    
-    HbDeviceMessageBox::information(text);
- 
-}
-
-// ---------------------------------------------------------------------------
-
-void Notifications::videoCaptured()
-{
-    HbDeviceMessageBox::information("Video saved to Media Gallery");
-
-}
-
-// ---------------------------------------------------------------------------
-
-HbDeviceProgressDialog* Notifications::showProgressBar(int max)
-{
-    HbDeviceProgressDialog *note = new HbDeviceProgressDialog(HbProgressDialog::ProgressDialog);
-    note->setText("Saving...");
-    note->setMaximum(max);
-    note->show();
-    return note;
-}
-
-// ---------------------------------------------------------------------------
--- a/screengrabber/src/settingsview.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,278 +0,0 @@
-/*
-* 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 <hbdataform.h>
-#include <hbdataformmodelitem.h>
-#include <hbdataformmodel.h>
-#include <hbdataformviewitem.h>
-#include <hbaction.h>
-#include <hbmenu.h>
-#include <hbtoolbar.h>
-#include <hbabstractviewitem.h>
-#include <hbaction.h>
-
-
-#include "settingsview.h"
-#include "enginewrapper.h"
-#include "sgengine.h"
-#include "hbslider.h"
-#include "notifications.h"
-
-
-
-// ---------------------------------------------------------------------------
-
-SettingsView::SettingsView(HbView &mainView, HbMainWindow &mainWindow, EngineWrapper &engineWrapper): 
-    mEngineWrapper(engineWrapper), 
-    mMainWindow(mainWindow), 
-    mMainView(mainView)
-{
-    // Set title and add this view to main window
-    setTitle("Settings");
-    
-    HbAction *actionSaveSettings = menu()->addAction(QString("Save & close"));
-    HbAction *actionCancel = menu()->addAction("Cancel & close");
-    
-    toolBar()->addAction(actionSaveSettings);
-    toolBar()->addAction(actionCancel);
-  
-    
-    //create setting form
-    mSettingForm = new HbDataForm();
-    
-    //create a model class
-    mModel = new HbDataFormModel(this);
-    
-    // DataFormItem for mode selection
-    mModeItem = mModel->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Capture mode"), 0);
-    mModeItem->setContentWidgetData(QString("items"), CAPTUREMODES);
-    
-    // Create setting model
-     createSingleCaptureComponents(mModel, 0);
-     createSequentialCaptureComponents(mModel, 0);
-     createVideoCaptureComponents(mModel, 0);
- 
-    // Set created model model to form
-    mSettingForm->setModel(mModel);
-    setWidget(mSettingForm);//takes ownership
-    
-    // Get view item of mode selection item
-    HbDataFormViewItem *viewItemVideoPage = static_cast<HbDataFormViewItem*>(mSettingForm->itemByIndex(mModel->indexFromItem(mModeItem)));
-
-    loadSettings();
-    
-    // Connect signals from item modifications and close with this form's slots
-    connect(actionSaveSettings, SIGNAL(triggered()), this, SLOT(saveAndClose()));
-    connect(actionCancel, SIGNAL(triggered()), this, SLOT(close()));
-	
-	HbAction *mDefaultNavigationAction = new HbAction(Hb::QuitNaviAction, this);
-	connect(mDefaultNavigationAction,SIGNAL(triggered()), this, SLOT(saveAndClose()));
-	setNavigationAction(mDefaultNavigationAction);
-	
-
-
-}
-
-
-// ---------------------------------------------------------------------------
-
-SettingsView::~SettingsView()
-{
-
-}
-
-// ---------------------------------------------------------------------------
-
-void SettingsView::loadSettings()
-{
-
-    // get settings from engine;
-    mSettings = mEngineWrapper.getGrabSettings();
-    
-    //Capture mode
-    mModeItem->setContentWidgetData("selected", mSettings.mCaptureMode);
-    
-    // Still image 
-    mImageHotKeyItem->setContentWidgetData("selected", mSettings.mSingleCaptureHotkey);
-    mImageFormatItem->setContentWidgetData("selected", mSettings.mSingleCaptureImageFormat);
-    mImageMemoryInUseItem->setContentWidgetData("selected", mSettings.mSingleCaptureMemoryInUseMultiDrive);
-    mImageFileNameItem->setContentWidgetData("text", mSettings.mSingleCaptureFileName);
-       
-    // Seguantial image components
-    mSequantialHotKeyItem->setContentWidgetData("selected", mSettings.mSequantialCaptureHotkey);
-    mSequantialFormatItem->setContentWidgetData("selected", mSettings.mSequantialCaptureImageFormat);
-    mSequantialDelayItem->setContentWidgetData("text", mSettings.mSequantialCaptureDelay);
-    mSequantialMemoryInUseItem->setContentWidgetData("selected", mSettings.mSequantialCaptureMemoryInUseMultiDrive);
-    mSequantialFileNameItem->setContentWidgetData("text", mSettings.mSequantialCaptureFileName);
-    
-    // Video capture components
-    mVideoHotKeyItem->setContentWidgetData("selected", mSettings.mVideoCaptureHotkey);
-    mVideoFormatItem->setContentWidgetData("selected", mSettings.mVideoCaptureVideoFormat);
-    mVideoMemoryInUseItem->setContentWidgetData("selected", mSettings.mVideoCaptureMemoryInUseMultiDrive);
-    mVideoFileNameItem->setContentWidgetData("text", mSettings.mVideoCaptureFileName);
-    
-	
-}
-
-// ---------------------------------------------------------------------------
-
-void SettingsView::createSingleCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent)
-{
-    
-    // Create Group for single image components
-    mGroupImageCapture = model->appendDataFormGroup(QString("Single image settings"), parent);
-
-    // DataFormItem for hotkey selection
-    mImageHotKeyItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Capture hotkey"), mGroupImageCapture);
-    mImageHotKeyItem->setContentWidgetData(QString("items"), KEYS);
-
-    // DataFormItem for image format selection
-    mImageFormatItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Image format"), mGroupImageCapture);
-    mImageFormatItem->setContentWidgetData(QString("items"), IMAGEFORMATS);
-    
-    // DataFormItem for memory in use selection
-    mImageMemoryInUseItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Memory in use"), mGroupImageCapture);
-    mImageMemoryInUseItem->setContentWidgetData(QString("items"), MEMORYMODES);
-    
-    // DataFormItem for file name
-    mImageFileNameItem = model->appendDataFormItem(
-            HbDataFormModelItem::TextItem, QString("File name"), mGroupImageCapture);
-    mImageFileNameItem->setContentWidgetData(QString("text"), QString("Shot"));
-    
-}
-
-// ---------------------------------------------------------------------------
-
-void SettingsView::createSequentialCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent)
-{
-    
-    
-    // Create Group for sequential image components
-    mGroupSeguantialCapture = model->appendDataFormGroup(QString("Sequential image settings"), parent);
-    
-    // DataFormItem for hotkey selection
-    mSequantialHotKeyItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Capture hotkey"), mGroupSeguantialCapture);
-    mSequantialHotKeyItem->setContentWidgetData(QString("items"), KEYS);
-    
-    // DataFormItem for image format selection
-    mSequantialFormatItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Image format"), mGroupSeguantialCapture);
-    mSequantialFormatItem->setContentWidgetData(QString("items"), IMAGEFORMATS);
-    
-    // DataFormItem for delay between images selection
-    mSequantialDelayItem = model->appendDataFormItem(
-            HbDataFormModelItem::TextItem, QString("Delay between two images(ms)"), mGroupSeguantialCapture);
-    mSequantialDelayItem->setContentWidgetData(QString("text"), QString("Shot"));
-    
-    // DataFormItem for memory selection
-    mSequantialMemoryInUseItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Memory in use"), mGroupSeguantialCapture);
-    mSequantialMemoryInUseItem->setContentWidgetData(QString("items"), MEMORYMODES);
-    
-    // DataFormItem for file name
-    mSequantialFileNameItem = model->appendDataFormItem(
-            HbDataFormModelItem::TextItem, QString("File name"), mGroupSeguantialCapture);
-    mSequantialFileNameItem->setContentWidgetData(QString("text"), QString("Shot"));
-    
-}
-
-// ---------------------------------------------------------------------------
-
-void SettingsView::createVideoCaptureComponents(HbDataFormModel *model, HbDataFormModelItem *parent)
-{
-
-    // Create Group for video capturing components
-    mGroupVideoCapture = model->appendDataFormGroup(QString("Video settings"), parent);
-    
-    // DataFormItem for hotkey selection
-    mVideoHotKeyItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Start/Stop hotkey"), mGroupVideoCapture);
-    mVideoHotKeyItem->setContentWidgetData(QString("items"), KEYS);
-    
-    // DataFormItem for video format selection
-    mVideoFormatItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Video format"), mGroupVideoCapture);
-    mVideoFormatItem->setContentWidgetData(QString("items"), VIDEOFORMATS);
-    
-    // DataFormItem for memory selection
-    mVideoMemoryInUseItem = model->appendDataFormItem(
-            HbDataFormModelItem::RadioButtonListItem, QString("Memory in use"), mGroupVideoCapture);
-    mVideoMemoryInUseItem->setContentWidgetData(QString("items"), MEMORYMODES);
-    
-    // DataFormItem for file name
-    mVideoFileNameItem = model->appendDataFormItem(
-            HbDataFormModelItem::TextItem, QString("File name"), mGroupVideoCapture);
-    mVideoFileNameItem->setContentWidgetData(QString("text"), QString("Video"));
-    
-}
-
-// ---------------------------------------------------------------------------
-
-void SettingsView::saveAndClose()
-{
-
-    readFormItems();
-    if (!mEngineWrapper.saveSettings(mSettings)) {
-        Notifications::error("Unable to save settings");
-    }    
-    
-    mEngineWrapper.EnableRcpOfFoc(EFalse);
-    mMainWindow.setCurrentView(&mMainView);
-	
-}
-
-// ---------------------------------------------------------------------------
-
-void SettingsView::readFormItems()
-{
-    
-    //TODO this does not work correctly with WK38 ( Text box items )
-
-    mSettings.mCaptureMode = mModeItem->contentWidgetData("selected").toInt();
-
-    mSettings.mSingleCaptureImageFormat = mImageFormatItem->contentWidgetData("selected").toInt();
-    mSettings.mSingleCaptureHotkey = mImageHotKeyItem->contentWidgetData("selected").toInt();
-    mSettings.mSingleCaptureMemoryInUseMultiDrive = mImageMemoryInUseItem->contentWidgetData("selected").toInt(); 
-    mSettings.mSingleCaptureFileName = mImageFileNameItem->contentWidgetData("text").toString();
-    
-    mSettings.mSequantialCaptureImageFormat = mSequantialFormatItem->contentWidgetData("selected").toInt();
-    mSettings.mSequantialCaptureHotkey = mSequantialHotKeyItem ->contentWidgetData("selected").toInt();
-    mSettings.mSequantialCaptureMemoryInUseMultiDrive = mSequantialMemoryInUseItem ->contentWidgetData("selected").toInt();
-    mSettings.mSequantialCaptureFileName = mSequantialFileNameItem->contentWidgetData("text").toString();
-    mSettings.mSequantialCaptureDelay = mSequantialDelayItem->contentWidgetData("text").toInt();
-    
-
-    mSettings.mVideoCaptureVideoFormat = mVideoFormatItem->contentWidgetData("selected").toInt();
-    mSettings.mVideoCaptureHotkey = mVideoHotKeyItem ->contentWidgetData("selected").toInt();
-    mSettings.mVideoCaptureMemoryInUseMultiDrive = mVideoMemoryInUseItem ->contentWidgetData("selected").toInt();
-    mSettings.mVideoCaptureFileName = mVideoFileNameItem ->contentWidgetData("text").toString();
-	
-   
-}
-
-// ---------------------------------------------------------------------------
-
-void SettingsView::close()
-{
-    mEngineWrapper.EnableRcpOfFoc(EFalse);
-    mMainWindow.setCurrentView(&mMainView);
-}
--- a/screengrabber/src/sgengine.cpp	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1483 +0,0 @@
-/*
-* 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 <s32file.h> 
-#include <bautils.h>
-#include <pathinfo.h>
-#include <apparc.h> 
-#include <imageconversion.h>
-#include <textresolver.h>
-#include <apgtask.h> 
-
-#include <hblabel.h>
-#include <hbmessagebox.h>
-
-#include "mainview.h"
-#include "sgengine.h"
-#include "enginewrapper.h"
-#include "gifanimator.h"
-
-
-#define SC_PRINTS
-
-    #ifdef SC_PRINTS
-     #define SC_DEBUG(a) RDebug::Print(a)
-     #define SC_DEBUG2(a,b) RDebug::Print(a,b)
-    #else
-     #define SC_DEBUG(a) 
-     #define SC_DEBUG2(a,b)
-    #endif
-
-
-
-
-_LIT(KDefaultImageFileName, "Shot");
-_LIT(KDefaultVideoFileName, "Video");
-
-#define HIGH_QUALITY_JPEG 97
-#define LOW_QUALITY_JPEG 60
-#define DEFAULT_SEQ_CAPTURE_DELAY_MS 5000   // 5.000 secs
-#define VIDEO_CAPTURE_DELAY 250             // 0.25 secs
-#define VIDEO_CAPTURE_MINIMUM_DELAY 200     // 0.20 secs
-const TInt KSettingsDrive = EDriveC;
-_LIT(KSettingsFileName, "screengrabber_settings.ini");
-_LIT(KScreenShotsSubDirectory, "Screen Shots\\");
-_LIT(KSGTemporaryDirectory, "\\system\\temp\\screengrabber\\");
-
-
-#define KEY_CAPTURE_PRIORITY 100            // do not change, this is for window server
-
-// ---------------------------------------------------------------------------
-
-SGEngine::SGEngine() : CActive(EPriorityStandard)
-    {
-    // No implementation required
-    }
-
-// ---------------------------------------------------------------------------
-
-SGEngine::~SGEngine()
-    {
- 
-    TRAP_IGNORE( CleanTemporaryFilesL() );
-
-
-    if (iFrameImageData)
-        delete iFrameImageData;
-
-    if (iPreviouslyCapturedBitmap)
-        delete iPreviouslyCapturedBitmap;
-
-    if (iImageEncoder)
-        delete iImageEncoder;
-     
-    delete iVideoFrameArray;
-
-    Cancel();
-    iTimer.Close();
-
-    iFileSession.Close(); 
-    
-    }
-
-// ---------------------------------------------------------------------------
-
-SGEngine* SGEngine::NewLC(EngineWrapper *aEngineWrapper)
-    {
-    SGEngine* self = new (ELeave) SGEngine();
-    CleanupStack::PushL(self);
-    self->ConstructL(aEngineWrapper);
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-SGEngine* SGEngine::NewL(EngineWrapper *aEngineWrapper)
-    {
-    SGEngine* self = SGEngine::NewLC(aEngineWrapper);
-    CleanupStack::Pop(); // self;
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::ConstructL(EngineWrapper *aEngineWrapper)
-    {
-
-    iEngineWrapper = aEngineWrapper;
-   
-    iHashKeyCapturingActivated = EFalse; // Check this
-   
-    User::LeaveIfError(iTimer.CreateLocal());
-
-    iVideoFrameArray = new(ELeave) CVideoFrameArray(10000);
-
-    iPreviouslyCapturedBitmap = new(ELeave) CFbsBitmap;
-
-    iCapturingInProgress = EFalse;
-    iStopCapturing = EFalse;
-    iNumberOfTakenShots = 0;
-    iCurrentFrameNumber = 0;
-    iHashKeyDown = EFalse;
-	
-
-	CActiveScheduler::Add(this);
-	User::LeaveIfError(iFileSession.Connect());  
-	
-	// create window group.
-    iRootWin = CEikonEnv::Static()->RootWin();
-	iRootWin.EnableReceiptOfFocus(EFalse);
-    
-    }
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::RunL(){
-
-
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- RunL begin"));
-    
-    switch (iState) 
-        {
-        // encoding of the image is now finished
-        case EEncodingImage: 
-            {
-            if (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture)
-                {
-                // single shot done
-                CapturingFinishedL( iStatus.Int() );
-                }
-
-            else if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
-                {
-                // increase the counter    
-                iNumberOfTakenShots++;
-                
-                // check if we can take more shots or just finish
-                if (!iStopCapturing && iStatus.Int()==KErrNone)
-                    {
-        
-                    // some delay before the next shot can be taken    
-                    iState = ESequenceDelay;
-                    
-                    // some checking that the value of delay is valid
-                    TInt delay(iGrabSettings.iSequantialCaptureDelay); //ms
-                    if (delay<0 && delay > 999999)
-                        delay = DEFAULT_SEQ_CAPTURE_DELAY_MS;
-                      
-                    iTimer.After(iStatus, delay*1000);
-                    SetActive();  
-                    }
-                else
-                    {
-                    // finished
-                    CapturingFinishedL( iStatus.Int() );
-                    }                       
-               }
-            else
-                User::Panic(_L("Wrong mode"), 32);            
-
-            break;
-            }
-
-        // delay finished, ready to take the next shot
-        case ESequenceDelay: 
-            {
-            TakeScreenShotAndSaveL();
-
-            break;
-            }
-            
-        // asked to cancel capturing    
-        case ECancelCapturing:
-            {
-            // finished
-            CapturingFinishedL( iStatus.Int() );
-
-            break;
-            }
-            
-        case ENextVideoFrame:
-            {
-            // increase the counter
-            iCurrentFrameNumber++;
-            
-            // check if we can take more frames or just finish
-            if (!iStopCapturing && iStatus.Int()==KErrNone)
-                {
-                // take next frame
-                CaptureFrameForVideoL();
-                }
-            else
-                {
-                // finished, save video
-                SaveVideoL( iStatus.Int() );
-                }               
-            }
-            break;
-
-        case ECancelVideoCapturing:
-            {
-            // finished, save video
-            SaveVideoL( iStatus.Int() );                
-            }
-            break;
-                                
-
-        default:
-            {
-            break;
-            }
-        }
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- RunL end"));
-    
-
-}
-
-
-void SGEngine::EnableRcpOfFoc(TBool aState)
-	{
-	iRootWin.EnableReceiptOfFocus(aState);
-	}
-
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::DoCancel(){
-    iTimer.Cancel();
-}
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::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 SGEngine::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 SGEngine::LoadSettingsL()
-    {
-	 
-    // set defaults
-    iGrabSettings.iCaptureMode = ECaptureModeSingleCapture;
-    
-    iGrabSettings.iSingleCaptureHotkey = EHotkeySendKey;
-    iGrabSettings.iSingleCaptureImageFormat = EImageFormatPNG;
-    iGrabSettings.iSingleCaptureMemoryInUseMultiDrive = EPhoneMemory;
-    iGrabSettings.iSingleCaptureFileName.Copy( KDefaultImageFileName );
-
-    iGrabSettings.iSequantialCaptureHotkey = EHotkeySendKey;
-    iGrabSettings.iSequantialCaptureImageFormat = EImageFormatPNG;
-    iGrabSettings.iSequantialCaptureDelay = DEFAULT_SEQ_CAPTURE_DELAY_MS;
-    iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive = EPhoneMemory;
-    iGrabSettings.iSequantialCaptureFileName.Copy( KDefaultImageFileName );
-
-    iGrabSettings.iVideoCaptureHotkey = EHotkeySendKey;
-    iGrabSettings.iVideoCaptureVideoFormat = EVideoFormatAnimatedGIF;
-    iGrabSettings.iVideoCaptureMemoryInUseMultiDrive = EPhoneMemory;    
-    iGrabSettings.iVideoCaptureFileName.Copy( KDefaultVideoFileName );
-       
-        
-    // make sure that the private path of this app in c-drive exists
-    
-	iFileSession.CreatePrivatePath( KSettingsDrive ); // c:\\private\\101fb751\\
-    
-    // handle settings always in the private directory 
-    
-	if (iFileSession.SetSessionToPrivate( KSettingsDrive ) == KErrNone)
-        {
-        // open or create a dictionary file store
-        CDictionaryFileStore* settingsStore = CDictionaryFileStore::OpenLC(iFileSession, KSettingsFileName, KUidScreenGrabber);
-
-        LoadDFSValueL(settingsStore, KSGSettingCaptureMode,                             iGrabSettings.iCaptureMode);
-        
-        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureHotkey,                     iGrabSettings.iSingleCaptureHotkey);
-        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureImageFormat,                iGrabSettings.iSingleCaptureImageFormat);
-        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureMemoryInUseMultiDrive,      iGrabSettings.iSingleCaptureMemoryInUseMultiDrive);
-        LoadDFSValueL(settingsStore, KSGSettingSingleCaptureFileName,                   iGrabSettings.iSingleCaptureFileName);
-        
-        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureHotkey,                 iGrabSettings.iSequantialCaptureHotkey);
-        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureImageFormat,            iGrabSettings.iSequantialCaptureImageFormat);
-        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureDelay,                  iGrabSettings.iSequantialCaptureDelay);
-        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureMemoryInUseMultiDrive,  iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive);
-        LoadDFSValueL(settingsStore, KSGSettingSequantialCaptureFileName,               iGrabSettings.iSequantialCaptureFileName);
-
-        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureHotkey,                      iGrabSettings.iVideoCaptureHotkey);
-        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureVideoFormat,                 iGrabSettings.iVideoCaptureVideoFormat);
-        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureMemoryInUseMultiDrive,       iGrabSettings.iVideoCaptureMemoryInUseMultiDrive);
-        LoadDFSValueL(settingsStore, KSGSettingVideoCaptureFileName,                    iGrabSettings.iVideoCaptureFileName);
-
-        CleanupStack::PopAndDestroy(); // settingsStore         
-        }
-//chesk if all settings are in range - for safety reason, not to set some controls out of range - it causes the crash
-	if (!(iGrabSettings.iCaptureMode >= ECaptureModeSingleCapture && iGrabSettings.iCaptureMode <= ECaptureModeVideoCapture))
-	    { //give it default value
-        iGrabSettings.iCaptureMode = ECaptureModeSingleCapture;
-	    }
-	if (!(iGrabSettings.iSingleCaptureHotkey >= EHotkeySendKey && iGrabSettings.iSingleCaptureHotkey <= EHotkeyCameraKey1))
-	    {
-        iGrabSettings.iSingleCaptureHotkey = EHotkeySendKey;
-	    }
-	if (!(iGrabSettings.iSingleCaptureImageFormat >= EImageFormatPNG && iGrabSettings.iSingleCaptureImageFormat <= EImageFormatGIF))
-	    {
-        iGrabSettings.iSingleCaptureImageFormat = EImageFormatPNG;
-	    }
-	if (!(iGrabSettings.iSingleCaptureMemoryInUseMultiDrive >= EPhoneMemory && iGrabSettings.iSingleCaptureMemoryInUseMultiDrive <= EMemoryCard))
-	    {
-        iGrabSettings.iSingleCaptureMemoryInUseMultiDrive = EPhoneMemory;
-	    }
-	
-    if (!(iGrabSettings.iSequantialCaptureHotkey >= EHotkeySendKey && iGrabSettings.iSequantialCaptureHotkey <= EHotkeyCameraKey1))
-        {
-        iGrabSettings.iSequantialCaptureHotkey = EHotkeySendKey;
-        }
-    if (!(iGrabSettings.iSequantialCaptureImageFormat >= EImageFormatPNG && iGrabSettings.iSequantialCaptureImageFormat <= EImageFormatGIF))
-        {
-        iGrabSettings.iSequantialCaptureImageFormat = EImageFormatPNG;
-        }
-    if (!(iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive >= EPhoneMemory && iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive <= EMemoryCard))
-        {
-        iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive = EPhoneMemory;
-        }
-
-    if (!(iGrabSettings.iVideoCaptureHotkey >= EHotkeySendKey && iGrabSettings.iVideoCaptureHotkey <= EHotkeyCameraKey1))
-        {
-        iGrabSettings.iVideoCaptureHotkey = EHotkeySendKey;
-        }
-    if (iGrabSettings.iVideoCaptureVideoFormat != EVideoFormatAnimatedGIF)
-        {
-        iGrabSettings.iVideoCaptureVideoFormat = EVideoFormatAnimatedGIF;
-        }
-    if (!(iGrabSettings.iVideoCaptureMemoryInUseMultiDrive >= EPhoneMemory && iGrabSettings.iVideoCaptureMemoryInUseMultiDrive <= EMemoryCard))
-        {
-        iGrabSettings.iVideoCaptureMemoryInUseMultiDrive = EPhoneMemory;
-        }
-	
-    }
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::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 SGEngine::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 SGEngine::SaveSettingsL(TGrabSettings aGrabSettings)
-    {
-
-	
-    // set the new settings
-    iGrabSettings = aGrabSettings;
-
-    // handle settings always in c:\\private\\101fb751\\
-    if (iFileSession.SetSessionToPrivate( KSettingsDrive ) == KErrNone)
-        {
-        // delete existing store to make sure that it is clean and not eg corrupted
-        if (BaflUtils::FileExists(iFileSession, KSettingsFileName))
-            {
-            iFileSession.Delete(KSettingsFileName);
-            }
-        
-        // create a dictionary file store
-        CDictionaryFileStore* settingsStore = CDictionaryFileStore::OpenLC(iFileSession, KSettingsFileName, KUidScreenGrabber);
-
-        SaveDFSValueL(settingsStore, KSGSettingCaptureMode,                             iGrabSettings.iCaptureMode);
-        
-        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureHotkey,                     iGrabSettings.iSingleCaptureHotkey);
-        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureImageFormat,                iGrabSettings.iSingleCaptureImageFormat);
-        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureMemoryInUseMultiDrive,      iGrabSettings.iSingleCaptureMemoryInUseMultiDrive);
-        SaveDFSValueL(settingsStore, KSGSettingSingleCaptureFileName,                   iGrabSettings.iSingleCaptureFileName);
-        
-        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureHotkey,                 iGrabSettings.iSequantialCaptureHotkey);
-        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureImageFormat,            iGrabSettings.iSequantialCaptureImageFormat);
-        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureDelay,                  iGrabSettings.iSequantialCaptureDelay);
-        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureMemoryInUseMultiDrive,  iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive);
-        SaveDFSValueL(settingsStore, KSGSettingSequantialCaptureFileName,               iGrabSettings.iSequantialCaptureFileName);
-
-        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureHotkey,                      iGrabSettings.iVideoCaptureHotkey);
-        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureVideoFormat,                 iGrabSettings.iVideoCaptureVideoFormat);
-        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureMemoryInUseMultiDrive,       iGrabSettings.iVideoCaptureMemoryInUseMultiDrive);
-        SaveDFSValueL(settingsStore, KSGSettingVideoCaptureFileName,                    iGrabSettings.iVideoCaptureFileName);
-        
-        settingsStore->CommitL();
-        CleanupStack::PopAndDestroy(); // settingsStore             
-        }
-		
-    }
-        
-// ---------------------------------------------------------------------------
-
-void SGEngine::ActivateCaptureKeysL(TBool aChangeKey)
-    {
-	
-    // if changing the capture key, capturing needs to be cancelled first
-    if (aChangeKey)
-        {
-        CancelCapturing();
-        }
-
-    // get hotkey of the capture
-    TInt captureHotkey(0);
-    if (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture)
-        captureHotkey = iGrabSettings.iSingleCaptureHotkey;
-    else if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
-        captureHotkey = iGrabSettings.iSequantialCaptureHotkey;
-    else if (iGrabSettings.iCaptureMode == ECaptureModeVideoCapture)
-        captureHotkey = iGrabSettings.iVideoCaptureHotkey;
-    else
-        User::Panic(_L("Wrong mode"), 40);
-    
-    
-
-    // start capturing based on user selected key
-    switch (captureHotkey)
-        {
-        case EHotkeySendKey:
-            {
-            iCapturedKey    = iRootWin.CaptureKey(EStdKeyYes, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
-            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyYes, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
-            break;
-            }
-        case EHotkeyPowerKey:
-            {
-            iCapturedKey    = iRootWin.CaptureKey(EStdKeyDevice2, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
-            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyDevice2, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
-            break;
-            }
-        case EHotkeySideKey:
-            {
-            iCapturedKey    = iRootWin.CaptureKey(EStdKeyDevice6, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
-            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyDevice6, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
-            break;            
-            }
-        case EHotkeyCameraKey1:
-            {
-            iCapturedKey    = iRootWin.CaptureKey(EStdKeyDevice7, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
-            iCapturedKeyUnD = iRootWin.CaptureKeyUpAndDowns(EStdKeyDevice7, EModifierCtrl|EModifierShift|EModifierFunc, 0, KEY_CAPTURE_PRIORITY);
-            break;            
-            }
-        default:
-            {
-            User::Panic(_L("Key not supported"), 100);
-            break;
-            }
-        }
-		
-    }
-
-// ---------------------------------------------------------------------------
-
-
-void SGEngine::CancelCapturing()
-    {
-	
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- CancelCapturing start"));
-    // cancel all captures
-    iRootWin.CancelCaptureKey(iCapturedKey);
-    iRootWin.CancelCaptureKeyUpAndDowns(iCapturedKeyUnD);
-    
-    if (iHashKeyCapturingActivated)
-        {
-        iRootWin.CancelCaptureKey(iCapturedKeyHash);
-        iRootWin.CancelCaptureKeyUpAndDowns(iCapturedKeyHashUnD);
-        
-        iHashKeyCapturingActivated = EFalse;
-        }
-    
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- CancelCapturing end"));
-	
-    }
-
-// ---------------------------------------------------------------------------
-
-bool SGEngine::TakeScreenShotAndSaveL()
-    {
-	
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- TakeSsAndSave start"));
-    if ( IsActive() )
-        {
-        SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- TakeSsAndSave already active, ignored"));
-        return false;
-        }
-    
-    // take a screen shot
-    CWsScreenDevice* screenDevice = new( ELeave ) CWsScreenDevice(CEikonEnv::Static()->WsSession() );
-    CleanupStack::PushL( screenDevice );
-	
-    User::LeaveIfError( screenDevice->Construct( CEikonEnv::Static()->WsSession().GetFocusScreen() ) );
-
-	
-    User::LeaveIfError( iPreviouslyCapturedBitmap->Create(screenDevice->SizeInPixels(), screenDevice->DisplayMode()) );
-    User::LeaveIfError( screenDevice->CopyScreenToBitmap(iPreviouslyCapturedBitmap) );
-    CleanupStack::PopAndDestroy(); // screenDevice
-
-
-    // get memory in use & image format of the screen capture
-    TDriveNumber memoryInUse(EDriveC);
-    TInt intMemInUse(0);
-    TInt imageFormat(0);
-    TFileName fileName;
-    
-    if (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture)
-        {        
-//        memoryInUse = iGrabSettings.iSingleCaptureMemoryInUseMultiDrive;
-        intMemInUse = iGrabSettings.iSingleCaptureMemoryInUseMultiDrive;
-        
-        imageFormat = iGrabSettings.iSingleCaptureImageFormat;
-        fileName = iGrabSettings.iSingleCaptureFileName;
-        }
-    else if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
-        {          
-//        memoryInUse = iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive;
-        intMemInUse = iGrabSettings.iSequantialCaptureMemoryInUseMultiDrive;
-        
-        imageFormat = iGrabSettings.iSequantialCaptureImageFormat;
-        fileName = iGrabSettings.iSequantialCaptureFileName;
-        }
-    else
-        User::Panic(_L("Wrong mode"), 30);  
-
-
-    // init the path for saving the file
-	
-	iSaveFileName.Copy( PathInfo::PhoneMemoryRootPath() );
-	
-//    if (memoryInUse != EDriveC)//something different as PhoneMemory (memory card or mass memory)
-    if (intMemInUse != 0)//something different as PhoneMemory (memory card or mass memory)
-    	{
-		memoryInUse = EDriveY;	    
-		if (PathInfo::GetRootPath(iSaveFileName, memoryInUse) != KErrNone || !DriveOK(memoryInUse))
-			{
-			//we need to find first available memory card in EDriveE - EDriveY range
-			for (TInt i = EDriveY; i>=EDriveE; i--)
-				{
-				if ( DriveOK((TDriveNumber)(i)))
-					{
-					if (IsDriveMMC((TDriveNumber)(i)))
-						{
-						PathInfo::GetRootPath(iSaveFileName, (TDriveNumber)(i));
-						break;
-						}    
-					}
-				}
-			}
-    	}
-
-    iSaveFileName.Append( PathInfo::ImagesPath() );
-    iSaveFileName.Append( KScreenShotsSubDirectory );
-    
-    
-    // a quick check that filename is valid
-    if (fileName.Length() > 0 && fileName.Length() <= 255) 
-        iSaveFileName.Append( fileName );
-    else
-        iSaveFileName.Append( KDefaultImageFileName );
-
-    iSaveFileName.Append( _L(".") );
-
-
-    // reset the encoder
-    if (iImageEncoder)
-        {
-        delete iImageEncoder;
-        iImageEncoder = NULL;
-        }
-        
-    
-    switch (imageFormat)
-        {
-        case EImageFormatPNG:
-            {
-            // set filename
-            iSaveFileName.Append(_L("png"));
-            CApaApplication::GenerateFileName(iFileSession, iSaveFileName );  // unique filename
-
-            // init & convert
-            iImageEncoder = CImageEncoder::FileNewL(iFileSession, iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypePNGUid);
-			
-            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap );
-            }
-            break;
-        
-        case EImageFormatJPGHQ:
-        case EImageFormatJPGLQ:
-            {
-            // reset frameimagedata
-            if (iFrameImageData)
-                {
-                delete iFrameImageData;
-                iFrameImageData = NULL;
-                }
-            
-            // set filename
-            iSaveFileName.Append(_L("jpg"));
-            CApaApplication::GenerateFileName(iFileSession, iSaveFileName );  // unique filename
-
-            // init 
-            iImageEncoder = CImageEncoder::FileNewL(iFileSession, iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypeJPGUid);
-
-            // JPEG properties
-            TJpegImageData* imageData = new(ELeave) TJpegImageData;
-            imageData->iSampleScheme = TJpegImageData::EColor444;
-            imageData->iQualityFactor = (imageFormat==EImageFormatJPGHQ) ? HIGH_QUALITY_JPEG : LOW_QUALITY_JPEG;
-            iFrameImageData = CFrameImageData::NewL();
-            User::LeaveIfError(iFrameImageData->AppendImageData(imageData));  //ownership of imageData is transferred
-
-            // convert
-            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap, iFrameImageData );
-            }
-            break;
-        
-        case EImageFormatBMP:
-            {
-            // set filename
-            iSaveFileName.Append(_L("bmp"));
-            CApaApplication::GenerateFileName(iFileSession, iSaveFileName );  // unique filename
-
-            // init & convert
-            iImageEncoder = CImageEncoder::FileNewL(iFileSession, iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypeBMPUid);
-            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap );
-            }
-            break;
-
-        case EImageFormatGIF:
-            {
-            // set filename
-            iSaveFileName.Append(_L("gif"));
-            CApaApplication::GenerateFileName(iFileSession, iSaveFileName );  // unique filename
-
-            // init & convert
-            iImageEncoder = CImageEncoder::FileNewL(iFileSession, iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypeGIFUid);
-            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap );
-            }
-            break;
-            
-        case EImageFormatMBM:
-            {
-            // set filename
-            iSaveFileName.Append(_L("mbm"));
-            CApaApplication::GenerateFileName(iFileSession, iSaveFileName );  // unique filename
-
-            // init & convert
-            iImageEncoder = CImageEncoder::FileNewL(iFileSession, iSaveFileName, CImageEncoder::EOptionAlwaysThread, KImageTypeMBMUid);
-            iImageEncoder->Convert( &iStatus, *iPreviouslyCapturedBitmap );
-            }
-            break;
-            
-        default:
-            {
-            User::Panic(_L("Invalid Img Type"), 20);
-            }
-        }
-
-    // set the state of the active object
-    iState = EEncodingImage;
-
-    // indicate an outstanding request
-    SetActive();
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- TakeSsAndSave end"));
-	return true;
-    }
-    
-// ---------------------------------------------------------------------------
-
-
-TBool SGEngine::DriveOK(TDriveNumber aNumber)
-    {
-	
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- Driveok start"));
-    TBool isOK(EFalse);
-
-    TVolumeInfo vInfo;
-
-    // check if we can access the drive
-    if (iFileSession.Volume(vInfo, aNumber) == KErrNone)
-        isOK = ETrue;
-
-    // returns ETrue if memory card working properly
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- DriveOK end"));
-    return isOK;
-	
-    }
-// ---------------------------------------------------------------------------
-
-
-TBool SGEngine::IsDriveMMC(TDriveNumber aDrive)
-    {
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- IsDriveMMC start"));
-    TBool isOK(EFalse);
-
-    TDriveInfo ii;   
-    if (iFileSession.Drive(ii, aDrive)==KErrNone) 
-        {      
-            if (ii.iType!=EMediaNotPresent &&
-                ii.iType!=EMediaUnknown &&           
-                ii.iType!=EMediaCdRom &&         
-                ii.iType!=EMediaRom) 
-                {           // memory card          
-                    isOK=ETrue;      
-                }   
-        }    
-                
-    
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- IsDriveMMC end"));
-    return isOK;
-    }
-
-
-void SGEngine::CapturingFinishedL(TInt aErr)
-    {
-	
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- CapturingFinished start"));
-    // display a global query to show the results
-    
-    if (aErr == KErrNone)
-        {
-        switch (iGrabSettings.iCaptureMode)
-            {
-            case ECaptureModeSingleCapture:
-                {
-                iEngineWrapper->ShowImageCapturedNote();
-                }
-                break;
-            
-            case ECaptureModeSequantialCapture:
-                {
-                iEngineWrapper->ShowSequantialImagesCapturedNote(iNumberOfTakenShots);
-                }
-                break;            
-    
-            case ECaptureModeVideoCapture:
-                {
-                iEngineWrapper->ShowVideoCapturedNote();
-                }
-                break;             
-    
-            default:
-                User::Panic(_L("Inv.capt.mode"), 51);
-                break;
-            }            
-       
-        }
-    else
-        {
-        
-        // Get error message with CTextResolver
-        CTextResolver* textResolver = CTextResolver::NewLC();
-        iEngineWrapper->ShowErrorMessage(textResolver->ResolveErrorString(aErr));
-
-        CleanupStack::PopAndDestroy();  //textResolver    
-        
-        }
-
-    // capturing can now be restarted
-    iState = EIdle;
-    iCapturingInProgress = EFalse;
-    iStopCapturing = EFalse;
-    
-    // reset values
-    iNumberOfTakenShots = 0;
-    iCurrentFrameNumber = 0;
-    iVideoFrameArray->Reset();
-    
-    
-    iState = EQueryDelay;
-    iTimer.After(iStatus, 2000000);
-    SetActive(); 
-    
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- capturingfinished end"));
-	
-    }
-
-
-#if defined(HB_QT_S60_EVENT_FILTER)
-    TBool SGEngine::HandleCaptureCommandsL(const TWsEvent* aEvent)
-	{
-#else
-    TBool SGEngine::HandleCaptureCommandsL(const QSymbianEvent *event)
-	{
-    if (event->type() != QSymbianEvent::WindowServerEvent) {
-        return ETrue; //continueEventLoop
-    }
-    const TWsEvent *aEvent = event->windowServerEvent();
-#endif
-	
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- HandleCaptureCommand start"));
-	
-	
-    TBool continueEventLoop(ETrue);
-    
-    // get hotkey of the capture
-    TInt captureHotkey(0);
-    if (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture)
-        captureHotkey = iGrabSettings.iSingleCaptureHotkey;
-    else if (iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture)
-        captureHotkey = iGrabSettings.iSequantialCaptureHotkey;
-    else if (iGrabSettings.iCaptureMode == ECaptureModeVideoCapture)
-        captureHotkey = iGrabSettings.iVideoCaptureHotkey;
-    else
-        User::Panic(_L("Wrong mode"), 41);
-    
-    // ignore any errors
-    if (aEvent->Type()==EEventErrorMessage)
-        {
-        // error
-        }
-    
-            
-    // handle captured keys, we are interested here only of the keydown events
-    else
-        
-        if (
-              ( captureHotkey == EHotkeySendKey &&
-                aEvent->Type()==EEventKeyDown && aEvent->Key()->iScanCode==EStdKeyYes )
-            ||
-              ( captureHotkey == EHotkeyPowerKey &&
-                aEvent->Type()==EEventKeyDown && aEvent->Key()->iScanCode==EStdKeyDevice2 )
-            ||
-              ( captureHotkey == EHotkeySideKey &&
-                aEvent->Type()==EEventKeyDown && aEvent->Key()->iScanCode==EStdKeyDevice6 )
-            ||
-              ( captureHotkey == EHotkeyCameraKey1 &&
-                aEvent->Type()==EEventKeyDown && aEvent->Key()->iScanCode==EStdKeyDevice7 )
-            )
-        {
-        
-        // check if already capturing images in sequence
-        if ( iCapturingInProgress && !iStopCapturing && iNumberOfTakenShots!=0 && iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture )
-            {
-            // asking to stop capturing
-            iStopCapturing = ETrue; 
-            
-            // cancel the active object, this will cancel any timer delays and ICL stuff
-            Cancel();
-            
-            // set status
-            iState = ECancelCapturing; 
-            
-            // jump smoothly to RunL()
-            iTimer.After(iStatus, 50);
-            SetActive(); 
-
-            // do not continue the event loop in HandleWsEventL for these events
-            continueEventLoop = EFalse;
-            }
-
-        // check if already capturing video
-        else if ( iCapturingInProgress && !iStopCapturing && iGrabSettings.iCaptureMode == ECaptureModeVideoCapture )
-            {
-            // asking to stop capturing
-            iStopCapturing = ETrue;
-            
-            // cancel the active object, this will cancel any timer delays and ICL stuff
-            Cancel();
-
-            // set status
-            iState = ECancelVideoCapturing;
-            
-            // jump smoothly to RunL()
-            iTimer.After(iStatus, 50);
-            SetActive(); 
-
-            // do not continue the event loop in HandleWsEventL for these events
-            continueEventLoop = EFalse;
-            }        
-        else if (!iCapturingInProgress && (iGrabSettings.iCaptureMode == ECaptureModeSingleCapture || iGrabSettings.iCaptureMode == ECaptureModeSequantialCapture ))
-            {
-            
-            // take a screen shot and save it
-           if( TakeScreenShotAndSaveL())
-               {
-               // not capturing anything, so start doing that
-               iCapturingInProgress = ETrue;    
-               // do not continue the event loop in HandleWsEventL for these events
-               continueEventLoop = EFalse;
-               }
-            }
-        
-        else if (!iCapturingInProgress && iGrabSettings.iCaptureMode == ECaptureModeVideoCapture )
-            {
-            // not capturing anything, so start doing that
-            iCapturingInProgress = ETrue;
-            
-            // clean temporary files
-            TRAP_IGNORE( CleanTemporaryFilesL() );
-            
-            // get initial dimensions for the video
-            CWsScreenDevice* screenDevice = new(ELeave) CWsScreenDevice ( CEikonEnv::Static()->WsSession() );
-            CleanupStack::PushL(screenDevice);
-			
-            User::LeaveIfError( screenDevice->Construct( CEikonEnv::Static()->WsSession().GetFocusScreen() ) );
-			
-            iVideoDimensions = screenDevice->SizeInPixels();
-            iPreviousFrameScreenDimension = screenDevice->SizeInPixels();
-            CleanupStack::PopAndDestroy(); // screenDevice
-
-            // capture the first frame
-            CaptureFrameForVideoL();              
-
-            // do not continue the event loop in HandleWsEventL for these events
-            continueEventLoop = EFalse;
-            }
-
-        }
-
-    // catch other event types as well so that we can ignore them
-    else if (
-              ( captureHotkey == EHotkeySendKey &&
-                aEvent->Key()->iScanCode==EStdKeyYes )
-            ||
-              ( captureHotkey == EHotkeyPowerKey &&
-                aEvent->Key()->iScanCode==EStdKeyDevice2 )
-            ||
-              ( captureHotkey == EHotkeySideKey &&
-                aEvent->Key()->iScanCode==EStdKeyDevice6 )
-            ||
-              ( captureHotkey == EHotkeyCameraKey1 &&
-                aEvent->Key()->iScanCode==EStdKeyDevice7 )
-           )
-        {
-        // do not continue the event loop in HandleWsEventL for these events
-        continueEventLoop = EFalse;
-        }
-
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- HandleCapturcommand end"));
-
-    
-    return continueEventLoop;
-    
-    }
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::CleanTemporaryFilesL()
-    {
-	
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- CleanTempFiles start"));
-    
-    // delete temporary files from C and D drives    
-    CFileMan* fileMan = CFileMan::NewL(iFileSession);
-
-    TFileName delFilesPath;
-        
-    for (TInt i=0; i<1; i++)
-        {
-        delFilesPath.Copy(KNullDesC);
-        delFilesPath.Append('C'+i);
-        delFilesPath.Append(_L(":"));
-        delFilesPath.Append(KSGTemporaryDirectory);
-        delFilesPath.Append(_L("*.$$$"));
-        
-        fileMan->Delete(delFilesPath);
-        }
-
-    delete fileMan;    
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- CleanTempfile end"));
-	
-    }
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::ActivateModelL()
-    {
-    // clean temporary files
-    TRAP_IGNORE( CleanTemporaryFilesL() );
-            
-    // load settings
-    TRAP_IGNORE( LoadSettingsL() );
-
-    // start capturing
-    ActivateCaptureKeysL();
-    }
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::DeActivateModelL()
-    {
-	
-    CancelCapturing();
-
-    // for a faster exit, send the application to background
-    TApaTask selfTask(CEikonEnv::Static()->WsSession());
-    selfTask.SetWgId(iRootWin.Identifier());
-    selfTask.SendToBackground();
-	
-	
-    }
-    
-// ---------------------------------------------------------------------------
-
-
-void SGEngine::CaptureFrameForVideoL()
-    {
-    
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- CaptureFrameforvide start"));
-    // record time
-    TTime timeNow;
-    timeNow.HomeTime();
-    
-    // take a screen shot   
-    CFbsBitmap* currentCapturedBitmap = new(ELeave) CFbsBitmap;
-    CleanupStack::PushL(currentCapturedBitmap);
-
-    CWsScreenDevice* screenDevice = new(ELeave) CWsScreenDevice( CEikonEnv::Static()->WsSession() );
-    CleanupStack::PushL( screenDevice );
-    User::LeaveIfError( screenDevice->Construct( CEikonEnv::Static()->WsSession().GetFocusScreen() ) );
-    
-    TSize currentScreenSize = screenDevice->SizeInPixels();
-
-    User::LeaveIfError( currentCapturedBitmap->Create(currentScreenSize, EColor256) );
-    User::LeaveIfError( screenDevice->CopyScreenToBitmap(currentCapturedBitmap) );
-    CleanupStack::PopAndDestroy(); // screenDevice
-
-    // grow video's dimensions if the size has changed
-    if (currentScreenSize.iWidth > iVideoDimensions.iWidth)
-        {
-        iVideoDimensions.iWidth = currentScreenSize.iWidth;
-        }
-    if (currentScreenSize.iHeight > iVideoDimensions.iHeight)
-        {
-        iVideoDimensions.iHeight = currentScreenSize.iHeight;
-        }
-
-    TInt64 currentDelay(0);
- 
-
-    // create a new frame
-    TVideoFrame frame;
-    frame.iDelay = 500; // use default delay 5.00 secs
-    
-    // get info of the RAM drive
-    TDriveNumber ramDrive = EDriveD;
-    TVolumeInfo ramDriveInfo;
-    iFileSession.Volume(ramDriveInfo, ramDrive);
-    
-    // init the directory for saving the file, preferably use ram drive if there is enough disk space, otherwise use always C drive
-    TFileName tempDirectory;
-    TFileName sessionPath;
-    
-    if (ramDriveInfo.iFree > (iVideoDimensions.iWidth*iVideoDimensions.iHeight+50000))
-        sessionPath.Copy( _L("D:") );
-    else
-        sessionPath.Copy( _L("C:") );
-    
-    sessionPath.Append(KSGTemporaryDirectory);
-    tempDirectory.Copy(KSGTemporaryDirectory);
-    
-    iFileSession.MkDirAll(sessionPath);
-    iFileSession.SetSessionPath(sessionPath);
-
-    // create a temp file, path to the bitmap is saved automatically to frame.iFileStorePath
-    RFile file;
-    User::LeaveIfError( file.Temp(iFileSession, tempDirectory, frame.iFileStorePath, EFileWrite) );
-    RFileWriteStream writeStream(file);
-    
-    TBool ignoreFrame(EFalse);
-    
-    // check if is this the first frame
-    if (iCurrentFrameNumber == 0)
-        {
-        // first frame is always the full one
-        frame.iWidth = currentScreenSize.iWidth;    
-        frame.iHeight = currentScreenSize.iHeight;  
-        frame.iXPos = 0;
-        frame.iYPos = 0;
-        frame.iEnableTransparency = EFalse;
-        frame.iFillsWholeScreen = ETrue;
-        
-        currentCapturedBitmap->ExternalizeL(writeStream);  
-
-        }
-    
-    else
-        {
-        // next frame is a difference between the previous one
-        currentDelay = timeNow.MicroSecondsFrom(iPreviousFrameTaken).Int64();
-        
-        // get reference to previos frame
-        TVideoFrame& prevFrame = iVideoFrameArray->At(iVideoFrameArray->Count()-1);
-        
-        
-        // check if video dimensions have changed
-        if (currentScreenSize.iWidth != iPreviousFrameScreenDimension.iWidth
-            || currentScreenSize.iHeight != iPreviousFrameScreenDimension.iHeight)
-            {
-            // dimensions have changed -> save a full bitmap
-            frame.iWidth = currentScreenSize.iWidth;    
-            frame.iHeight = currentScreenSize.iHeight;  
-            frame.iXPos = 0;
-            frame.iYPos = 0;
-            frame.iEnableTransparency = EFalse;
-            frame.iFillsWholeScreen = ETrue;
-            
-            currentCapturedBitmap->ExternalizeL(writeStream);            
-
-            // update the previous frame to contain the new delay value
-            prevFrame.iDelay = TUint( (double) currentDelay / 10000 );
-            }
-
-        else
-            {
-            // compare the bitmaps
-            HBufC8* curImgScanLineBuf = HBufC8::NewLC(currentScreenSize.iWidth*3);
-            TPtr8 curImgScanLinePtr = curImgScanLineBuf->Des();
-            HBufC8* prevImgScanLineBuf = HBufC8::NewLC(currentScreenSize.iWidth*3);
-            TPtr8 prevImgScanLinePtr = prevImgScanLineBuf->Des();
-            
-            TPoint pt(0,0);
-            TBool differenceFound(EFalse);
-            TPoint leftTopDifferencePoint(0,0);
-            TPoint rightBottomDifferencePoint(currentScreenSize.iWidth,currentScreenSize.iHeight);
-            
-            // scan the image from top to bottom
-            for (TInt i=0; i<currentScreenSize.iHeight; i++)
-                {
-                pt.iY = i;
-                
-                currentCapturedBitmap->GetScanLine(curImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
-                iPreviouslyCapturedBitmap->GetScanLine(prevImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
-                
-                if (curImgScanLinePtr != prevImgScanLinePtr)
-                    {
-                    differenceFound = ETrue;
-                    
-                    // get the y-coordinate
-                    leftTopDifferencePoint.iY = i;
-
-                    break;    
-                    }
-                }
-                
-            if (differenceFound)
-                {
-                // now we know that there is some difference between those two captured frames,
-                // get the bottom value by scaning from bottom to top
-                for (TInt i=currentScreenSize.iHeight-1; i>=0; i--)
-                    {
-                    pt.iY = i;
-                    
-                    currentCapturedBitmap->GetScanLine(curImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
-                    iPreviouslyCapturedBitmap->GetScanLine(prevImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
-                    
-                    if (curImgScanLinePtr != prevImgScanLinePtr)
-                        {
-                        // get the y-coordinate
-                        rightBottomDifferencePoint.iY = i+1;
-
-                        break;    
-                        }
-                    }
-                    
-                // check that the height of the cropped image will be at least 1
-                if (rightBottomDifferencePoint.iY <= leftTopDifferencePoint.iY)
-                    rightBottomDifferencePoint.iY = leftTopDifferencePoint.iY+1;  
-                
-                      
-                // get also the x-coordinates by scanning vertical scan lines
-                HBufC8* curImgVerticalScanLineBuf = HBufC8::NewLC(currentScreenSize.iHeight*3);
-                TPtr8 curImgVerticalScanLinePtr = curImgScanLineBuf->Des();
-                HBufC8* prevImgVerticalScanLineBuf = HBufC8::NewLC(currentScreenSize.iHeight*3);
-                TPtr8 prevImgVerticalScanLinePtr = prevImgScanLineBuf->Des();
-                        
-                // first scan by from left to right
-                for (TInt i=0; i<currentScreenSize.iWidth; i++)
-                    {
-                    currentCapturedBitmap->GetVerticalScanLine(curImgVerticalScanLinePtr, i, EColor256);
-                    iPreviouslyCapturedBitmap->GetVerticalScanLine(prevImgVerticalScanLinePtr, i, EColor256);
-                    
-                    if (curImgVerticalScanLinePtr != prevImgVerticalScanLinePtr)
-                        {
-                        leftTopDifferencePoint.iX = i;
-                        break;
-                        }
-                    }
-
-                // finally scan from right to left
-                for (TInt i=currentScreenSize.iWidth-1; i>=0; i--)
-                    {
-                    currentCapturedBitmap->GetVerticalScanLine(curImgVerticalScanLinePtr, i, EColor256);
-                    iPreviouslyCapturedBitmap->GetVerticalScanLine(prevImgVerticalScanLinePtr, i, EColor256);
-                    
-                    if (curImgVerticalScanLinePtr != prevImgVerticalScanLinePtr)
-                        {
-                        rightBottomDifferencePoint.iX = i+1;
-                        break;
-                        }
-                    }
-                    
-                CleanupStack::PopAndDestroy(2); //curImgVerticalScanLineBuf,prevImgVerticalScanLineBuf               
-
-                
-                // check that the width of the cropped image will be at least 1
-                if (rightBottomDifferencePoint.iX <= leftTopDifferencePoint.iX)
-                    rightBottomDifferencePoint.iX = leftTopDifferencePoint.iX+1;
-                   
-                
-                // record dimensions and position of the image           
-                frame.iWidth = rightBottomDifferencePoint.iX - leftTopDifferencePoint.iX;    
-                frame.iHeight = rightBottomDifferencePoint.iY - leftTopDifferencePoint.iY;  
-                frame.iXPos = leftTopDifferencePoint.iX;
-                frame.iYPos = leftTopDifferencePoint.iY;
-                frame.iEnableTransparency = ETrue;
-                frame.iFillsWholeScreen = EFalse;
-            
-            
-                // take a copy of the current frame
-                CFbsBitmap* workingBitmap = new(ELeave) CFbsBitmap;
-                CleanupStack::PushL(workingBitmap);
-                User::LeaveIfError( workingBitmap->Create(currentScreenSize, EColor256) );
-
-                HBufC8* tempScanLineBuf = HBufC8::NewLC(currentScreenSize.iWidth*3);
-                TPtr8 tempScanLinePtr = tempScanLineBuf->Des();
-                
-                for (TInt i=0; i<currentScreenSize.iHeight; i++)
-                    {
-                    pt.iY = i;
-                    currentCapturedBitmap->GetScanLine(tempScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
-                    workingBitmap->SetScanLine(tempScanLinePtr, i);
-                    }
-                    
-                CleanupStack::PopAndDestroy(); //tempScanLineBuf
-                
-                
-                // mark the non-changed areas with transparency color
-                TUint8* curPtr = NULL;
-                TUint8* prevPtr = NULL;
-                for (TInt i=frame.iYPos; i<frame.iYPos+frame.iHeight; i++)
-                    {
-                    pt.iY = i;
-                    
-                    workingBitmap->GetScanLine(curImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
-                    iPreviouslyCapturedBitmap->GetScanLine(prevImgScanLinePtr, pt, currentScreenSize.iWidth, EColor256);
-                    
-                    // check single pixels in the scanline
-                    for (TInt j=frame.iXPos; j<frame.iXPos+frame.iWidth; j++)
-                        {
-                        curPtr = &curImgScanLinePtr[j];
-                        prevPtr = &prevImgScanLinePtr[j];
-                        
-                        // check that our transparency index isn't already in use
-                        if (curPtr[0] == TRANSPARENCY_INDEX)
-                            curPtr[0] = TRANSPARENCY_ALTERNATIVE_INDEX;
-                        
-                        // replace with transparency index if there is no change compared to the previous frame
-                        if (curPtr[0] == prevPtr[0])
-                            curPtr[0] = TRANSPARENCY_INDEX;
-                        }
-                        
-                    // set new scanline    
-                    workingBitmap->SetScanLine(curImgScanLinePtr, i);
-                    }
-
-
-                // externalize the bitmap
-                TRect changedRect(leftTopDifferencePoint, rightBottomDifferencePoint);
-                workingBitmap->ExternalizeRectangleL(writeStream, changedRect);
-                
-                CleanupStack::PopAndDestroy(); //workingBitmap
- 
-                // update the previous frame to contain the new delay value
-                prevFrame.iDelay = TUint( (double) currentDelay / 10000 );
-                }
-
-            else
-                {
-                // frames are identical, we can just ignore this one
-                ignoreFrame = ETrue;     
-                }
-            
-            CleanupStack::PopAndDestroy(2); //curImgScanLineBuf,prevImgScanLineBuf
-
-            } // if (videoDimensionsHaveChanged)
-
-        } //if (iCurrentFrameNumber == 0)
-            
-    // close the stream
-    writeStream.CommitL();
-    writeStream.Close();
-    file.Close();
-    
-
-    if (ignoreFrame)
-        {
-        // delete the temp file since we don't need that
-            iFileSession.Delete(frame.iFileStorePath);
-        }
-    else
-        {
-        // remember for the next frame when this frame was taken
-        iPreviousFrameTaken = timeNow;
-
-        // take a copy of currentCapturedBitmap to iPreviouslyCapturedBitmap
-        User::LeaveIfError( iPreviouslyCapturedBitmap->Create(iVideoDimensions, EColor256) );
-
-        TPoint pt(0,0);
-        HBufC8* tempScanLineBuf = HBufC8::NewMaxLC(iVideoDimensions.iWidth);
-        TPtr8 tempScanLinePtr = tempScanLineBuf->Des();
-        
-        for (TInt i=0; i<iVideoDimensions.iHeight; i++)
-            {
-            pt.iY = i;
-            currentCapturedBitmap->GetScanLine(tempScanLinePtr, pt, iVideoDimensions.iWidth, EColor256);
-            iPreviouslyCapturedBitmap->SetScanLine(tempScanLinePtr, i);
-            }
-            
-        CleanupStack::PopAndDestroy(); //tempScanLineBuf
-        
-        // append frame information to the array
-        iVideoFrameArray->AppendL(frame);
-        
-        // remember screen size
-        iPreviousFrameScreenDimension = currentScreenSize;
-        }    
-
-    
-    CleanupStack::PopAndDestroy(); //currentCapturedBitmap
-    
-
-    // set the state of the active object
-    iState = ENextVideoFrame;
-    
-    // check time spent on the work above (probably this is not so important)
-    TTime timeNow2;
-    timeNow2.HomeTime();
-    TInt64 handlingDelay = timeNow2.MicroSecondsFrom(timeNow).Int64();
-    
-    // calculate delay till next frame
-    TUint idealDelay = VIDEO_CAPTURE_DELAY*1000;
-    TInt usedDelay; 
-    if (currentDelay > idealDelay)
-        usedDelay = idealDelay - (currentDelay - idealDelay) - handlingDelay;
-    else
-        usedDelay = idealDelay - handlingDelay;
-    
-    // check that the delay is atleast minimum delay anyway
-    if (usedDelay < VIDEO_CAPTURE_MINIMUM_DELAY*1000)
-        usedDelay = VIDEO_CAPTURE_MINIMUM_DELAY*1000;
-    
-    iTimer.After(iStatus, usedDelay);
-
-    // indicate an outstanding request
-    SetActive();
-    
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- Captureframeforvideo end"));
-	
-    }
-
-// ---------------------------------------------------------------------------
-
-void SGEngine::SaveVideoL(TInt aErr)
-    {
-
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- SaveVideo start"));
-    
-    if (aErr)
-        CapturingFinishedL(aErr);   
-   
-    else if (iGrabSettings.iVideoCaptureVideoFormat == EVideoFormatAnimatedGIF)
-        {
-        TInt err(KErrNone);
-
-        
-			iSaveFileName.Copy( PathInfo::PhoneMemoryRootPath() );
-            if (iGrabSettings.iVideoCaptureMemoryInUseMultiDrive != 0)//something different as PhoneMemory (memory card or mass memory)
-            	{
-        		if (PathInfo::GetRootPath(iSaveFileName,EDriveY) != KErrNone || !DriveOK(EDriveY))
-        			{
-        			//we need to find first available memory card in EDriveE - EDriveY range
-        			for (TInt i = EDriveY; i>=EDriveE; i--)
-        				{
-        				if ( DriveOK((TDriveNumber)(i)))
-        					{
-        					if (IsDriveMMC((TDriveNumber)(i)))
-        						{
-        						PathInfo::GetRootPath(iSaveFileName, (TDriveNumber)(i));
-        						break;
-        						}    
-        					}
-        				}
-        			}
-            	}
-
-        
-        iSaveFileName.Append( PathInfo::ImagesPath() );     // animated gif is actually an image, not a video
-        iSaveFileName.Append( KScreenShotsSubDirectory );
-        
-        // a quick check that filename is valid
-        if (iGrabSettings.iVideoCaptureFileName.Length() > 0 && iGrabSettings.iVideoCaptureFileName.Length() <= 255) 
-            iSaveFileName.Append( iGrabSettings.iVideoCaptureFileName );
-        else
-            iSaveFileName.Append( KDefaultVideoFileName );
-
-        iSaveFileName.Append( _L(".gif") );
-
-        CApaApplication::GenerateFileName(iFileSession, iSaveFileName );  // unique filename
-
-        // create and save the gif animation
-        err = CGifAnimator::CreateGifAnimation(iSaveFileName, iVideoDimensions, iVideoFrameArray, *iEngineWrapper);
-        
-        // remove the saved file in case of errors since it's likely corrupted
-        if (err != KErrNone)
-            iFileSession.Delete(iSaveFileName);
-        
-        CapturingFinishedL(err);   
-        }
-        
-    else
-        CapturingFinishedL(KErrNotSupported);
-    
-    SC_DEBUG(_L("SCREENGRABBER ------------------------------------------------------- SaveVideo end"));
-    }
-// ---------------------------------------------------------------------------
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_4_0.dtd	Wed Sep 01 12:30:35 2010 +0100
@@ -0,0 +1,86 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+  name CDATA #REQUIRED
+  schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+  name CDATA #REQUIRED
+  levels CDATA #IMPLIED
+  span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+  name CDATA #REQUIRED
+  level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+  unitID ID #REQUIRED
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  bldFile CDATA #REQUIRED
+  priority CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+  name CDATA #REQUIRED
+  mrp CDATA #REQUIRED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+  name CDATA #REQUIRED
+  version CDATA #REQUIRED
+  late (Y|N) #IMPLIED
+  filter CDATA #IMPLIED
+  contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+  name ID #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+  name ID #REQUIRED
+  abldTarget CDATA #REQUIRED
+  description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+  name ID #REQUIRED
+  abldOption CDATA #REQUIRED
+  description CDATA #REQUIRED
+  enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+  name ID #REQUIRED
+  description CDATA #REQUIRED
+  filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+  command CDATA #REQUIRED
+  targetList IDREFS #IMPLIED
+  unitParallel (Y | N | y | n) #REQUIRED
+  targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+  name CDATA #REQUIRED
+  cwd CDATA #REQUIRED
+  command CDATA #REQUIRED>  
--- a/sysdef_1_5_1.dtd	Tue Aug 31 15:15:20 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
- <!ELEMENT SystemDefinition (systemModel?, build?)>
- <!ATTLIST SystemDefinition
-  name CDATA #REQUIRED
-  schema CDATA #REQUIRED>
- <!ELEMENT systemModel (layer+)>
- <!ELEMENT layer (logicalset* | module*)*>
- <!ATTLIST layer
-  name CDATA #REQUIRED
-  levels CDATA #IMPLIED
-  span CDATA #IMPLIED>
- <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalset name CDATA #REQUIRED>
- <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
- <!ATTLIST logicalsubset name CDATA #REQUIRED>
- <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
- <!ATTLIST module
-  name CDATA #REQUIRED
-  level CDATA #IMPLIED>
- <!ELEMENT component (unit* | package* | prebuilt*)*>
- <!ATTLIST component name CDATA #REQUIRED>
- <!ELEMENT unit EMPTY>
- <!ATTLIST unit
-  unitID ID #REQUIRED
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  bldFile CDATA #REQUIRED
-  priority CDATA #IMPLIED
-  contract CDATA #IMPLIED
-  proFile CDATA #IMPLIED
-  qmakeArgs CDATA #IMPLIED>
- <!ELEMENT package EMPTY>
- <!ATTLIST package
-  name CDATA #REQUIRED
-  mrp CDATA #REQUIRED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT prebuilt EMPTY>
- <!ATTLIST prebuilt
-  name CDATA #REQUIRED
-  version CDATA #REQUIRED
-  late (Y|N) #IMPLIED
-  filter CDATA #IMPLIED
-  contract CDATA #IMPLIED>
- <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
- <!ELEMENT unitList (unitRef+)>
- <!ATTLIST unitList
-  name ID #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT unitRef EMPTY>
- <!ATTLIST unitRef unit IDREF #REQUIRED>
- <!ELEMENT targetList EMPTY>
- <!ATTLIST targetList
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  target IDREFS #REQUIRED>
- <!ELEMENT target EMPTY>
- <!ATTLIST target
-  name ID #REQUIRED
-  abldTarget CDATA #REQUIRED
-  description CDATA #REQUIRED>
- <!ELEMENT option EMPTY>
- <!ATTLIST option
-  name ID #REQUIRED
-  abldOption CDATA #REQUIRED
-  description CDATA #REQUIRED
-  enable (Y | N | y | n) #REQUIRED>
- <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
- <!ATTLIST configuration
-  name ID #REQUIRED
-  description CDATA #REQUIRED
-  filter CDATA #REQUIRED>
- <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
- <!ELEMENT unitListRef EMPTY>
- <!ATTLIST unitListRef unitList IDREF #REQUIRED>
- <!ELEMENT layerRef EMPTY>
- <!ATTLIST layerRef layerName CDATA #REQUIRED>
- <!ELEMENT buildLayer EMPTY>
- <!ATTLIST buildLayer
-  command CDATA #REQUIRED
-  targetList IDREFS #IMPLIED
-  unitParallel (Y | N | y | n) #REQUIRED
-  targetParallel (Y | N | y | n) #IMPLIED>
- <!ELEMENT specialInstructions EMPTY>
- <!ATTLIST specialInstructions
-  name CDATA #REQUIRED
-  cwd CDATA #REQUIRED
-  command CDATA #REQUIRED>