Revision: 201031
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 10:05:49 +0300
changeset 109 e0aa398e6810
parent 104 9b022b1f357c
child 115 3ab5c078b490
Revision: 201031 Kit: 201033
activityfw/activitydatabase/activitydatabase.pro
activityfw/activitydatabase/bwins/hsactivitydbclientu.def
activityfw/activitydatabase/eabi/hsactivitydbclientu.def
activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro
activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbasyncrequestobserver.h
activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h
activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbasyncrequest_p.h
activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h
activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbasyncrequest_p.cpp
activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp
activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp
activityfw/activitydatabase/hsactivitydbserver/group/bld.inf
activityfw/activitydatabase/hsactivitydbserver/group/hsactivitydbserver.mmp
activityfw/activitydatabase/hsactivitydbserver/hsactivitydbserver.pro
activityfw/activitydatabase/hsactivitydbserver/inc/afbroadcasttask.h
activityfw/activitydatabase/hsactivitydbserver/inc/afdataprovidertask.h
activityfw/activitydatabase/hsactivitydbserver/inc/afobservertask.h
activityfw/activitydatabase/hsactivitydbserver/inc/afqueries.h
activityfw/activitydatabase/hsactivitydbserver/inc/afserver.h
activityfw/activitydatabase/hsactivitydbserver/inc/afsession.h
activityfw/activitydatabase/hsactivitydbserver/inc/afstorage.h
activityfw/activitydatabase/hsactivitydbserver/inc/afstorageasynctask.h
activityfw/activitydatabase/hsactivitydbserver/inc/afstoragesynctask.h
activityfw/activitydatabase/hsactivitydbserver/inc/aftask.h
activityfw/activitydatabase/hsactivitydbserver/inc/aftaskstorage.h
activityfw/activitydatabase/hsactivitydbserver/inc/afthumbnailtask.h
activityfw/activitydatabase/hsactivitydbserver/src/afbroadcasttask.cpp
activityfw/activitydatabase/hsactivitydbserver/src/afdataprovidertask.cpp
activityfw/activitydatabase/hsactivitydbserver/src/afobservertask.cpp
activityfw/activitydatabase/hsactivitydbserver/src/afserver.cpp
activityfw/activitydatabase/hsactivitydbserver/src/afsession.cpp
activityfw/activitydatabase/hsactivitydbserver/src/afstorage.cpp
activityfw/activitydatabase/hsactivitydbserver/src/afstorageasynctask.cpp
activityfw/activitydatabase/hsactivitydbserver/src/afstoragesynctask.cpp
activityfw/activitydatabase/hsactivitydbserver/src/afthumbnailtask.cpp
activityfw/activitydatabase/hsactivitydbserver/src/main.cpp
activityfw/activitydatabase/inc/activitycmd.h
activityfw/activitydatabase/inc/hsactivitydbclientinterface.h
activityfw/activitydatabase/s60/inc/afentry.h
activityfw/activitydatabase/s60/inc/hsactivityglobals.h
activityfw/activitydatabase/s60/inc/hsserializer.h
activityfw/activitydatabase/s60/src/afentry.cpp
activityfw/activitydatabase/s60/src/hsserializer.cpp
activityfw/activityfw.pro
activityfw/activityserviceplugin/activityserviceplugin.pri
activityfw/activityserviceplugin/activityserviceplugin.pro
activityfw/activityserviceplugin/bwins/afserviceu.def
activityfw/activityserviceplugin/data/activityserviceplugin.xml
activityfw/activityserviceplugin/data/afservice.xml
activityfw/activityserviceplugin/eabi/afserviceu.def
activityfw/activityserviceplugin/inc/activityserviceplugin.h
activityfw/activityserviceplugin/inc/afactivation_p.h
activityfw/activityserviceplugin/inc/afactivityclient.h
activityfw/activityserviceplugin/inc/afactivitymanager.h
activityfw/activityserviceplugin/inc/afactivitystorage_p.h
activityfw/activityserviceplugin/inc/afclient.h
activityfw/activityserviceplugin/inc/afcommandlineparser.h
activityfw/activityserviceplugin/inc/aflauncher.h
activityfw/activityserviceplugin/inc/afmanager.h
activityfw/activityserviceplugin/inc/afserviceplugin.h
activityfw/activityserviceplugin/inc/afstorageproxy.h
activityfw/activityserviceplugin/inc/applicationlauncher.h
activityfw/activityserviceplugin/s60/inc/afserializer.h
activityfw/activityserviceplugin/s60/inc/afstorageproxy_p.h
activityfw/activityserviceplugin/s60/src/afserializer.cpp
activityfw/activityserviceplugin/s60/src/afstorageproxy_p.cpp
activityfw/activityserviceplugin/s60/src/applicationlauncher_p.cpp
activityfw/activityserviceplugin/src/activityserviceplugin.cpp
activityfw/activityserviceplugin/src/afactivation.cpp
activityfw/activityserviceplugin/src/afactivation_p.cpp
activityfw/activityserviceplugin/src/afactivityclient.cpp
activityfw/activityserviceplugin/src/afactivitymanager.cpp
activityfw/activityserviceplugin/src/afactivitystorage.cpp
activityfw/activityserviceplugin/src/afactivitystorage_p.cpp
activityfw/activityserviceplugin/src/afclient.cpp
activityfw/activityserviceplugin/src/afcommandlineparser.cpp
activityfw/activityserviceplugin/src/aflauncher.cpp
activityfw/activityserviceplugin/src/afmanager.cpp
activityfw/activityserviceplugin/src/afserviceplugin.cpp
activityfw/activityserviceplugin/src/afstorageproxy.cpp
activityfw/activityserviceplugin/src/applicationlauncher.cpp
activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc
activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro
activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp
activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.qrc
activityfw/rom/activitymanager_core.iby
activityfw/sis/activitymanager.pkg
activityfw/sis/stubs/activitymanager_stub.pkg
activityfw/sis/stubs/activitymanager_stub.sis
activityfw/storage/bwins/afstorageclientu.def
activityfw/storage/client/client.pro
activityfw/storage/client/group/bld.inf
activityfw/storage/client/group/client.mmp
activityfw/storage/client/inc/afasyncrequest_p.h
activityfw/storage/client/inc/afasyncrequestobserver.h
activityfw/storage/client/inc/afasyncsession.h
activityfw/storage/client/inc/afstorageclient.h
activityfw/storage/client/inc/afstorageclient_p.h
activityfw/storage/client/inc/afstorageclientimp.h
activityfw/storage/client/inc/afstorageentry.h
activityfw/storage/client/inc/afthumbnailrequest_p.h
activityfw/storage/client/s60/inc/afasyncrequest_p.h
activityfw/storage/client/s60/inc/afstorageclient_p.h
activityfw/storage/client/s60/inc/afstorageclientimp.h
activityfw/storage/client/s60/inc/afthumbnailrequest_p.h
activityfw/storage/client/s60/src/afasyncrequest_p.cpp
activityfw/storage/client/s60/src/afstorageclient_p.cpp
activityfw/storage/client/s60/src/afstorageclientimp.cpp
activityfw/storage/client/s60/src/afthumbnailrequest_p.cpp
activityfw/storage/client/src/afasyncrequest_p.cpp
activityfw/storage/client/src/afstorageclient.cpp
activityfw/storage/client/src/afstorageclient_p.cpp
activityfw/storage/client/src/afstorageclientimp.cpp
activityfw/storage/client/src/afstorageentry.cpp
activityfw/storage/client/src/afthumbnailrequest_p.cpp
activityfw/storage/common/common.pro
activityfw/storage/common/group/bld.inf
activityfw/storage/common/group/common.mmp
activityfw/storage/common/inc/afcmd.h
activityfw/storage/common/inc/afentry.h
activityfw/storage/common/inc/afglobals.h
activityfw/storage/common/src/afentry.cpp
activityfw/storage/eabi/afstorageclientu.def
activityfw/storage/inc/afcmd.h
activityfw/storage/inc/afstorageglobals.h
activityfw/storage/s60/inc/afentry.h
activityfw/storage/s60/inc/afglobals.h
activityfw/storage/s60/inc/afserializer.h
activityfw/storage/s60/src/afentry.cpp
activityfw/storage/s60/src/afserializer.cpp
activityfw/storage/server/group/server.mmp
activityfw/storage/server/inc/afapplicationscollection.h
activityfw/storage/server/inc/afapplicationsengine.h
activityfw/storage/server/inc/afapplicationsmonitor.h
activityfw/storage/server/inc/afapplicationsobserver.h
activityfw/storage/server/inc/afapplicationsregistry.h
activityfw/storage/server/inc/afapplicationsstorage.h
activityfw/storage/server/inc/afserver.h
activityfw/storage/server/inc/afstorage.h
activityfw/storage/server/inc/afstoragesynctask.h
activityfw/storage/server/src/afapplicationscollection.cpp
activityfw/storage/server/src/afapplicationsengine.cpp
activityfw/storage/server/src/afapplicationsmonitor.cpp
activityfw/storage/server/src/afapplicationsstorage.cpp
activityfw/storage/server/src/afbroadcasttask.cpp
activityfw/storage/server/src/afdataprovidertask.cpp
activityfw/storage/server/src/afserver.cpp
activityfw/storage/server/src/afsession.cpp
activityfw/storage/server/src/afstorage.cpp
activityfw/storage/server/src/afstorageasynctask.cpp
activityfw/storage/server/src/afstoragesynctask.cpp
activityfw/storage/storage.pro
common.pri
contentstorage/bwins/camenuu.def
contentstorage/bwins/cautilsu.def
contentstorage/caclient/caclient.pro
contentstorage/caclient/inc/caclient_defines.h
contentstorage/caclient/inc/caitemmodel_p.h
contentstorage/caclient/inc/caitemmodellist.h
contentstorage/caclient/s60/inc/cabitmapadapter.h
contentstorage/caclient/s60/inc/caobserver.h
contentstorage/caclient/s60/src/cabitmapadapter.cpp
contentstorage/caclient/s60/src/camenuiconutility.cpp
contentstorage/caclient/s60/src/caobserver.cpp
contentstorage/caclient/src/caentry.cpp
contentstorage/caclient/src/caiconcache.cpp
contentstorage/caclient/src/caitemmodel.cpp
contentstorage/caclient/src/caitemmodellist.cpp
contentstorage/caclient/src/caqtsfhandlerloader.cpp
contentstorage/caclient/stub/inc/hswidgetcomponentdescriptor.h
contentstorage/caclient/stub/src/hswidgetcomponentdescriptor.cpp
contentstorage/cahandler/app/app.pro
contentstorage/cahandler/tapp/tapp.pro
contentstorage/cahandler/url/url.pro
contentstorage/casoftwareregistry/casoftwareregistry.pri
contentstorage/casoftwareregistry/casoftwareregistry.pro
contentstorage/casoftwareregistry/s60/inc/caprogresscanner.h
contentstorage/casoftwareregistry/s60/inc/casoftwareregistry_p.h
contentstorage/casoftwareregistry/s60/inc/cauninstallnotifier_p.h
contentstorage/casoftwareregistry/s60/inc/cauninstallobserver.h
contentstorage/casoftwareregistry/s60/src/caprogresscanner.cpp
contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp
contentstorage/casoftwareregistry/s60/src/cauninstallnotifier_p.cpp
contentstorage/casoftwareregistry/s60/src/cauninstallobserver.cpp
contentstorage/casoftwareregistry/src/casoftwareregistry.cpp
contentstorage/casoftwareregistry/src/cauninstallnotifier.cpp
contentstorage/casoftwareregistry/stub/inc/casoftwareregistry_p.h
contentstorage/casoftwareregistry/stub/inc/cauninstallnotifier_p.h
contentstorage/casoftwareregistry/stub/inc/cauninstallobserver.h
contentstorage/casoftwareregistry/stub/src/casoftwareregistry_p.cpp
contentstorage/casoftwareregistry/stub/src/cauninstallnotifier_p.cpp
contentstorage/casoftwareregistry/stub/src/cauninstallobserver.cpp
contentstorage/casrv/caappscanner/inc/caappscannerhandler.h
contentstorage/casrv/caappscanner/inc/casrvappscanner.h
contentstorage/casrv/caappscanner/src/caappscannerhandler.cpp
contentstorage/casrv/caappscanner/src/casrvappscanner.cpp
contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h
contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp
contentstorage/casrv/casrvmgr/bwins/casrvmanageru.def
contentstorage/casrv/casrvmgr/eabi/casrvmanageru.def
contentstorage/casrv/casrvmgr/inc/casrvmanager.h
contentstorage/casrv/casrvmgr/inc/casrvplugin.h
contentstorage/casrv/casrvmgr/src/casrvmanager.cpp
contentstorage/casrv/causifscanner/inc/causifscanner.h
contentstorage/casrv/causifscanner/src/causifscanner.cpp
contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h
contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h
contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h
contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp
contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp
contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp
contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp
contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp
contentstorage/castorage/conf/CI_castoragedb.confml
contentstorage/castorage/conf/castoragedb.confml
contentstorage/castorage/conf/castoragedb.implml
contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql
contentstorage/castorage/data/castorage.db
contentstorage/castorage/data/castoragedb_create.sql
contentstorage/castorage/data/castoragedb_variant.sql
contentstorage/castorage/data/stub/castorage.db
contentstorage/castorage/inc/caconsts.h
contentstorage/castorage/inc/casqlcommands.h
contentstorage/castorage/inc/casqlitestorage.h
contentstorage/castorage/inc/casqlquerycreator.h
contentstorage/castorage/inc/castorage.h
contentstorage/castorage/src/casqlitestorage.cpp
contentstorage/castorage/src/casqlquerycreator.cpp
contentstorage/cautils/inc/caentryattribute.h
contentstorage/cautils/src/caentryattribute.cpp
contentstorage/data/backup_registration.xml
contentstorage/eabi/camenuu.def
contentstorage/eabi/cautilsu.def
contentstorage/group/camenu.mmp
contentstorage/group/group.pro
contentstorage/inc/cadef.h
contentstorage/srvinc/cabackupnotifier.h
contentstorage/srvinc/caprogressnotifier.h
contentstorage/srvinc/casrv.h
contentstorage/srvinc/castorageproxy.h
contentstorage/srvsrc/cabackupnotifier.cpp
contentstorage/srvsrc/caprogressnotifier.cpp
contentstorage/srvsrc/casrv.cpp
contentstorage/srvsrc/castorageproxy.cpp
homescreensrv.pro
homescreensrv_plat/activity_framework_api/activity_framework_api.metaxml
homescreensrv_plat/activity_framework_api/activity_framework_api.pri
homescreensrv_plat/activity_framework_api/afactivation.h
homescreensrv_plat/activity_framework_api/afactivities_global.h
homescreensrv_plat/activity_framework_api/afactivitylauncher.h
homescreensrv_plat/activity_framework_api/afactivitystorage.h
homescreensrv_plat/activity_framework_api/afstorageglobals.h
homescreensrv_plat/contentstorage_api/caitemmodel.h
homescreensrv_plat/contentstorage_api/casoftwareregistry.h
homescreensrv_plat/contentstorage_api/cauninstallnotifier.h
homescreensrv_plat/contentstorage_api/contentstorage_api.metaxml
homescreensrv_plat/contentstorage_api/contentstorage_api.pri
homescreensrv_plat/homescreen_information_api/homescreen_information_api.metaxml
homescreensrv_plat/homescreensrv_plat.pro
homescreensrv_plat/hswidgetmodel_api/hswidgetmodel_api.metaxml
homescreensrv_plat/hswidgetmodel_api/hswidgetmodel_global.h
homescreensrv_plat/taskswitcher_api/taskswitcher_api.metaxml
homescreensrv_plat/taskswitcher_api/taskswitcher_api.pri
homescreensrv_plat/taskswitcher_api/tspropertydefs.h
homescreensrv_plat/taskswitcher_api/tstaskmonitor_global.h
hsappkeyhandler/group/hsappkeyplugin.mmp
hsappkeyhandler/src/hsappkeyplugin.cpp
rom/homescreensrv_core.iby
taskswitcher/testapplications/tstestpluginmanager/tspluginmanager/resource/tspluginmanager.qcrml
tsdevicedialog/common.pri
tsdevicedialog/tsdevicedialog.pro
tsdevicedialog/tsdevicedialogplugin/inc/tsactivitymodelitem.h
tsdevicedialog/tsdevicedialogplugin/inc/tsdataroles.h
tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogcontainer.h
tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogplugin.h
tsdevicedialog/tsdevicedialogplugin/inc/tsdocumentloader.h
tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h
tsdevicedialog/tsdevicedialogplugin/inc/tstasksgriditem.h
tsdevicedialog/tsdevicedialogplugin/resource/layout.docml
tsdevicedialog/tsdevicedialogplugin/src/tsactivitymodelitem.cpp
tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogcontainer.cpp
tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp
tsdevicedialog/tsdevicedialogplugin/src/tsdocumentloader.cpp
tsdevicedialog/tsdevicedialogplugin/src/tsentrymodelitem.cpp
tsdevicedialog/tsdevicedialogplugin/src/tsmodel.cpp
tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp
tsdevicedialog/tsdevicedialogplugin/taskswitcher.qm
tsdevicedialog/tsdevicedialogplugin/taskswitcher.ts
tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.pro
tstaskmonitor/backstepping/backstepping.pro
tstaskmonitor/backstepping/bwins/tsbacksteppingu.def
tstaskmonitor/backstepping/eabi/tsbacksteppingu.def
tstaskmonitor/backstepping/group/bld.inf
tstaskmonitor/backstepping/group/tsbackstepping.mmp
tstaskmonitor/backstepping/inc/tsbackstepping.h
tstaskmonitor/backstepping/inc/tsbacksteppingactivation.h
tstaskmonitor/backstepping/src/tsbackstepping.cpp
tstaskmonitor/backstepping/src/tsbacksteppingactivation.cpp
tstaskmonitor/client/client.pri
tstaskmonitor/client/client.pro
tstaskmonitor/client/inc/tstask.h
tstaskmonitor/client/inc/tstaskmonitor.h
tstaskmonitor/client/inc/tstaskmonitor_global.h
tstaskmonitor/client/s60/inc/tsapplicationtask.h
tstaskmonitor/client/s60/inc/tsscreenshotclient.h
tstaskmonitor/client/s60/inc/tsscreenshotclientimpl.h
tstaskmonitor/client/s60/inc/tssession.h
tstaskmonitor/client/s60/inc/tstaskmonitor_p.h
tstaskmonitor/client/s60/inc/tstaskmonitorclient.h
tstaskmonitor/client/s60/inc/tstaskmonitorclientimpl.h
tstaskmonitor/client/s60/inc/tstaskmonitorobserver.h
tstaskmonitor/client/s60/inc/tstasksettings_p.h
tstaskmonitor/client/s60/src/tsapplicationtask.cpp
tstaskmonitor/client/s60/src/tsscreenshotclient.cpp
tstaskmonitor/client/s60/src/tsscreenshotclientimpl.cpp
tstaskmonitor/client/s60/src/tssession.cpp
tstaskmonitor/client/s60/src/tstask.cpp
tstaskmonitor/client/s60/src/tstaskmonitor_p.cpp
tstaskmonitor/client/s60/src/tstaskmonitorclient.cpp
tstaskmonitor/client/s60/src/tstaskmonitorclientimpl.cpp
tstaskmonitor/client/s60/src/tstasksettings_p.cpp
tstaskmonitor/client/src/tstaskmonitor.cpp
tstaskmonitor/client/src/tstasksettings.cpp
tstaskmonitor/client/stub/inc/tsentry.h
tstaskmonitor/client/stub/inc/tstaskmonitor_p.h
tstaskmonitor/client/stub/inc/tstasksettings_p.h
tstaskmonitor/client/stub/src/tsentry.cpp
tstaskmonitor/client/stub/src/tstask.cpp
tstaskmonitor/client/stub/src/tstaskmonitor_p.cpp
tstaskmonitor/client/stub/src/tstasksettings_p.cpp
tstaskmonitor/inc/tstaskmonitorglobals.h
tstaskmonitor/rom.pri
tstaskmonitor/rom/tstaskmonitor_core.iby
tstaskmonitor/screenshotplugin/group/bld.inf
tstaskmonitor/screenshotplugin/group/tsscreenshotplugin.mmp
tstaskmonitor/screenshotplugin/inc/tsscreenshotplugin.h
tstaskmonitor/screenshotplugin/screenshotplugin.pro
tstaskmonitor/screenshotplugin/src/tsscreenshotmain.cpp
tstaskmonitor/screenshotplugin/src/tsscreenshotplugin.cpp
tstaskmonitor/screenshotplugin/src/tsscreenshotplugin.rss
tstaskmonitor/server/group/bld.inf
tstaskmonitor/server/group/hsrunningappmonitor.mmp
tstaskmonitor/server/inc/hsdataobservertask.h
tstaskmonitor/server/inc/hsdataprovider.h
tstaskmonitor/server/inc/hsdataprovidertask.h
tstaskmonitor/server/inc/hsrunningappserver.h
tstaskmonitor/server/inc/hsrunningappsession.h
tstaskmonitor/server/inc/tsdatalist.h
tstaskmonitor/server/inc/tsdatastorage.h
tstaskmonitor/server/inc/tsdatatask.h
tstaskmonitor/server/inc/tsrunningappstorage.h
tstaskmonitor/server/inc/tsscreenshotprovider.h
tstaskmonitor/server/server.pro
tstaskmonitor/server/src/hsdataobservertask.cpp
tstaskmonitor/server/src/hsdataprovidertask.cpp
tstaskmonitor/server/src/hsrunningappserver.cpp
tstaskmonitor/server/src/hsrunningappsession.cpp
tstaskmonitor/server/src/main.cpp
tstaskmonitor/server/src/tsdatalist.cpp
tstaskmonitor/server/src/tsdatatask.cpp
tstaskmonitor/server/src/tsrunningappstorage.cpp
tstaskmonitor/server/src/tsscreenshotprovider.cpp
tstaskmonitor/sis/stubs/createstubs.bat
tstaskmonitor/sis/stubs/taskmonitor_stub.pkg
tstaskmonitor/sis/stubs/taskmonitor_stub.sis
tstaskmonitor/sis/taskmonitor.pkg
tstaskmonitor/tstaskmonitor.pro
tstaskmonitor/utils/inc/tsdataobserver.h
tstaskmonitor/utils/inc/tsentry.h
tstaskmonitor/utils/inc/tsentrykey.h
tstaskmonitor/utils/inc/tsentrykeygenerator.h
tstaskmonitor/utils/inc/tsutils.h
tstaskmonitor/utils/src/tsentry.cpp
tstaskmonitor/utils/src/tsentrykey.cpp
tstaskmonitor/utils/src/tsentrykeygenerator.cpp
--- a/activityfw/activitydatabase/activitydatabase.pro	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE = subdirs
-
-SUBDIRS += hsactivitydbclient \
-           hsactivitydbserver
--- a/activityfw/activitydatabase/bwins/hsactivitydbclientu.def	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-EXPORTS
-	?launchActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 1 NONAME ; int HsActivityDbClient::launchActivity(class QHash<class QString, class QVariant> const &)
-	?connect@HsActivityDbClient@@QAEHXZ @ 2 NONAME ; int HsActivityDbClient::connect(void)
-	?asyncRequestCompleated@HsActivityDbClient@@UAEXHHABVQString@@@Z @ 3 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int, class QString const &)
-	?trUtf8@HsActivityDbClient@@SA?AVQString@@PBD0@Z @ 4 NONAME ; class QString HsActivityDbClient::trUtf8(char const *, char const *)
-	?applicationActivities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 5 NONAME ; int HsActivityDbClient::applicationActivities(class QList<class QHash<class QString, class QVariant> > &, class QHash<class QString, class QVariant> const &)
-	?getThumbnail@HsActivityDbClient@@QAEHVQSize@@VQString@@1PAX@Z @ 6 NONAME ; int HsActivityDbClient::getThumbnail(class QSize, class QString, class QString, void *)
-	?dataChanged@HsActivityDbClient@@IAEXXZ @ 7 NONAME ; void HsActivityDbClient::dataChanged(void)
-	?qt_metacast@HsActivityDbClient@@UAEPAXPBD@Z @ 8 NONAME ; void * HsActivityDbClient::qt_metacast(char const *)
-	?qt_metacall@HsActivityDbClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int HsActivityDbClient::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?waitActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 10 NONAME ; int HsActivityDbClient::waitActivity(class QHash<class QString, class QVariant> const &)
-	?activities@HsActivityDbClient@@UAEHAAV?$QList@V?$QHash@VQString@@VQVariant@@@@@@@Z @ 11 NONAME ; int HsActivityDbClient::activities(class QList<class QHash<class QString, class QVariant> > &)
-	?notifyDataChange@HsActivityDbClient@@QAEHXZ @ 12 NONAME ; int HsActivityDbClient::notifyDataChange(void)
-	?trUtf8@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString HsActivityDbClient::trUtf8(char const *, char const *, int)
-	?asyncRequestCompleated@HsActivityDbClient@@UAEXHH@Z @ 14 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int)
-	??0HsActivityDbClient@@QAE@PAVQObject@@@Z @ 15 NONAME ; HsActivityDbClient::HsActivityDbClient(class QObject *)
-	?tr@HsActivityDbClient@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *)
-	?getStaticMetaObject@HsActivityDbClient@@SAABUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const & HsActivityDbClient::getStaticMetaObject(void)
-	??_EHsActivityDbClient@@UAE@I@Z @ 18 NONAME ; HsActivityDbClient::~HsActivityDbClient(unsigned int)
-	?removeApplicationActivities@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 19 NONAME ; int HsActivityDbClient::removeApplicationActivities(class QHash<class QString, class QVariant> const &)
-	?metaObject@HsActivityDbClient@@UBEPBUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const * HsActivityDbClient::metaObject(void) const
-	?tr@HsActivityDbClient@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString HsActivityDbClient::tr(char const *, char const *, int)
-	?addActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@0@Z @ 22 NONAME ; int HsActivityDbClient::addActivity(class QHash<class QString, class QVariant> const &, class QHash<class QString, class QVariant> const &)
-	?asyncRequestCompleated@HsActivityDbClient@@UAEXHHABVQPixmap@@PAX@Z @ 23 NONAME ; void HsActivityDbClient::asyncRequestCompleated(int, int, class QPixmap const &, void *)
-	?staticMetaObject@HsActivityDbClient@@2UQMetaObject@@B @ 24 NONAME ; struct QMetaObject const HsActivityDbClient::staticMetaObject
-	?updateActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@0@Z @ 25 NONAME ; int HsActivityDbClient::updateActivity(class QHash<class QString, class QVariant> const &, class QHash<class QString, class QVariant> const &)
-	??1HsActivityDbClient@@UAE@XZ @ 26 NONAME ; HsActivityDbClient::~HsActivityDbClient(void)
-	?thumbnailRequested@HsActivityDbClient@@IAEXVQPixmap@@PAX@Z @ 27 NONAME ; void HsActivityDbClient::thumbnailRequested(class QPixmap, void *)
-	?activityRequested@HsActivityDbClient@@IAEXABVQString@@@Z @ 28 NONAME ; void HsActivityDbClient::activityRequested(class QString const &)
-	?removeActivity@HsActivityDbClient@@UAEHABV?$QHash@VQString@@VQVariant@@@@@Z @ 29 NONAME ; int HsActivityDbClient::removeActivity(class QHash<class QString, class QVariant> const &)
-	?activityData@HsActivityDbClient@@UAEHAAVQVariant@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 30 NONAME ; int HsActivityDbClient::activityData(class QVariant &, class QHash<class QString, class QVariant> const &)
-
--- a/activityfw/activitydatabase/eabi/hsactivitydbclientu.def	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-EXPORTS
-	_ZN18HsActivityDbClient10activitiesER5QListI5QHashI7QString8QVariantEE @ 1 NONAME
-	_ZN18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantES5_ @ 2 NONAME
-	_ZN18HsActivityDbClient11dataChangedEv @ 3 NONAME
-	_ZN18HsActivityDbClient11qt_metacallEN11QMetaObject4CallEiPPv @ 4 NONAME
-	_ZN18HsActivityDbClient11qt_metacastEPKc @ 5 NONAME
-	_ZN18HsActivityDbClient12getThumbnailE5QSize7QStringS1_Pv @ 6 NONAME
-	_ZN18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 7 NONAME
-	_ZN18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 8 NONAME
-	_ZN18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 9 NONAME
-	_ZN18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantES5_ @ 10 NONAME
-	_ZN18HsActivityDbClient16notifyDataChangeEv @ 11 NONAME
-	_ZN18HsActivityDbClient16staticMetaObjectE @ 12 NONAME DATA 16
-	_ZN18HsActivityDbClient17activityRequestedERK7QString @ 13 NONAME
-	_ZN18HsActivityDbClient18thumbnailRequestedE7QPixmapPv @ 14 NONAME
-	_ZN18HsActivityDbClient19getStaticMetaObjectEv @ 15 NONAME
-	_ZN18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 16 NONAME
-	_ZN18HsActivityDbClient22asyncRequestCompleatedEii @ 17 NONAME
-	_ZN18HsActivityDbClient22asyncRequestCompleatedEiiRK7QPixmapPv @ 18 NONAME
-	_ZN18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 19 NONAME
-	_ZN18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 20 NONAME
-	_ZN18HsActivityDbClient7connectEv @ 21 NONAME
-	_ZN18HsActivityDbClientC1EP7QObject @ 22 NONAME
-	_ZN18HsActivityDbClientC2EP7QObject @ 23 NONAME
-	_ZN18HsActivityDbClientD0Ev @ 24 NONAME
-	_ZN18HsActivityDbClientD1Ev @ 25 NONAME
-	_ZN18HsActivityDbClientD2Ev @ 26 NONAME
-	_ZNK18HsActivityDbClient10metaObjectEv @ 27 NONAME
-	_ZTI18HsActivityDbClient @ 28 NONAME
-	_ZTV18HsActivityDbClient @ 29 NONAME
-	_ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEii @ 30 NONAME
-	_ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEiiRK7QPixmapPv @ 31 NONAME
-	_ZThn12_N18HsActivityDbClient22asyncRequestCompleatedEiiRK7QString @ 32 NONAME
-	_ZThn8_N18HsActivityDbClient10activitiesER5QListI5QHashI7QString8QVariantEE @ 33 NONAME
-	_ZThn8_N18HsActivityDbClient11addActivityERK5QHashI7QString8QVariantES5_ @ 34 NONAME
-	_ZThn8_N18HsActivityDbClient12waitActivityERK5QHashI7QString8QVariantE @ 35 NONAME
-	_ZThn8_N18HsActivityDbClient14launchActivityERK5QHashI7QString8QVariantE @ 36 NONAME
-	_ZThn8_N18HsActivityDbClient14removeActivityERK5QHashI7QString8QVariantE @ 37 NONAME
-	_ZThn8_N18HsActivityDbClient14updateActivityERK5QHashI7QString8QVariantES5_ @ 38 NONAME
-	_ZThn8_N18HsActivityDbClient21applicationActivitiesER5QListI5QHashI7QString8QVariantEERKS4_ @ 39 NONAME
-	_ZThn8_N18HsActivityDbClient27removeApplicationActivitiesERK5QHashI7QString8QVariantE @ 40 NONAME
-	_ZN18HsActivityDbClient12activityDataER8QVariantRK5QHashI7QStringS0_E @ 41 NONAME
-	_ZThn8_N18HsActivityDbClient12activityDataER8QVariantRK5QHashI7QStringS0_E @ 42 NONAME
-
--- a/activityfw/activitydatabase/hsactivitydbclient/hsactivitydbclient.pro	Tue Jul 06 14:37:10 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: 
-#
-
-TEMPLATE = lib
-TARGET = hsactivitydbclient
-
-QT        += core \
-             sql
-
-HEADERS   += inc/hsactivitydbclient.h
-
-SOURCES   += src/hsactivitydbclient.cpp
-
-DEFINES += ACTIVITY_LIB
-
-symbian{
-TARGET.UID3 = 0xE467C21E
-
-HEADERS   += ../s60/inc/afentry.h \
-             ../s60/inc/hsserializer.h \
-             s60/inc/hsactivitydbclient_p.h \
-			 s60/inc/hsactivitydbasyncrequest_p.h
-
-SOURCES   += ../s60/src/afentry.cpp \
-             ../s60/src/hsserializer.cpp \
-             s60/src/hsactivitydbclient_p.cpp \
-			 s60/src/hsactivitydbasyncrequest_p.cpp
-
-LIBS      += -lxqutils \
-             -lestor \
-             -lfbscli
-
-
-hsactivitydbclientdll.sources = hsactivitydbclient.dll
-hsactivitydbclientdll.path = $$SHARED_LIB_DIR
-DEPLOYMENT += hsactivitydbclientdll
-
-BLD_INF_RULES.prj_exports += "../inc/hsactivitydbclientinterface.h /epoc32/include/hsactivitydbclientinterface.h" \
-                             "../inc/activitycmd.h /epoc32/include/activitycmd.h" \
-                             "inc/hsactivitydbclient.h /epoc32/include/hsactivitydbclient.h" \
-							 "inc/hsactivitydbasyncrequestobserver.h /epoc32/include/hsactivitydbasyncrequestobserver.h"
-DEPLOYMENT += api
-TARGET.CAPABILITY = ALL -TCB
-TARGET.EPOCALLOWDLLDATA = 1
-TARGET.UID3 = 0x200267B3
-MMP_RULES += EXPORTUNFROZEN
-}
--- a/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbasyncrequestobserver.h	Tue Jul 06 14:37:10 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 HSACTIVITYDBASYNCREQUESTOBSERVER_H
-#define HSACTIVITYDBASYNCREQUESTOBSERVER_H
-#include <QString>
-#include <QPixmap>
-
-class HsActivityDbAsyncRequestObserver
-{
-public:
-    /**
-     * Function inform observer about asynchronous request results
-     * @param result - request result
-     * @param requestType - request type
-     * @param data - respons data
-     */
-    virtual void asyncRequestCompleated(int result,
-                                        int requestType,
-                                        const QString &data)=0;
-
-    /**
-     * Function inform observer about asynchronous request results
-     * @param result - request result
-     * @param requestType - request type
-     * @param pixmap - pixmap respons
-     */
-    virtual void asyncRequestCompleated(int result,
-                                        int requestType,
-                                        const QPixmap& pixmap, 
-                                        void* userData)=0;
-    
-    /**
-     * Function inform observer about asynchronous request results
-     * @param result - request result
-     * @param requestType - request type
-     */
-    virtual void asyncRequestCompleated(int result,
-                                        int requestType)=0;
-};
-#endif // HSACTIVITYDBASYNCREQUESTOBSERVER_H
--- a/activityfw/activitydatabase/hsactivitydbclient/inc/hsactivitydbclient.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef HSACTIVITYDBCLIENT_H
-#define HSACTIVITYDBCLIENT_H
-#include <QObject>
-#include <hsactivitydbasyncrequestobserver.h>
-#include "hsactivitydbclientinterface.h"
-
-#ifdef ACTIVITY_LIB
-    #define ACTIVITY_EXPORT Q_DECL_EXPORT
-#else
-    #define ACTIVITY_EXPORT Q_DECL_IMPORT
-#endif
-
-class HsActivityDbClientPrivate;
-
-/**
- * Class implemets HsActivityDbClientInterface and is responsible for activity data management.
- */
-class ACTIVITY_EXPORT HsActivityDbClient:   public QObject,
-                                            public HsActivityDbClientInterface,
-                                            public HsActivityDbAsyncRequestObserver
-{
-    Q_OBJECT
-public:
-    /**
-     * Constructor
-     */
-    HsActivityDbClient(QObject* =0);
-
-    /**
-     * Destructor
-     */
-    ~HsActivityDbClient();
-
-    /**
-     * Establish connection with activity server
-     * @return 0 on succees, error code otherwise
-     */
-    int connect();
-
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbAsyncRequestObserver::asyncRequestCompleated(int, int, const QString&)
-     */
-    void asyncRequestCompleated(int, int, const QString &);
-
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbAsyncRequestObserver::asyncRequestCompleated(int, int, QPixmap&)
-     */
-    void asyncRequestCompleated(int, int, const QPixmap&, void*);
-    
-
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbAsyncRequestObserver::asyncRequestCompleated(int, int)
-     */
-    void asyncRequestCompleated(int result,
-                                int requestType);
-
-    int addActivity(const QVariantHash &, const QVariantHash &);
-
-    int updateActivity(const QVariantHash &, const QVariantHash &);
-
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbClientInterface::deleteActivity(const QVariantHash &)
-     */
-    int removeActivity(const QVariantHash &activity);
-
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbClientInterface::deleteApplicationActivities(const QVariantHash &)
-     */
-    int removeApplicationActivities(const QVariantHash &activity);
-
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbClientInterface::activities(QList<QVariantHash>&)
-     */
-    int activities(QList<QVariantHash> &);
-
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbClientInterface::applicationActivities(QList<QVariantHash> &, const QVariantHash &)
-     */
-    int applicationActivities(QList<QVariantHash> &,
-                              const QVariantHash &);
-
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbClientInterface::activityData(QVariant &, const QVariantHash &)
-     */
-    int activityData(QVariant &result, const QVariantHash &activity);
-                              
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &)
-     */
-    int waitActivity(const QVariantHash &activity);
-    
-    /**
-     * Interface implementation.
-     * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &)
-     */
-    int launchActivity(const QVariantHash &);
-    
-    /**
-     */
-    //getThumbnail(resolution, thumbnailPath, "image/png", data)
-    int getThumbnail(QSize size, QString imagePath, QString mimeType, void* userDdata);
-    
-    int notifyDataChange();
-
-signals:
-    /**
-     * Function notify about runtime activity change
-     * @param activityId - requested activity name
-     */
-    void activityRequested(const QString &activityId);
-
-    /**
-     * Function notify about runtime activity change
-     * @param thumbnailPixmap - requested thumbnail
-     */
-    void thumbnailRequested(QPixmap thumbnailPixmap, void *userData);
-    
-    void dataChanged();
-    
-private:
-    /**
-     * Private client implementation.
-     * Own.
-     */
-    HsActivityDbClientPrivate *d_ptr;
-    
-    friend class HsActivityDbClientPrivate;
-};
-
-#endif //HSACTIVITYDBCLIENT_H
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbasyncrequest_p.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef HSACTIVITYDBASYNCREQUESTPRIVATE_H
-#define HSACTIVITYDBASYNCREQUESTPRIVATE_H
-#include <e32base.h>
-#include <QVariant>
-#include <QPixmap>
-#include <hsactivitydbasyncrequestobserver.h>
-#include <activitycmd.h>
-
-class HsActivityDbClientPrivate;
-
-/**
- * Class is responsible for async. request handling
- */
-class HsActivityDbAsyncRequestPrivate : public CActive
-
-{
-public:
-    
-    enum TAsyncRequest{
-        EWaitActivity = WaitActivity,
-        EWaitGetThumbnail = GetThumbnail,
-        ENotifyDataChange = NotifyChange
-    };
-    
-private:
-    static HsActivityDbAsyncRequestPrivate*
-    NewLC(HsActivityDbAsyncRequestObserver &, 
-          HsActivityDbClientPrivate &,
-          TAsyncRequest,
-          void* userData = 0);
-    
-public:
-    
-    static void waitActivityLD(HsActivityDbAsyncRequestObserver &, 
-                               HsActivityDbClientPrivate &,
-                               const QVariantHash &);
-    
-    static void notifyDataChangeLD(HsActivityDbAsyncRequestObserver &, 
-                                   HsActivityDbClientPrivate &);
-    
-    static void getThumbnailLD(HsActivityDbAsyncRequestObserver &,
-                               HsActivityDbClientPrivate &, 
-                               QSize, 
-                               const QString&, 
-                               const QString&, 
-                               void *);
-    
-
-    /**
-     * Destructor
-     */
-    ~HsActivityDbAsyncRequestPrivate();
-
-private:
-    /**
-     * Function create subscription to current ativity changes
-     * @param condition - activity filetering rules
-     */
-    void waitActivity(const QVariantHash &condition);
-    
-    /**
-     */
-    void getThumbnail(QSize size, QString imagePath, QString  mimeType);
-    
-    void notifyDataChange();
-protected:
-    /**
-     * Interface implementation.
-     * @see void CActive::DoCancel()
-     */
-    void DoCancel();
-
-    /**
-     * Interface implementation.
-     * @see void CActive::DoCancel()
-     */
-    void RunL();
-private:
-    /**
-     * Constructor
-     */
-    HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &, 
-                                    HsActivityDbClientPrivate &,
-                                    TAsyncRequest,
-                                    void* userData);
-private:
-    HsActivityDbAsyncRequestObserver &mObserver;
-    HsActivityDbClientPrivate &mSession;
-    const TAsyncRequest mRequestType;
-    TPckgBuf<int> mTaskId;
-    TPckgBuf<int> mDataSize;
-    TPckgBuf<int> mBitmapId;
-    HBufC* mBitmapPath;
-    HBufC8* mBitmapMimeType;
-    RBuf8 mDataBuf;
-    void *const mUserData;
-};
-#endif // HSACTIVITYDBCLIENTPRIVATE_H
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/inc/hsactivitydbclient_p.h	Tue Jul 06 14:37:10 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:
-*
-*/
-
-#ifndef HSACTIVITYDBCLIENTPRIVATE_H
-#define HSACTIVITYDBCLIENTPRIVATE_H
-#include "hsactivitydbclientinterface.h"
-#include <e32base.h>
-#include <hsactivitydbasyncrequestobserver.h>
-
-class HsActivityDbAsyncRequestPrivate;
-/**
- * Class implemets HsActivityDbClientInterface and is responsible for
- * activity data management on S60 enviroment.
- */
-class HsActivityDbClientPrivate : protected RSessionBase,
-                                  public HsActivityDbClientInterface
-{
-public:
-    HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver &);
-
-    ~HsActivityDbClientPrivate();
-
-    int connect();
-
-    int addActivity(const QVariantHash &privateData, 
-                    const QVariantHash &publicData);
-
-    int updateActivity(const QVariantHash &privateData, 
-                       const QVariantHash &publicData);
-
-    int removeActivity(const QVariantHash &activity);
-
-    int removeApplicationActivities(const QVariantHash &activity);
-
-    int activities(QList<QVariantHash> &);
-
-    int applicationActivities(QList<QVariantHash>&, const QVariantHash &);
-
-    int activityData(QVariant &result, const QVariantHash &activity);
-    
-    int waitActivity(const QVariantHash &activity);
-    
-    int getThumbnail(QSize size, QString imagePath, QString  mimeType, void *userDdata);
-    
-    int notifyDataChange();
-
-    int launchActivity(const QVariantHash &);
-
-    int cancelWaitActivity();
-
-    int cancelNotifyDataChange();
-
-public:
-    void getData(int taskId, RBuf8 &dst);
-
-    void sendDataAsync(int func,const TIpcArgs &data, TRequestStatus &status);
-
-public:
-    void PushL(HsActivityDbAsyncRequestPrivate * task);
-
-    void Pop(HsActivityDbAsyncRequestPrivate *task);
-
-private:
-    void startServerL();
-
-    void connectL();
-
-    void execSimpleRequestL(int function, 
-                            const QVariantHash &privateData, 
-                            const QVariantHash &publicData);
-
-
-    void activitiesL(QList<QVariantHash>& result);
-
-    void applicationActivitiesL(QList<QVariantHash>& result,
-                                const QVariantHash &cond);
-
-    void activityDataL(QVariant &result, const QVariantHash &activity);
-
-    void launchActivityL(const QVariantHash &activity);
-
-    void getThumbnailL(QSize size, QString imagePath, QString  mimeType, void *userDdata);
-
-    int checkDataConstraint(int func, const QVariantHash &data);
-
-    int execute(int func, const QVariantHash &privateData, const QVariantHash &publicData);
-
-    int execute(int func, QList<QVariantHash>&dst, const QVariantHash &src);
-
-private:
-    RPointerArray<HsActivityDbAsyncRequestPrivate> mAsyncTasks;
-    HsActivityDbAsyncRequestObserver& mObserver;
-};
-#endif // HSACTIVITYDBCLIENTPRIVATE_H
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbasyncrequest_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,225 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "hsactivitydbasyncrequest_p.h"
-#include "hsactivitydbclient_p.h"
-#include "hsactivitydbclient.h"
-#include <fbs.h>
-#include <XQConversions>
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityDbAsyncRequestPrivate*
-HsActivityDbAsyncRequestPrivate::NewLC(HsActivityDbAsyncRequestObserver &observer,
-                                      HsActivityDbClientPrivate &session, 
-                                      TAsyncRequest requestType,
-                                      void* userData)
-{
-    HsActivityDbAsyncRequestPrivate *self = 
-    new(ELeave)HsActivityDbAsyncRequestPrivate(observer, session, requestType, userData);
-    CleanupStack::PushL(self);
-    self->mDataBuf.CreateL(64);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbAsyncRequestPrivate::waitActivityLD(
-                                HsActivityDbAsyncRequestObserver & observer, 
-                                HsActivityDbClientPrivate & session, 
-                                const QVariantHash &activity)
-{
-    HsActivityDbAsyncRequestPrivate *self =
-        HsActivityDbAsyncRequestPrivate::NewLC(observer, 
-                                               session, 
-                                               EWaitActivity);
-    self->mSession.PushL(self);
-    CleanupStack::Pop(self);
-    self->waitActivity(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbAsyncRequestPrivate::notifyDataChangeLD(
-                                   HsActivityDbAsyncRequestObserver &observer, 
-                                   HsActivityDbClientPrivate &session)
-{
-    HsActivityDbAsyncRequestPrivate *self = 
-        HsActivityDbAsyncRequestPrivate::NewLC(observer, 
-                                              session,
-                                              ENotifyDataChange);
-    self->mSession.PushL(self);
-    CleanupStack::Pop(self);
-    self->notifyDataChange();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbAsyncRequestPrivate::getThumbnailLD(HsActivityDbAsyncRequestObserver &observer,
-                                      HsActivityDbClientPrivate &session, 
-                                      QSize size, 
-                                      const QString &imagePath, 
-                                      const QString &mimeType, 
-                                      void *userDdata)
-{
-    HsActivityDbAsyncRequestPrivate *instance = 
-        HsActivityDbAsyncRequestPrivate::NewLC(observer, session, EWaitGetThumbnail, userDdata);
-    session.PushL(instance);
-    CleanupStack::Pop(instance);
-    instance->getThumbnail( size, imagePath, mimeType);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityDbAsyncRequestPrivate::HsActivityDbAsyncRequestPrivate(HsActivityDbAsyncRequestObserver &observer,
-                                                                 HsActivityDbClientPrivate &session,
-                                                                 TAsyncRequest requestType, 
-                                                                 void* userData)
-    :
-    CActive(EPriorityStandard),
-    mObserver(observer),
-    mSession(session),
-    mRequestType(requestType),
-    mUserData(userData)
-{
-    CActiveScheduler::Add(this);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityDbAsyncRequestPrivate::~HsActivityDbAsyncRequestPrivate()
-{
-    mDataBuf.Close();
-    Cancel();
-    delete mBitmapPath;
-    delete mBitmapMimeType;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbAsyncRequestPrivate::DoCancel()
-{
-    if (IsActive()) {
-        switch (mRequestType) {
-        case EWaitActivity: mSession.cancelWaitActivity(); break;
-        case ENotifyDataChange: mSession.cancelNotifyDataChange(); break;
-        };
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbAsyncRequestPrivate::RunL()
-{
-    switch (mRequestType) {
-    case WaitActivity: {
-        QString data;
-        if (KErrNone == iStatus.Int()) {
-            RBuf8 buff;
-            CleanupClosePushL(buff);
-            if (0 < mDataSize()) {
-                buff.CreateL(mDataSize());
-            }
-            mSession.getData(mTaskId(), buff);
-            data = QString::fromAscii(reinterpret_cast<const char *>(buff.Ptr()),
-                                      buff.Length());
-            CleanupStack::PopAndDestroy(&buff);
-        }
-        mObserver.asyncRequestCompleated(iStatus.Int(), mRequestType, data);
-        mSession.Pop(this);
-        delete this;
-        break;
-        }
-    case EWaitGetThumbnail: {
-        QPixmap pixmap;
-        if (KErrNone == iStatus.Int()) {
-            CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-            CleanupStack::PushL(bitmap);
-            User::LeaveIfError(bitmap->Duplicate(mBitmapId()));
-            mSession.getData(mTaskId(), mDataBuf);//ACK Bitmap copy
-            pixmap = QPixmap::fromSymbianCFbsBitmap(bitmap);
-            CleanupStack::PopAndDestroy(bitmap);
-        }
-        mObserver.asyncRequestCompleated(iStatus.Int(), mRequestType, pixmap, mUserData);
-        mSession.Pop(this);
-        delete this;
-        break;
-        }
-    case ENotifyDataChange: {
-        mObserver.asyncRequestCompleated(iStatus.Int(),mRequestType);
-        mSession.Pop(this);
-        delete this;
-        }
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbAsyncRequestPrivate::waitActivity(const QVariantHash &condition)
-{
-    iStatus = KRequestPending;
-    SetActive();
-    mDataSize = condition.find(ActivityApplicationKeyword).value().toInt();
-    TPtrC8 actId(KNullDesC8);
-    TPtrC8 desc(KNullDesC8);
-    mSession.sendDataAsync(mRequestType, TIpcArgs(&mDataSize, &actId, &desc, &mTaskId), iStatus);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbAsyncRequestPrivate::getThumbnail(QSize size, QString imagePath, QString  mimeType)
-{
-    iStatus = KRequestPending;
-    SetActive();
-    mBitmapId = size.width();
-    mTaskId = size.height();
-    mBitmapPath = XQConversions::qStringToS60Desc(imagePath);
-    mBitmapMimeType = XQConversions::qStringToS60Desc8(mimeType);
-    mSession.sendDataAsync(mRequestType, TIpcArgs(&mBitmapId, &mTaskId, mBitmapPath, mBitmapMimeType), iStatus);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbAsyncRequestPrivate::notifyDataChange()
-{
-    iStatus = KRequestPending;
-    SetActive();
-    mSession.sendDataAsync(ENotifyDataChange, TIpcArgs(), iStatus);
-}
--- a/activityfw/activitydatabase/hsactivitydbclient/s60/src/hsactivitydbclient_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,643 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <fbs.h>
-#include <s32mem.h>
-
-#include <qvariant.h>
-#include <XQConversions>
-
-#include "hsactivitydbclient_p.h"
-#include "hsactivitydbasyncrequest_p.h"
-#include "hsactivityglobals.h"
-#include "hsserializer.h"
-#include "afentry.h"
-
-
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor
- */
-HsActivityDbClientPrivate::HsActivityDbClientPrivate(HsActivityDbAsyncRequestObserver &observer):
-    mObserver(observer)
-{
-
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor
- */
-HsActivityDbClientPrivate::~HsActivityDbClientPrivate()
-{
-    mAsyncTasks.ResetAndDestroy();
-    Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function establish connection to activity server
- * @return 0 on succees, error code otherwise
- */
-int HsActivityDbClientPrivate::connect()
-{
-    TRAPD(errNo, connectL());
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::addActivity(const QVariantHash &)
- */
-int HsActivityDbClientPrivate::addActivity(const QVariantHash &privateData,
-                                           const QVariantHash &publicData)
-{
-    return execute(AddActivity, privateData, publicData);
-    
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash &)
- */
-int HsActivityDbClientPrivate::updateActivity(const QVariantHash &privateData,
-                                              const QVariantHash &publicData)
-{
-    return execute(UpdateActivity, privateData, publicData);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::removeActivity(const QVariantHash &)
- */
-int HsActivityDbClientPrivate::removeActivity(const QVariantHash &activity)
-{
-    return execute(RemoveActivity, QVariantHash(), activity);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::removeApplicationActivities(const QVariantHash &)
-*/
-
-int HsActivityDbClientPrivate::removeApplicationActivities(const QVariantHash &activity)
-{
-    return execute(RemoveApplicationActivities, QVariantHash(), activity);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::activities(QList<QVariantHash> &);
- */
-int HsActivityDbClientPrivate::activities(QList<QVariantHash>& result)
-{
-    return execute(Activities, result, QVariantHash());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::applicationActivities(QList<QVariantHash> &, const QVariantHash &)
- */
-int HsActivityDbClientPrivate::applicationActivities(QList<QVariantHash>& result,
-        const QVariantHash &condition)
-{
-    return execute(ApplicationActivities, result, condition);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::activityData(QVariant &, const QVariantHash &)
- */
-int HsActivityDbClientPrivate::activityData(QVariant &result, const QVariantHash &activity)
-{
-    TRAPD(errNo,
-    User::LeaveIfError(checkDataConstraint(ApplicationActivity, activity));
-    activityDataL(result, activity);)
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::waitActivity(const QVariantHash &)
- */
-int HsActivityDbClientPrivate::waitActivity(const QVariantHash &activity)
-{
-    return execute(WaitActivity, QVariantHash(), activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClientPrivate::getThumbnail(QSize size, QString imagePath, QString  mimeType, void *userDdata)
-{
-    TRAPD(errNo, getThumbnailL(size, imagePath, mimeType, userDdata);)
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClientPrivate::notifyDataChange()
-{
-    return execute(NotifyChange, QVariantHash(), QVariantHash());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::launchActivity(const QVariantHash &)
- */
-int HsActivityDbClientPrivate::launchActivity(const QVariantHash &activity)
-{
-    return execute(LaunchActivity, QVariantHash(), activity);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::cancelWaitActivity()
- */
-int HsActivityDbClientPrivate::cancelWaitActivity()
-{
-    return SendReceive(CancelWait, TIpcArgs());
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClientPrivate::cancelNotifyDataChange()
-{
-    return SendReceive(CancelNotify, TIpcArgs());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function start activity server process.
- * Function can leave on failure.
- */
-void HsActivityDbClientPrivate::startServerL()
-{
-    RProcess server;
-    const TUidType uid(KNullUid, KNullUid, KActivityServerUid);
-    User::LeaveIfError(server.Create(KActivityServerName, KNullDesC, uid));
-    TRequestStatus stat;
-    server.Rendezvous(stat);
-    if (stat != KRequestPending) {
-        server.Kill(0);
-    } else {
-        server.Resume();
-    }
-    User::WaitForRequest(stat);
-    int errNo = (EExitPanic == server.ExitType()) ?
-                KErrGeneral : stat.Int();
-    if (KErrCancel == errNo) {
-        errNo = KErrNone;
-    }
-    server.Close();
-    User::LeaveIfError(errNo);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function establish connection to activity server.
- * Function can leave on failure
- */
-void HsActivityDbClientPrivate::connectL()
-{
-    const int asyncMessageSlots(12);
-    const int maxRetry(4);
-
-    TInt retry = maxRetry;
-    TInt errNo(KErrNone);
-    do {
-        errNo = CreateSession(KActivityServerName, TVersion(0, 0, 0), asyncMessageSlots);
-        if (KErrNotFound != errNo && KErrServerTerminated != errNo) {
-            retry =0;
-        } else {
-            TRAP(errNo, startServerL());
-            if (KErrNone != errNo && KErrAlreadyExists != errNo) {
-                retry =0;
-                errNo = CreateSession(KActivityServerName, TVersion(0, 0, 0), asyncMessageSlots);
-            }
-        }
-    } while (--retry > 0);
-    User::LeaveIfError(errNo);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function execute remote call request.
- * @param function - remote function identyfier
- * @param activity - remote function parameters
- */
-void HsActivityDbClientPrivate::execSimpleRequestL(int function,
-                                                   const QVariantHash &privateData,
-                                                   const QVariantHash &publicData)
-{
-
-    TPckgBuf<TInt> bitmapHdl(0);
-    int flags(0);
-    if(publicData.end() != publicData.find(ActivityPersistence) &&
-       publicData[ActivityPersistence].toBool()) {
-        flags |= CAfEntry::Persistent;
-    }
-    if(publicData.end() != publicData.find(ActivityVisibility) &&
-       !publicData[ActivityVisibility].toBool()) {
-        flags |= CAfEntry::Invisible;
-    }
-    CFbsBitmap* bitmap(0);
-    if (publicData.end() != publicData.find(ActivityScreenshotKeyword)) {
-        bitmap = publicData[ActivityScreenshotKeyword].value<QPixmap>().toSymbianCFbsBitmap();
-        if (bitmap) {
-            CleanupStack::PushL(bitmap);
-            bitmapHdl = bitmap->Handle();
-        }
-        
-        
-    }
-
-    RBuf8 prvBuffer, pubBuffer, data;
-    CleanupClosePushL(data);
-    CleanupClosePushL(prvBuffer);
-    CleanupClosePushL(pubBuffer);
-
-    prvBuffer << privateData;
-    if (publicData.end() != publicData.find(ActivityScreenshotKeyword)) {
-        QVariantHash localData(publicData);
-        localData.remove(ActivityScreenshotKeyword);
-        pubBuffer << localData;
-    } else {
-        pubBuffer << publicData;
-    }
-    
-    HBufC *actId = XQConversions::qStringToS60Desc(publicData[ActivityActivityKeyword].toString());
-    CleanupStack::PushL(actId);
-    CAfEntry *entry = CAfEntry::NewL(flags,
-                                     publicData[ActivityApplicationKeyword].toInt(),
-                                     *actId,
-                                     KNullDesC,
-                                     prvBuffer,
-                                     pubBuffer);
-    CleanupStack::PopAndDestroy(actId);
-    CleanupStack::PopAndDestroy(&pubBuffer);
-    CleanupStack::PopAndDestroy(&prvBuffer);
-
-    CleanupStack::PushL(entry);
-    data.CreateL(entry->Size());
-    RDesWriteStream stream(data);
-    CleanupClosePushL(stream);
-    stream << (*entry);
-    CleanupStack::PopAndDestroy(&stream);
-    CleanupStack::PopAndDestroy(entry);
-    User::LeaveIfError(SendReceive(function, TIpcArgs(&data, &bitmapHdl)));
-    
-    CleanupStack::PopAndDestroy(&data);
-    if (0 != bitmap) {
-        CleanupStack::PopAndDestroy(bitmap);
-    }
-
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function retrieve all stored activity
- * Function can leave on failure
- * @param result - list of activity
- */
-void HsActivityDbClientPrivate::activitiesL(QList<QVariantHash>& result)
-{
-    result.clear();
-
-    RBuf8 buffer;
-    CleanupClosePushL(buffer);
-
-    TPckgBuf<int> emptyFilter(0), length(0), taskId(0);
-    User::LeaveIfError(SendReceive(Activities,
-                                   TIpcArgs(&emptyFilter, &length, &taskId)));
-
-    CAfEntry::ReallocL(buffer, length());
-
-    User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer)));
-
-    RPointerArray<CAfEntry> entries;
-    CleanupClosePushL(entries);
-
-    entries << buffer;
-    buffer.Close();//release unneeded resources
-
-
-    while(entries.Count()) {
-        QVariantHash publicData;
-        publicData << entries[0]->Data(CAfEntry::Public);
-        publicData.insert(ActivityScreenshotKeyword,
-                          QString::fromUtf16(entries[0]->ImageSrc().Ptr(),
-                                             entries[0]->ImageSrc().Length()));
-        result.append(publicData);
-        entries.Remove(0);
-    }
-    CleanupStack::PopAndDestroy(&entries);
-    CleanupStack::PopAndDestroy(&buffer);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function retrieve all stored activity
- * Function can leave on failure
- * @param result - list of activity
- * @param cond - request conditions
- */
-void HsActivityDbClientPrivate::applicationActivitiesL(QList<QVariantHash>& result,
-                                                     const QVariantHash & condition)
-{
-    result.clear();
-
-    RBuf8 buffer;
-    CleanupClosePushL(buffer);
-    CAfEntry *entry = CAfEntry::NewLC(0,
-                                      condition[ActivityApplicationKeyword].toInt(),
-                                      KNullDesC,
-                                      KNullDesC,
-                                      KNullDesC8,
-                                      KNullDesC8);//filtering using application id only
-    CAfEntry::ReallocL(buffer, entry->Size());
-    RDesWriteStream writer(buffer);
-    CleanupClosePushL(writer);
-    writer << (*entry);
-    CleanupStack::PopAndDestroy(&writer);
-    CleanupStack::PopAndDestroy(entry);
-
-    TPckgBuf<int> length(0), taskId(0);
-    User::LeaveIfError(SendReceive(ApplicationActivities,
-                                   TIpcArgs(&buffer, &length, &taskId)));
-
-    CAfEntry::ReallocL(buffer, length());
-
-    User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer)));
-
-    RPointerArray<CAfEntry> entries;
-    CleanupClosePushL(entries);
-
-    entries << buffer;
-    buffer.Close();//release unneeded resources
-
-
-    while(entries.Count()) {
-        QVariantHash publicData;
-        publicData << entries[0]->Data(CAfEntry::Public);
-        publicData.insert(ActivityScreenshotKeyword,
-                          QString::fromUtf16(entries[0]->ImageSrc().Ptr(),
-                                             entries[0]->ImageSrc().Length()));
-        result.append(publicData);
-        entries.Remove(0);
-    }
-    CleanupStack::PopAndDestroy(&entries);
-    CleanupStack::PopAndDestroy(&buffer);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function retrieve private data of stored activity
- * Function can leave on failure
- * @param result - list of activity
- * @param activity - request conditions
- */
-void HsActivityDbClientPrivate::activityDataL(QVariant &result, const QVariantHash &activity)
-{
-    result.clear();
-
-    RBuf8 buffer;
-    CleanupClosePushL(buffer);
-
-    {   // prepare entry to send
-        HBufC *activityId = XQConversions::qStringToS60Desc(activity[ActivityActivityKeyword].toString());
-        CleanupStack::PushL(activityId);
-
-        CAfEntry *entry = CAfEntry::NewLC(0,
-                                          activity[ActivityApplicationKeyword].toInt(),
-                                          *activityId,
-                                          KNullDesC,
-                                          KNullDesC8,
-                                          KNullDesC8);//filtering using application id only
-        CAfEntry::ReallocL(buffer, entry->Size());
-        RDesWriteStream writer(buffer);
-        CleanupClosePushL(writer);
-        writer << (*entry);
-        CleanupStack::PopAndDestroy(&writer);
-        CleanupStack::PopAndDestroy(entry);
-        CleanupStack::PopAndDestroy(activityId);
-    }
-
-    {   // get data
-        TPckgBuf<int> length(0), taskId(0);
-        User::LeaveIfError(SendReceive(ApplicationActivity, TIpcArgs(&buffer, &length, &taskId)));
-
-        CAfEntry::ReallocL(buffer, length());
-        User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer)));
-    }
-
-    {   // read data to Qt structure
-        CAfEntry *entry = CAfEntry::NewLC();
-        RDesReadStream reader(buffer);
-        CleanupClosePushL(reader);
-        entry->InternalizeL(reader);
-        CleanupStack::PopAndDestroy(&reader);
-
-        buffer.Close(); //release unneeded resources
-
-        QVariantHash privateData;
-        privateData << entry->Data(CAfEntry::Private);
-        result = privateData.value(ActivityDataKeyword);
-
-        CleanupStack::PopAndDestroy(entry);
-    }
-    CleanupStack::PopAndDestroy(&buffer);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbClientPrivate::launchActivityL(const QVariantHash &activity)
-{
-    TPckgC<TInt> applicationId(activity[ActivityApplicationKeyword].toInt());
-    HBufC8 *activityId = XQConversions::qStringToS60Desc8(activity[ActivityActivityKeyword].toString());
-    CleanupStack::PushL(activityId);
-    TPtrC8 empty(KNullDesC8);
-    User::LeaveIfError(SendReceive(LaunchActivity,
-                                   TIpcArgs(&applicationId, activityId, &empty, &empty)));
-    CleanupStack::PopAndDestroy(activityId);
-
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbClientPrivate::getThumbnailL(QSize size, QString imagePath, QString  mimeType, void *userDdata)
-{
-    HsActivityDbAsyncRequestPrivate::getThumbnailLD(mObserver,
-                              *this, size, imagePath, mimeType, userDdata);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function get cached data from server
- * @param taskId - request task id
- * @param dst - destination, preallocated buffer
- */
-void HsActivityDbClientPrivate::getData(int taskId, RBuf8 &data)
-{
-    TPckgBuf<int> requestId(taskId);
-    SendReceive(GetData, TIpcArgs(&requestId, &data));
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function initialize aync request
- * @param func - requested function
- * @param data - request data
- * @param status - request status
- */
-void HsActivityDbClientPrivate::sendDataAsync(int func,
-                                              const TIpcArgs &data,
-                                              TRequestStatus& status)
-{
-    SendReceive(func, data, status);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbClientPrivate::PushL(HsActivityDbAsyncRequestPrivate * task)
-{
-    (KErrNotFound == mAsyncTasks.Find(task)) ?
-        mAsyncTasks.AppendL(task):
-        User::Leave(KErrAlreadyExists);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbClientPrivate::Pop(HsActivityDbAsyncRequestPrivate *task)
-{
-    const TInt offset(mAsyncTasks.Find(task));
-    if (KErrNotFound != offset) {
-        mAsyncTasks.Remove(offset);
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClientPrivate::execute(int func, const QVariantHash &privateData, const QVariantHash &publicData)
-{
-    TRAPD(errNo,
-    User::LeaveIfError(checkDataConstraint(func, publicData));
-    switch (func) {
-    case AddActivity:
-    case UpdateActivity:
-    case RemoveActivity:
-    case RemoveApplicationActivities:
-        execSimpleRequestL(func, privateData, publicData);
-        break;
-    
-    case LaunchActivity:
-        launchActivityL(publicData);
-        break;
-    
-    case NotifyChange:
-        HsActivityDbAsyncRequestPrivate::notifyDataChangeLD(mObserver, *this);
-        break;
-    
-    case WaitActivity:
-        HsActivityDbAsyncRequestPrivate::waitActivityLD(mObserver,*this, publicData);
-        break;
-    
-    }
-    
-    )
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClientPrivate::execute(int func, 
-                                       QList<QVariantHash>&dst, 
-                                       const QVariantHash &src)
-{
-    TRAPD(errNo,
-    User::LeaveIfError(checkDataConstraint(func, src));
-    switch (func) {
-    case Activities: activitiesL(dst);break;
-    case ApplicationActivities: applicationActivitiesL(dst, src); break;
-    }
-    )
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClientPrivate::checkDataConstraint(int func, const QVariantHash &data)
-{
-    int retVal(KErrNone);
-    QStringList constraints;
-    switch(func) {
-    case AddActivity:
-    case UpdateActivity:
-        constraints << ActivityApplicationKeyword 
-                    << ActivityActivityKeyword 
-                    << ActivityScreenshotKeyword;
-        break;
-    
-    case ApplicationActivity:
-    case LaunchActivity:
-    case RemoveActivity:
-        constraints << ActivityApplicationKeyword
-                    << ActivityActivityKeyword;
-                    break;
-    
-    case WaitActivity:
-    case RemoveApplicationActivities:
-        constraints << ActivityApplicationKeyword;
-        break;
-    }
-    foreach (QString constraint, constraints) {
-        if (data.end() == data.find(constraint)) {
-            retVal = KErrCorrupt;
-            break;
-        }
-    }
-    return retVal;
-}
--- a/activityfw/activitydatabase/hsactivitydbclient/src/hsactivitydbclient.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "hsactivitydbclient.h"
-#include "hsactivitydbclient_p.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityDbClient::HsActivityDbClient(QObject *obj)
-    :
-    QObject(obj),
-    d_ptr(0)
-{
-    d_ptr = new HsActivityDbClientPrivate(*this);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HsActivityDbClient::~HsActivityDbClient()
-{
-    delete d_ptr;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::connect()
-{
-    return d_ptr->connect();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbClient::asyncRequestCompleated(int result,
-                                                int requestType, 
-                                                const QString& data)
-{
-    switch (requestType) {
-        case WaitActivity:
-            if (KErrCancel != result) {
-                waitActivity(QVariantHash());
-            }            
-            if (KErrNone == result) {
-                emit activityRequested(data);
-            }
-            
-            break;
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbClient::asyncRequestCompleated(int result,
-                                                int requestType, 
-                                                const QPixmap& pixmap,
-                                                void* userData)
-{
-    switch (requestType) {
-        case GetThumbnail:
-            emit thumbnailRequested(0 == result ? pixmap : QPixmap(), 
-                                    userData);
-            break;
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsActivityDbClient::asyncRequestCompleated(int result,int requestType)
-{
-    switch(requestType) {
-    case NotifyChange:
-        if (KErrCancel != result) {
-            d_ptr->notifyDataChange();
-        }
-        if (KErrNone == result) {
-            emit dataChanged();
-        }
-        break;
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::addActivity(const QVariantHash&)
- */
-int HsActivityDbClient::addActivity(const QVariantHash &privateData, 
-                                    const QVariantHash &publicData)
-{
-    return d_ptr->addActivity(privateData, publicData);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int HsActivityDbClientInterface::updateActivity(const QVariantHash&)
- */
-int HsActivityDbClient::updateActivity(const QVariantHash &privateData, 
-                                       const QVariantHash &publicData)
-{
-    return d_ptr->updateActivity(privateData, publicData);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::removeActivity(const QVariantHash &activity)
-{
-    return d_ptr->removeActivity(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::removeApplicationActivities(const QVariantHash &activity)
-{
-    return d_ptr->removeApplicationActivities(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::activities(QList<QVariantHash>& result)
-{
-    return d_ptr->activities(result);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::applicationActivities(QList<QVariantHash> & result,
-        const QVariantHash &conditions)
-{
-    return d_ptr->applicationActivities(result, conditions);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::activityData(QVariant &result, const QVariantHash &activity)
-{
-    return d_ptr->activityData(result, activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::waitActivity(const QVariantHash &activity)
-{
-    QVariantHash condition(activity);
-    RProcess process;
-    condition.insert(ActivityApplicationKeyword, 
-                     static_cast<int>(process.SecureId().iId));
-    return d_ptr->waitActivity(condition);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::launchActivity(const QVariantHash &activity)
-{
-    return d_ptr->launchActivity(activity);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::getThumbnail(QSize size, QString imagePath, QString mimeType, void* userDdata)
-{
-    return d_ptr->getThumbnail(size, imagePath, mimeType, userDdata);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-int HsActivityDbClient::notifyDataChange()
-{
-    return  d_ptr->notifyDataChange();
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/group/bld.inf	Tue Jul 06 14:37:10 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:
-*
-*/
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-hsactivitydbserver.mmp
--- a/activityfw/activitydatabase/hsactivitydbserver/group/hsactivitydbserver.mmp	Tue Jul 06 14:37:10 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:
-*
-*/
-TARGET          hsactivitydbserver.exe
-TARGETTYPE      exe
-UID             0 0x200267B4
-
-MW_LAYER_SYSTEMINCLUDE 
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../inc
-USERINCLUDE     ../../s60/inc
-USERINCLUDE     ../../../../inc
-
-SOURCEPATH      ../src
-SOURCE          main.cpp
-SOURCE          afserver.cpp
-SOURCE          afsession.cpp
-SOURCE          afstorage.cpp
-SOURCE          afdataprovidertask.cpp
-SOURCE          afbroadcasttask.cpp
-SOURCE          afstoragesynctask.cpp
-SOURCE          afstorageasynctask.cpp
-SOURCE          afobservertask.cpp
-SOURCE          afthumbnailtask.cpp
-
-SOURCEPATH      ../../s60/src
-SOURCE          afentry.cpp
-
-LIBRARY        euser.lib 
-LIBRARY        estor.lib
-LIBRARY        edbms.lib  
-LIBRARY        efsrv.lib
-LIBRARY        bafl.lib
-LIBRARY        fbscli.lib
-LIBRARY        hash.lib 
-LIBRARY        bitmaptransforms.lib
-LIBRARY        imageconversion.lib
-LIBRARY        tsutils.lib
-
-CAPABILITY     ALL -TCB
-EPOCHEAPSIZE   0x100000 0x600000 // 1MB - 6MB
-
-#ifdef ENABLE_ABIV2_MODE
-DEBUGGABLE_UDEBONLY
-#endif
\ No newline at end of file
--- a/activityfw/activitydatabase/hsactivitydbserver/hsactivitydbserver.pro	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies 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_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
-    
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afbroadcasttask.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef AFBROADCASTTASK_H
-#define AFBROADCASTTASK_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "aftaskstorage.h"
-#include "aftask.h"
-
-class AfBroadcastTask
-{
-public:
-    static void ExecuteL(MAfTaskStorage& storage, const RMessage2& msg);
-};
-
-#endif // AFBROADCASTTASK_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afdataprovidertask.h	Tue Jul 06 14:37:10 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 AFDATAPROVIDERTASK_H
-#define AFDATAPROVIDERTASK_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "aftaskstorage.h"
-#include "aftask.h"
-
-class AfDataProviderTask
-{
-public:
-    static void ExecuteL(MAfTaskStorage& storage, const RMessage2& msg);
-
-private:
-    static void ProvideDataL(const RMessage2& msg, const CAfTask& src);
-
-};
-
-#endif // AFDATAPROVIDERTASK_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afobservertask.h	Tue Jul 06 14:37:10 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 AFOBSERVERTASK_H
-#define AFOBSERVERTASK_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "aftask.h"
-#include "aftaskstorage.h"
-
-class CAfObserverTask : public CAfTask
-{
-public:
-    ~CAfObserverTask();
-
-    static void ExecuteLD(MAfTaskStorage& globalStorage, 
-                          MAfTaskStorage& localStorage,
-                          const RMessage2& msg);
-
-    const TDesC8& Data() const;
-
-    void BroadcastReceivedL(const RMessage2& );
-
-private:
-    CAfObserverTask(MAfTaskStorage& globalStorage, 
-                    MAfTaskStorage& localStorage,
-                    const RMessage2& msg);
-
-    void WriteResponseL();
-
-    TBool IsSessionTask(const CSession2* session);
-
-private:
-    MAfTaskStorage& mGlobalStorage;
-    MAfTaskStorage& mLocalStorage;
-    const RMessage2 mMsg;
-    RBuf8 mData;
-};
-
-#endif // AFOBSERVERTASK_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afqueries.h	Tue Jul 06 14:37:10 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 AFQUERIES_H
-#define AFQUERIES_H
-
-
-#include <e32base.h>
-
-_LIT( KSelectRow, "SELECT * FROM Activities WHERE ApplicationId=%S AND ActivityName='%S'");
-_LIT( KSelectRows, "SELECT * FROM Activities");
-_LIT( KSelectAppRows, "SELECT * FROM Activities WHERE ApplicationId=%S");
-_LIT( KDeleteRow, "DELETE FROM Activities WHERE ApplicationId=%S AND ActivityName='%S'");
-_LIT( KDeleteRows, "DELETE FROM Activities WHERE ApplicationId=%S");
-_LIT( KDeleteNonPersistentActivities, "DELETE FROM Activities WHERE Flags<%S");
-
-_LIT(KApplicationColumnName, "ApplicationId");
-_LIT(KActivityColumnName, "ActivityName");
-_LIT(KFlagsColumnName, "Flags");
-_LIT(KDataColumnName, "Data");
-
-_LIT(KActivityTableName, "Activities");
-_LIT(KActivityIndexName, "ActivitiesKey");
-#endif  // AFQUERIES_H
-
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afserver.h	Tue Jul 06 14:37:10 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 AFSERVER_H
-#define AFSERVER_H
-
-#define __E32SVR_H__
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>    // RFs
-
-#include "aftaskstorage.h"
-
-class CAfStorage;
-
-class CAfServer : public CServer2,
-                  public MAfTaskStorage
-{
-public:
-    ~CAfServer();
-
-    static CAfServer* NewLC();
-
-public:
-    void PushL(CAfTask *);
-    
-    void Pop(CAfTask *);
-    
-    const RPointerArray<CAfTask>& StorageData() const;
-    
-
-private:
-    CAfServer();
-
-    void ConstructL();
-
-    CSession2* NewSessionL(const TVersion& version, const RMessage2& message) const;
-
-    void RemoveNotValidTasks(const CSession2* session);
-
-private:
-    RFs mFsSession;
-    CAfStorage* mStorage;
-    RPointerArray<CAfTask> mObservers;
-};
-
-#endif // AFSERVER_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afsession.h	Tue Jul 06 14:37:10 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 AFSESSION_H
-#define AFSESSION_H
-
-#ifndef __E32SVR_H__
-#define __E32SVR_H__
-#endif 
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-
-#include "aftaskstorage.h"
-
-class CAfStorage;
-
-class CAfSession : public CSession2,
-                   public MAfTaskStorage
-{
-public:
-    ~CAfSession();
-
-    static CAfSession* NewL(RFs& fileSession,
-                            MAfTaskStorage& taskStorage, 
-                            CAfStorage&storage);
-
-public:
-    void PushL(CAfTask *);
-
-    void Pop(CAfTask *);
-
-    const RPointerArray<CAfTask>& StorageData() const;
-
-    void RemoveNotValidTasks(const CSession2* session);
-
-private:
-    CAfSession(RFs& fileSession,
-               MAfTaskStorage& taskStorage, 
-               CAfStorage& storage);
-
-    void ConstructL();
-
-private:
-    void ServiceL(const RMessage2& message);
-
-private:
-    RFs& mFileSession; 
-    MAfTaskStorage& mTasksStorage;
-    CAfStorage& mStorage;
-    RPointerArray<CAfTask> mRunningTasks;
-};
-
-#endif // AFSESSION_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afstorage.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,100 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef AFSTORAGE_H
-#define AFSTORAGE_H
-
-#define __E32SVR_H__
-
-#include <e32std.h>
-#include <e32base.h>
-#include <d32dbms.h>    // RDbStoreDatabase
-#include <s32file.h>    // CFileStore & CPermanentFileStore
-#include "afentry.h"
-
-class CAfStorage : public CBase
-    {
-public:
-    ~CAfStorage();
-
-    static CAfStorage* NewL(RFs& session);
-
-    void AddActivityL(CAfEntry &entry);
-    
-    void UpdateActivityL(CAfEntry &entry);
-
-    void DeleteActivityL(CAfEntry &entry);
-
-    void DeleteActivitiesL(CAfEntry &entry);
-
-    void ActivitiesL(RPointerArray<CAfEntry> &dst);
-
-    void ActivitiesL(RPointerArray<CAfEntry> &dst, TInt appId);
-    
-    void ActivityL(CAfEntry *&dst, CAfEntry &src);
-
-    RFs& Fs();
-
-private:
-    CAfStorage(RFs& session);
-
-    void ConstructL();
-
-    void CreateDbL(const TDesC& databaseFile);
-
-    void OpenDbL(const TDesC& databaseFile);
-
-    void CreateTableL();
-
-    void DeleteNonPersistentActivitiesL();
-
-    void GetActivitiesL(const TDesC& dst);
-
-    HBufC* SelectRowLC(TInt appId, const TDesC& actId) const;
-
-    HBufC* SelectRowsLC(TInt appId) const;
-
-    HBufC* DeleteRowLC(TInt appId, const TDesC& actId) const;
-    
-    HBufC* DeleteRowsLC(TInt appId) const;
-
-    HBufC* BuildQueryLC(const TDesC& format, TInt appId, const TDesC& actId) const;
-    
-    void ActivitiesL(RPointerArray<CAfEntry>& dst, 
-                     const TDesC& query, 
-                     CAfEntry::AccessRights rights,
-                     TInt limit = 0);
-
-    void ActivitiesL(RPointerArray<CAfEntry>& dst, 
-                     RDbView& query, 
-                     CAfEntry::AccessRights rights,
-                     TInt limit = 0);
-
-    void GetActivityForUpdateL(RDbView& query, TInt appId, const TDesC& actId);
-
-    void ReadDataL(RBuf& dst, RDbRowSet& src, TInt offset) const;
-
-    void ExternalizeDataL(RDbRowSet &dst,const CAfEntry & src, TInt offset) const;
-
-    void InternalizeDataL(CAfEntry &dst, RDbRowSet& src, TInt offset) const;
-
-private:
-    RFs& mFsSession;
-    RDbStoreDatabase mActDb;/* For database operations                 */
-    CFileStore* mFileStore;  /* For creating and opening database files */
-};
-
-#endif //AFSTORAGE_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afstorageasynctask.h	Tue Jul 06 14:37:10 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 AFSTORAGEASYNCTASK_H
-#define AFSTORAGEASYNCTASK_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "aftask.h"
-#include "aftaskstorage.h"
-#include "afstorage.h"
-
-class CAfStorageAsyncTask : public CAfTask
-{
-public:
-    ~CAfStorageAsyncTask();
-
-    static void ExecuteLD(MAfTaskStorage& taskStorage, 
-                          CAfStorage& dataStorage, 
-                          const RMessage2& msg);
-
-    const TDesC8& Data() const;
-
-    void BroadcastReceivedL(const RMessage2 &);
-
-private:
-    CAfStorageAsyncTask();
-
-    void ExecuteL(CAfStorage& dataStorage, const RMessage2& msg);
-
-    void AllActivitiesL(CAfStorage& dataStorage, const RMessage2& msg);
-
-    void ApplicationActivitiesL(CAfStorage& dataStorage, const RMessage2& msg);
-
-    void ApplicationActivityL(CAfStorage& dataStorage, const RMessage2& msg);
-
-    void WriteResponseL(const RMessage2& msg);
-
-    TBool IsSessionTask(const CSession2* session);
-
-    void ExternalizeL();
-    
-    void ExternalizeL(const CAfEntry &entry);
-
-private:
-    RBuf8 mExternalizedData;
-    RPointerArray<CAfEntry> mInternalizedData;
-};
-
-#endif // AFSTORAGEASYNCTASK_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afstoragesynctask.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef AFSTORAGESYNCTASK_H
-#define AFSTORAGESYNCTASK_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "aftask.h"
-#include "afstorage.h"
-#include "aftaskstorage.h"
-
-class CAfEntry;
-/**
- *  CActivityStorageSyncTask
- * 
- */
-class AfStorageSyncTask
-    {
-public:
-    static void ExecuteL(MAfTaskStorage& observers,
-                         CAfStorage& dataStorage, 
-                         const RMessage2& msg);
-
-private:
-    static void AddActivityL(CAfStorage& dataStorage, 
-                             const RMessage2& msg);
-
-    static void UpdateActivityL(CAfStorage& dataStorage, 
-                                const RMessage2& msg);
-
-    static void DeleteActivityL(CAfStorage& dataStorage, 
-                                const RMessage2& msg);
-
-    static void DeleteApplicationActivitiesL(CAfStorage& dataStorage, 
-                                             const RMessage2& msg);
-
-    static void NotifyChangeL(MAfTaskStorage& observers,
-                              const RMessage2& msg);
-
-    static void ReadEntryL(CAfEntry& entry, const RMessage2& msg);
-
-    static void CreateThumbnailL(const TDesC &path, TInt hdl);
-
-    static void ThumbnailPathL(RBuf &dst, 
-                               RFs& fileSystem, 
-                               TInt uid, 
-                               const TDesC &activityName);
-
-    static HBufC8* Md5HexDigestL(const TDes8 &string);
-
-    };
-
-#endif // AFSTORAGESYNCTASK_H
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/aftask.h	Tue Jul 06 14:37:10 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 AFTASK_H
-#define AFTASK_H
-
-#include <e32base.h>
-
-class CAfTask: public CBase
-{
-public:
-    /**
-     * Return task data 
-     */
-    virtual const TDesC8& Data() const =0;
-    
-    /**
-     * Notify instance about incoming broadcast message.
-     * @param msg - broadcast message
-     */
-    virtual void BroadcastReceivedL(const RMessage2& msg) =0;
-    
-    /**
-     * Returns ETrue if task is related with session argument
-     */
-    virtual TBool IsSessionTask(const CSession2* session) =0;
-};
-
-#endif  //AFTASK_H
-
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/aftaskstorage.h	Tue Jul 06 14:37:10 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:
-*
-*/
-#ifndef AFTASKSTORAGE_H
-#define AFTASKSTORAGE_H
-#include <e32base.h>
-class CAfTask;
-class MAfTaskStorage
-{
-public:
-    /**
-     * Register new task instance in storage. Ownership is transfered to storage.
-     * @param task - instance that need to be registered
-     */
-    virtual void PushL(CAfTask * task)=0;
-    
-    /**
-     * Unregister task instance from storage. Ownership is transfered to caller.
-     * @param task - instance that need to be unregistered
-     */
-    virtual void Pop(CAfTask *)=0;
-    
-    /**
-     * List of registered tasks
-     */
-    virtual const RPointerArray<CAfTask>& StorageData() const =0;
-
-    /**
-     * Removes not valid task
-     */
-    virtual void RemoveNotValidTasks(const CSession2* session) =0;
-};
-
-#endif  //AFTASKSTORAGE_H
-
--- a/activityfw/activitydatabase/hsactivitydbserver/inc/afthumbnailtask.h	Tue Jul 06 14:37:10 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 AFTHUMBNAILTASK_H
-#define AFTHUMBNAILTASK_H
-
-#ifndef __E32SVR_H__
-#define __E32SVR_H__
-#endif
-
-#include <e32std.h>
-#include <e32base.h>
-#include <f32file.h>
-
-#include "aftask.h"
-#include "aftaskstorage.h"
-#include "tsgraphicfilescalinghandler.h"
-
-class CFbsBitmap;
-
-class CAfThumbnailTask : public CAfTask,
-                         public MImageReadyCallBack
-{
-public:
-    ~CAfThumbnailTask();
-
-    static void ExecuteLD(MAfTaskStorage& taskStorage,
-                          const RMessage2& message);
-
-private:
-    CAfThumbnailTask(MAfTaskStorage& storage, const RMessage2 msg);
-
-    void ConstructL();
-
-    void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap );
-
-    const TDesC8& Data()const;
-
-    void BroadcastReceivedL(const RMessage2& );
-
-    TBool IsSessionTask(const CSession2* session);
-
-private:
-    MAfTaskStorage& mStorage; 
-    const RMessage2 mMsg;
-    CBase* mService;
-};
-
-#endif // AFTHUMBNAILTASK_H
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afbroadcasttask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "afbroadcasttask.h"
-
-// -----------------------------------------------------------------------------
-/**
- * Handle broadccast message request
- * @param storage - observer tasks storage
- * @param msg - request message that will be provided to observers
- */
-void AfBroadcastTask::ExecuteL(MAfTaskStorage& storage, 
-                               const RMessage2& msg)
-{
-    const RPointerArray<CAfTask> &tasks(storage.StorageData());
-    for (TInt iter(tasks.Count() - 1); iter >= 0 ; --iter ) {
-        if(EFalse == msg.IsNull()) {
-            (tasks[iter])->BroadcastReceivedL(msg);
-        }
-    }
-    if(EFalse == msg.IsNull()) {
-        msg.Complete(KErrNone);
-    }
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afdataprovidertask.cpp	Tue Jul 06 14:37:10 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:
-*
-*/
-#include "afdataprovidertask.h"
-#include "activitycmd.h"
-
-// -----------------------------------------------------------------------------
-/**
- * Handle data request. Deliver data stored in other task.
- * @param storage - data tasks storage
- * @param msg - request message
- */
-void AfDataProviderTask::ExecuteL(MAfTaskStorage& storage, 
-                                  const RMessage2& msg)
-{
-    TPckgBuf<void*> requestId;
-    CAfTask* taskPtr(0);
-    msg.Read(KRequestIdOffset, requestId);
-    
-    for (TInt iter(0);iter <storage.StorageData().Count();++iter) {
-        taskPtr = storage.StorageData()[iter];
-        if (taskPtr == requestId()) {//compare requested task address with storage objects
-            ProvideDataL(msg, *taskPtr);
-            storage.Pop(taskPtr);
-            delete taskPtr;
-            return;
-        }
-    }
-    User::Leave(KErrNotFound);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Write response data to request message
- * @param msg - destination message
- * @param src - data source
- */
-void AfDataProviderTask::ProvideDataL(const RMessage2& msg, 
-                                      const CAfTask& src)
-{
-    if (EFalse ==msg.IsNull()) {
-        msg.WriteL(KResponseDataOffset, src.Data());
-        msg.Complete(KErrNone);
-    }
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afobservertask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "afobservertask.h"
-#include "activitycmd.h"
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor for performing 1st stage construction
- * @param globalStorage - global observers storage
- * @param localStorage - local observers storage
- * @param msg - request message
- */
-CAfObserverTask::CAfObserverTask(MAfTaskStorage& globalStorage, 
-                                 MAfTaskStorage& localStorage, 
-                                 const RMessage2& msg)
-:
-    mGlobalStorage(globalStorage),
-    mLocalStorage(localStorage),
-    mMsg(msg)
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor.
- */
-CAfObserverTask::~CAfObserverTask()
-{
-    mData.Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle observer request. 
- * @param globalStorage - global observers storage
- * @param localStorage - local observers storage
- * @param msg - request message
- */
-
-void CAfObserverTask::ExecuteLD(MAfTaskStorage& globalStorage, 
-                                MAfTaskStorage& localStorage, 
-                                const RMessage2& msg)
-{
-    CAfObserverTask *self = new(ELeave)CAfObserverTask(globalStorage, 
-                                                       localStorage, 
-                                                       msg);
-    CleanupStack::PushL(self);
-    globalStorage.PushL(self);
-    CleanupStack::Pop(self);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see CActivityTask::Data()
- */
-const TDesC8& CAfObserverTask::Data() const
-{
-    return mData;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see CActivityTask::BroadcastReceivedL(const RMessage2&)
- */
-void CAfObserverTask::BroadcastReceivedL(const RMessage2& msg)
-{
-    if(EFalse != mMsg.IsNull()) {
-        mGlobalStorage.Pop(this);//
-        mLocalStorage.Pop(this);
-        delete this;
-    } else if (WaitActivity == mMsg.Function() &&
-               LaunchActivity == msg.Function()) {
-               TPckgBuf<TInt> observerdId;
-               mMsg.ReadL(KRequestAppIdOffset, observerdId);
-
-        TPckgBuf<TInt> requestedId;
-        msg.ReadL(KRequestAppIdOffset, requestedId);
-        if (observerdId() == requestedId()) {
-            if (msg.GetDesLength(KRequestActOffset) > mData.MaxLength()) {
-                mData.ReAllocL(msg.GetDesLength(1));
-            }
-            msg.ReadL(KRequestActOffset, mData, 0);
-            WriteResponseL();
-            mLocalStorage.PushL(this);
-            mGlobalStorage.Pop(this);
-            mMsg.Complete(KErrNone);
-        }
-    } else if (WaitActivity == mMsg.Function() &&
-               CancelWait == msg.Function() &&
-               mMsg.Session() == msg.Session()) {
-        mGlobalStorage.Pop(this);
-        mMsg.Complete(KErrCancel);
-        delete this;
-    } else if (NotifyChange == mMsg.Function() &&
-               CancelNotify == msg.Function() &&
-               mMsg.Session() == msg.Session()) {
-        mGlobalStorage.Pop(this);
-        mMsg.Complete(KErrCancel);
-        delete this;
-    } else if(NotifyChange == mMsg.Function() &&
-              (AddActivity == msg.Function() ||
-               UpdateActivity == msg.Function() ||
-               RemoveActivity == msg.Function() ||
-               RemoveApplicationActivities == msg.Function())){
-        mMsg.Complete(KErrNone);
-        mGlobalStorage.Pop(this);
-        delete this;
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Write response data to requested message 
- */
-void CAfObserverTask::WriteResponseL()
-{
-    mMsg.WriteL(KResponseDataSizeOffset, TPckgBuf<TInt>(mData.Length()));//write data size
-    mMsg.WriteL(KResponseIdOffset, TPckgBuf<CBase*>(this));//task identyfier
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Returns ETrue if task is related with session argument
- */
-TBool CAfObserverTask::IsSessionTask(const CSession2* session)
-{
-    return mMsg.Session() == session ? ETrue : EFalse;
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afserver.cpp	Tue Jul 06 14:37:10 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:
-*
-*/
-#include <fbs.h>
-
-#include "afserver.h"
-#include "afsession.h"
-#include "afstorage.h"
-#include "aftask.h"
-
-_LIT( KActivityServerName, "hsactivitydbserver" );
-_LIT(KObserverAlreadyExists, "Observer task exists");
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor for performing 1st stage construction
- */
-CAfServer::CAfServer()
-:
-CServer2( EPriorityStandard )
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor.
- */
-CAfServer::~CAfServer()
-{
-    delete mStorage;
-    mFsSession.Close();
-    mObservers.ResetAndDestroy();
-    RFbsSession::Disconnect();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phased constructor.
- */
-CAfServer* CAfServer::NewLC()
-{
-    CAfServer* self = new (ELeave) CAfServer();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Default constructor for performing 2nd stage construction
- */
-void CAfServer::ConstructL()
-{
-    StartL(KActivityServerName);
-    User::LeaveIfError(mFsSession.Connect());
-    User::LeaveIfError(RFbsSession::Connect(mFsSession));
-    mStorage = CAfStorage::NewL(mFsSession);
-    mObservers.Array();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see CServer2::NewSessionL(const TVersion&, const RMessage2&)
- */
-CSession2* CAfServer::NewSessionL(const TVersion &, const RMessage2&) const
-{
-    return CAfSession::NewL(const_cast<CAfServer*>(this)->mFsSession, 
-                            *const_cast<CAfServer*>(this), 
-                            *mStorage);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see MAfTaskStorage::PushL(CAfTask *)
- */
-void CAfServer::PushL(CAfTask * task)
-{
-    (KErrNotFound == mObservers.Find(task)) ?
-     mObservers.AppendL(task) :
-     User::Panic(KObserverAlreadyExists, KErrAlreadyExists);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see MAfTaskStorage::Pop(CActivityTask *)
- */
-void CAfServer::Pop(CAfTask *task)
-{
-    const TInt offset(mObservers.Find(task));
-    if (KErrNotFound != offset) {
-        mObservers.Remove(offset);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see MAfTaskStorage::StorageData()
- */
-const RPointerArray<CAfTask>& CAfServer::StorageData() const
-{
-    return mObservers;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Removes not valid task
- */
-void CAfServer::RemoveNotValidTasks(const CSession2* session)
-{
-    for (TInt i=mObservers.Count()-1; i>=0; --i) {
-        if( mObservers[i]->IsSessionTask(session) ) {
-            delete mObservers[i];
-            mObservers.Remove(i);
-        }
-    }
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afsession.cpp	Tue Jul 06 14:37:10 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:
-*
-*/
-#include "afsession.h"
-#include "aftask.h"
-#include "activitycmd.h"
-
-#include "afstorageasynctask.h"
-#include "afstoragesynctask.h"
-#include "afobservertask.h"
-#include "afbroadcasttask.h"
-#include "afdataprovidertask.h"
-#include "afthumbnailtask.h"
-
-_LIT(KTaskAlreadyExists, "Activity task exists");
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor for performing 1st stage construction
- * @param fileSession - initialized file system session
- * @param taskStorage - global observers storage
- * @param storage - data storage
- */
-
-CAfSession::CAfSession(RFs& fileSession, 
-                       MAfTaskStorage& taskStorage, 
-                       CAfStorage& storage)
-:
-mFileSession(fileSession),
-mTasksStorage(taskStorage),
-mStorage(storage)
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor.
- */
-CAfSession::~CAfSession()
-{
-    RemoveNotValidTasks(this);
-    mTasksStorage.RemoveNotValidTasks(this);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phased constructor.
- * @param fileSession - initialized file system session
- * @param taskStorage - global observers storage
- * @param storage - data storage
- */
-CAfSession* CAfSession::NewL(RFs& fileSession,
-                             MAfTaskStorage& taskStorage,
-                             CAfStorage& storage)
-{
-    CAfSession* self = new (ELeave) CAfSession(fileSession, 
-                                               taskStorage, 
-                                               storage);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * EPOC default constructor for performing 2nd stage construction
- */
-void CAfSession::ConstructL()
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Implements interface
- * @see void CSession2::ServiceL(const RMessage2&)
- */
-void CAfSession::ServiceL(const RMessage2& message)
-{
-    switch (message.Function()) {
-    case AddActivity:
-    case UpdateActivity:
-    case RemoveActivity:
-    case RemoveApplicationActivities:
-        AfStorageSyncTask::ExecuteL(mTasksStorage, mStorage, message);
-        break;
-    
-    case ApplicationActivity:
-    case Activities:
-    case ApplicationActivities:
-        CAfStorageAsyncTask::ExecuteLD(*this, mStorage, message);
-        break;
-    
-    case WaitActivity:
-    case NotifyChange:
-        CAfObserverTask::ExecuteLD(mTasksStorage, *this, message);
-        break;
-    
-    case GetThumbnail:
-        CAfThumbnailTask::ExecuteLD(*this, message);
-        break;
-    
-    case LaunchActivity:
-    case CancelWait:
-    case CancelNotify:
-        AfBroadcastTask::ExecuteL(mTasksStorage, message);
-        break;
-    
-    case GetData:
-        AfDataProviderTask::ExecuteL(*this,message);
-        break;
-    
-    default:
-        message.Complete(CServer2::EBadMessageNumber);
-        break;
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see MAfTaskStorage::PushL(CAfTask *)
- */
-void CAfSession::PushL(CAfTask * task)
-{
-    (KErrNotFound == mRunningTasks.Find(task)) ?
-     mRunningTasks.AppendL(task) :
-     User::Panic(KTaskAlreadyExists, KErrAlreadyExists);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see MAfTaskStorage::Pop(CAfTask *)
- */
-void CAfSession::Pop(CAfTask *task)
-{
-    const TInt offset(mRunningTasks.Find(task));
-    if (KErrNotFound != offset) {
-        mRunningTasks.Remove(offset);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see MAfTaskStorage::StorageData()
- */
-const RPointerArray<CAfTask>& CAfSession::StorageData() const
-{
-    return mRunningTasks;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Removes not valid task
- */
-void CAfSession::RemoveNotValidTasks(const CSession2* session)
-{
-    if (session == this) {
-        mRunningTasks.ResetAndDestroy();
-    }
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afstorage.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,505 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "afstorage.h"
-#include "afqueries.h"
-#include "afentry.h"
-#include <bautils.h>
-#include <s32mem.h>
-
-_LIT(KDbName, "activity.db");
-_LIT(KDbDrive, "c:");
-const TInt KMaxPathLength = 256;
-
-// -----------------------------------------------------------------------------
-LOCAL_C void CleanupResetAndDestroy(TAny*  item)
-{
-    RPointerArray<CAfEntry> *array = static_cast< RPointerArray<CAfEntry>* >(item);
-    array->ResetAndDestroy();
-    array->Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor for performing 1st stage construction
- * @param session - initialized session to file system
- */
-CAfStorage::CAfStorage(RFs& session)
-:
-mFsSession(session)
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor.
- */
-CAfStorage::~CAfStorage()
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phased constructor.
- * @param session - initialized session to file system
- */
-CAfStorage* CAfStorage::NewL(RFs& session)
-{
-    CAfStorage* self = new (ELeave) CAfStorage(session);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(); // self;
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * EPOC default constructor for performing 2nd stage construction
- */
-void CAfStorage::ConstructL()
-{
-    RBuf path;
-    CleanupClosePushL( path );
-    path.CreateL(KMaxPathLength);
-    User::LeaveIfError(mFsSession.PrivatePath(path ));
-    path.Append(KDbName);
-    path.Insert(0, KDbDrive);
-    BaflUtils::EnsurePathExistsL(mFsSession, path);
-    BaflUtils::FileExists(mFsSession, path) ? OpenDbL(path) : CreateDbL(path);
-    CleanupStack::PopAndDestroy(&path);
-
-    DeleteNonPersistentActivitiesL();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Create database and its structure
- * @param databaseFile - database file path
- */
-void CAfStorage::CreateDbL(const TDesC& databaseFile)
-{
-    mFileStore = CPermanentFileStore::ReplaceL(mFsSession,
-                                               databaseFile,
-                                               EFileRead|EFileWrite);
-    mFileStore->SetTypeL(mFileStore->Layout());// Set file store type
-    TStreamId id = mActDb.CreateL(mFileStore);// Create stream object
-    mFileStore->SetRootL(id);// Keep database id as root of store
-    mFileStore->CommitL();// Complete creation by commiting
-    CreateTableL();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Open database
- * @param databaseFile - database file path
- */
-void CAfStorage::OpenDbL(const TDesC& databaseFile)
-{
-    mFileStore = CPermanentFileStore::OpenL(mFsSession,
-                                            databaseFile,
-                                            EFileRead|EFileWrite);
-    mFileStore->SetTypeL(mFileStore->Layout()); /* Set file store type*/
-    mActDb.OpenL(mFileStore,mFileStore->Root());
-    CDbTableNames* tables = mActDb.TableNamesL();
-    CleanupStack::PushL(tables);
-    if (0 == tables->Count()) {
-        CreateTableL();
-    }
-    CleanupStack::PopAndDestroy(tables);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Create database structure
- */
-void CAfStorage::CreateTableL()
-{
-    // Add the columns to column set
-    CDbColSet* actColSet = CDbColSet::NewLC();
-
-    TDbCol appName(KApplicationColumnName, EDbColInt64);
-    appName.iAttributes = TDbCol::ENotNull;
-    actColSet->AddL(appName);
-
-    TDbCol actName(KActivityColumnName, EDbColText16);// Using default length
-    actName.iAttributes = TDbCol::ENotNull;
-    actColSet->AddL(actName);
-
-    TDbCol actFlags(KFlagsColumnName, EDbColInt32);
-    actFlags.iAttributes = TDbCol::ENotNull;
-    actColSet->AddL(actFlags);
-
-    actColSet->AddL(TDbCol(KDataColumnName, EDbColLongBinary));// Stream Data
-
-    // Create the table
-    User::LeaveIfError(mActDb.CreateTable(KActivityTableName,
-                                         *actColSet));
-
-    CleanupStack::PopAndDestroy(actColSet);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Delete non-persistent activities
- */
-void CAfStorage::DeleteNonPersistentActivitiesL()
-{
-    HBufC *query(BuildQueryLC(KDeleteNonPersistentActivities(), CAfEntry::Persistent, KNullDesC));
-    User::LeaveIfError(mActDb.Execute(*query));
-    CleanupStack::PopAndDestroy(query);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Register new activity
- * @param appId - application id
- * @param actId - activity id
- * @param flags - activity flags
- * @param imgSrc - activity thumbnail source
- * @param privateData - activity private data
- * @param publicData - activity public data
- */
-void CAfStorage::AddActivityL(CAfEntry& entry)
-{
-    //verify if row already exists
-    TInt errNo(KErrNone);
-    RDbView view;
-    CleanupClosePushL(view);
-    TRAP( errNo, GetActivityForUpdateL(view, entry.ApplicationId(), entry.ActivityId()));
-    if (KErrNone == errNo) {
-        User::Leave(KErrAlreadyExists);
-    }
-    CleanupStack::PopAndDestroy(&view);
-
-    //write table
-    RDbTable table;
-    CleanupClosePushL(table);
-    User::LeaveIfError(table.Open(mActDb, KActivityTableName, table.EUpdatable));
-    CDbColSet *row = table.ColSetL();
-    CleanupStack::PushL(row);
-
-    table.InsertL();
-    TRAP(errNo,
-    table.SetColL(row->ColNo(KApplicationColumnName), TInt64(entry.ApplicationId()));
-    table.SetColL(row->ColNo(KActivityColumnName), entry.ActivityId());
-    table.SetColL(row->ColNo(KFlagsColumnName), entry.Flags());
-    ExternalizeDataL(table, entry, row->ColNo(KDataColumnName));
-    table.PutL();)
-    if (KErrNone != errNo) {
-        table.Cancel();
-        User::Leave(errNo);
-    }
-    CleanupStack::PopAndDestroy(row);
-    CleanupStack::PopAndDestroy(&table);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Update activity
- * @param entry - activity data
- */
-void CAfStorage::UpdateActivityL(CAfEntry& entry)
-{
-    RDbView view;
-    CleanupClosePushL(view);
-    GetActivityForUpdateL(view, entry.ApplicationId(), entry.ActivityId());
-    view.UpdateL();
-    TRAPD(errNo,
-    CDbColSet* colSet = view.ColSetL();
-    CleanupStack::PushL(colSet);
-
-    view.SetColL(colSet->ColNo(KFlagsColumnName), entry.Flags());
-    ExternalizeDataL(view, entry, colSet->ColNo(KDataColumnName));
-
-    view.PutL();
-    if (KErrNone != errNo) {
-        view.Cancel();
-        User::Leave(errNo);
-    }
-    CleanupStack::PopAndDestroy(colSet);)
-
-    if (KErrNone != errNo) {
-        view.Cancel();
-        User::Leave(errNo);
-    }
-    CleanupStack::PopAndDestroy(&view);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Delete activity
- * @param appId - application id
- * @param actId - activity id
- */
-void CAfStorage::DeleteActivityL(CAfEntry& entry)
-{
-    HBufC *query(DeleteRowLC(entry.ApplicationId(), entry.ActivityId()));
-    User::LeaveIfError(mActDb.Execute(*query));
-    CleanupStack::PopAndDestroy(query);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CAfStorage::DeleteActivitiesL(CAfEntry& entry)
-{
-    HBufC *query(DeleteRowsLC(entry.ApplicationId()));
-    User::LeaveIfError(mActDb.Execute(*query));
-    CleanupStack::PopAndDestroy(query);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CAfStorage::ActivitiesL(RPointerArray<CAfEntry>& dst)
-{
-    ActivitiesL(dst, KSelectRows(), CAfEntry::Public);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize application activity into the buffer
- * @param dst - destination buffer
- * @param appId - application id
- */
-void CAfStorage::ActivitiesL(RPointerArray<CAfEntry>& dst,TInt appId)
-{
-    HBufC *query(SelectRowsLC(appId));
-    ActivitiesL(dst, *query, CAfEntry::Private);
-    CleanupStack::PopAndDestroy(query);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize application activity into the buffer
- * @param dst - destination entry
- * @param src - condition pattern
- */
-void CAfStorage::ActivityL(CAfEntry *&dst, CAfEntry& src)
-{
-    HBufC *query = SelectRowLC(src.ApplicationId(), src.ActivityId());
-    RPointerArray<CAfEntry> array;
-    CleanupStack::PushL(TCleanupItem(CleanupResetAndDestroy,&array));
-    ActivitiesL(array, *query, CAfEntry::Private, 1);
-    if (0 >= array.Count()) {
-        User::Leave(KErrNotFound);
-    }
-    dst = array[0];
-    array.Remove(0);
-    CleanupStack::PopAndDestroy(&array);
-    CleanupStack::PopAndDestroy(query);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide initialized file system session
- * @return file system session
- */
-RFs& CAfStorage::Fs()
-{
-    return mFsSession;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Format query to select activity row
- * @param appId - application id
- * @param actId - activity id
- * @return formated sql query
- */
-HBufC* CAfStorage::SelectRowLC(TInt appId, const TDesC& actId) const
-{
-    return BuildQueryLC(KSelectRow(),appId, actId);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Format query to select activities for application
- * @param appId - application id
- * @return formated sql query
- */
-HBufC* CAfStorage::SelectRowsLC(TInt appId) const
-{
-    return BuildQueryLC(KSelectAppRows(), appId, KNullDesC);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Format query to delete activity
- * @param appId - application id
- * @param actId - activity id
- * @return formated sql query
- */
-HBufC* CAfStorage::DeleteRowLC(TInt appId, const TDesC& actId) const
-{
-    return BuildQueryLC(KDeleteRow(),appId, actId);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Format query to delete activities for application
- * @param appId - application id
- * @return formated sql query
- */
-HBufC* CAfStorage::DeleteRowsLC(TInt appId) const
-{
-    return BuildQueryLC(KDeleteRows(),appId, KNullDesC);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Format sql query
- * @format - sql format string
- * @param appId - application id
- * @param actId - activity id
- * @return formated sql query
- */
-HBufC* CAfStorage::BuildQueryLC(const TDesC& format,
-                                      TInt appId,
-                                      const TDesC& actId) const
-{
-    TBuf<16> appName;
-    appName.AppendNum(appId);
-    RBuf actName;
-    CleanupClosePushL(actName);
-    actName.CreateL(actId.Length());
-    actName.Copy(actId);
-    HBufC* query = HBufC::NewL(format.Length() +
-                               appName.Length() +
-                               actName.Length() );
-    query->Des().AppendFormat(format, &appName, &actName);
-    CleanupStack::PopAndDestroy(&actName);
-    CleanupStack::PushL(query);
-    return query;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Execute sql query and result serialize into buffer
- * @param dst - destination result buffer
- * @param query - sql activity query
- */
-void CAfStorage::ActivitiesL(RPointerArray<CAfEntry>& dst, const TDesC& query, CAfEntry::AccessRights rights, TInt limit)
-{
-    RDbView view;// Create a view on the database
-    CleanupClosePushL(view);
-    User::LeaveIfError(view.Prepare(mActDb, TDbQuery(query), view.EReadOnly));
-    User::LeaveIfError(view.EvaluateAll());
-    ActivitiesL(dst, view, rights, limit);
-    CleanupStack::PopAndDestroy(&view);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Return view deserialisd into entries array
- * @param dst - destination result
- * @param query - view
- * @param rights - acess rights
- */
-void CAfStorage::ActivitiesL(RPointerArray<CAfEntry>& dst, RDbView& src, CAfEntry::AccessRights rights, TInt limit)
-{
-    CDbColSet* row = src.ColSetL();
-    CleanupStack::PushL(row);
-
-    const TInt flagsOffset(row->ColNo(KFlagsColumnName)),
-               applicationOffset(row->ColNo(KApplicationColumnName)),
-               activityOffset(row->ColNo(KActivityColumnName)),
-               dataOffset(row->ColNo(KDataColumnName));
-
-    RBuf activityName;
-    CleanupClosePushL(activityName);
-
-    for (src.FirstL(); src.AtRow(); src.NextL()) {
-        if(0 < limit && dst.Count() >= limit) {
-            break;
-        }
-        src.GetL();
-        ReadDataL(activityName, src, activityOffset);
-
-        CAfEntry *entry = CAfEntry::NewLC(src.ColInt32(flagsOffset),
-                                          src.ColInt64(applicationOffset),
-                                          activityName,
-                                          KNullDesC,
-                                          KNullDesC8,
-                                          KNullDesC8);
-        if (CAfEntry::Public == rights && (entry->Flags() & CAfEntry::Invisible)) {
-            CleanupStack::PopAndDestroy(entry);
-            continue;
-        }
-        InternalizeDataL(*entry, src, dataOffset);
-        
-        if (CAfEntry::Public == rights || 0 >= limit) {
-            entry->SetDataL(KNullDesC8(), CAfEntry::Private);
-        }
-        dst.AppendL(entry);
-        CleanupStack::Pop(entry);
-    }
-
-    CleanupStack::PopAndDestroy(&activityName);
-    CleanupStack::PopAndDestroy(row);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Get activity for update
- * @param query - destination query result
- * @param appId - application id
- * @param actId - activity id
- */
-void CAfStorage::GetActivityForUpdateL(RDbView& view, TInt appId, const TDesC& actId)
-{
-    HBufC* query(SelectRowLC(appId, actId));
-    User::LeaveIfError(view.Prepare(mActDb, TDbQuery(*query), view.EUpdatable));
-    CleanupStack::PopAndDestroy(query);
-    User::LeaveIfError(view.EvaluateAll());
-    if (!view.FirstL()) {
-        User::Leave(KErrNotFound);
-    }
-}
-
-// -----------------------------------------------------------------------------
-void CAfStorage::ReadDataL(RBuf& dst, RDbRowSet& src, TInt offset) const
-{
-    const TInt length(src.ColLength(offset));
-    CAfEntry::ReallocL(dst, length);
-    RDbColReadStream srcStream;
-    srcStream.OpenLC(src,offset);
-    srcStream.ReadL(dst, src.ColLength(offset));
-    CleanupStack::PopAndDestroy(&srcStream);
-}
-
-// -----------------------------------------------------------------------------
-void CAfStorage::ExternalizeDataL(RDbRowSet& dst,const CAfEntry &src, TInt offset) const
-{
-    RDbColWriteStream dbStream;
-    CleanupClosePushL(dbStream);
-    dbStream.OpenL(dst, offset);
-    src.ExternalizeDataOnlyL(dbStream);
-    CleanupStack::PopAndDestroy(&dbStream);
-}
-
-// -----------------------------------------------------------------------------
-void CAfStorage::InternalizeDataL(CAfEntry & dst, RDbRowSet& src, TInt offset) const
-{
-    RDbColReadStream dbStream;
-    CleanupClosePushL(dbStream);
-    dbStream.OpenL(src, offset);
-    dst.InternalizeDataOnlyL(dbStream);
-    CleanupStack::PopAndDestroy(&dbStream);
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afstorageasynctask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,221 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <s32mem.h>
-
-#include "afstorageasynctask.h"
-#include "activitycmd.h"
-
-_LIT(KUnsupportedStorageAsyncTask, "Unsupported async storage task");
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-LOCAL_C void ReadEntryL(CAfEntry& entry, const RMessage2& msg)
-{
-    RBuf8 serializedEntry;
-    CleanupClosePushL(serializedEntry);
-    serializedEntry.CreateL(msg.GetDesLengthL(0));
-    msg.ReadL(0, serializedEntry);
-    RDesReadStream reader(serializedEntry);
-    CleanupClosePushL(reader);
-    
-    reader >> entry;
-    
-    CleanupStack::PopAndDestroy(&reader);
-    CleanupStack::PopAndDestroy(&serializedEntry);
-}
-// -----------------------------------------------------------------------------
-/**
- * Constructor for performing 1st stage construction
- */
-CAfStorageAsyncTask::CAfStorageAsyncTask()
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor.
- */
-CAfStorageAsyncTask::~CAfStorageAsyncTask()
-{
-    mExternalizedData.Close();
-    mInternalizedData.ResetAndDestroy();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle asynchronous data storage requests
- * @param taskStorage - data tasks storage
- * @param dataStorage - data storage
- * @param msg - request message
- */
-void CAfStorageAsyncTask::ExecuteLD(MAfTaskStorage& taskStorage, 
-                                    CAfStorage& dataStorage, 
-                                    const RMessage2& msg)
-{
-    CAfStorageAsyncTask* self = new (ELeave) CAfStorageAsyncTask();
-    CleanupStack::PushL(self);
-    self->ExecuteL(dataStorage, msg);
-    taskStorage.PushL(self);
-    CleanupStack::Pop(self);
-    if (EFalse == msg.IsNull()) {
-        msg.Complete(KErrNone);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see CActivityTask::Data()
- */
-const TDesC8& CAfStorageAsyncTask::CAfStorageAsyncTask::Data() const
-{
-    return mExternalizedData;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see CActivityTask::BroadcastReceivedL(const RMessage2 &)
- */
-void CAfStorageAsyncTask::BroadcastReceivedL(const RMessage2& )
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle asynchronous data storage requests
- * @param dataStorage - data storage
- * @param msg - request message
- */
-void CAfStorageAsyncTask::ExecuteL(CAfStorage& dataStorage, 
-                                   const RMessage2& msg)
-{
-    switch (msg.Function()) {
-    case Activities:
-        AllActivitiesL(dataStorage, msg);
-        break;
-    case ApplicationActivities:
-        ApplicationActivitiesL(dataStorage, msg);
-        break;
-    case ApplicationActivity:
-        ApplicationActivityL(dataStorage, msg);
-        break;
-    default:
-        //this code shouldn't be called. fatal error: means wrong session implementation 
-        User::Panic(KUnsupportedStorageAsyncTask, KErrGeneral);
-    };
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle getting all activities request
- * @param dataStorage - data storage
- * @param msg - requested message
- */
-void CAfStorageAsyncTask::AllActivitiesL(CAfStorage& dataStorage, 
-                                         const RMessage2& msg)
-{
-    dataStorage.ActivitiesL(mInternalizedData);
-    ExternalizeL();
-    WriteResponseL(msg);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle getting application activities request
- * @param dataStorage - data storage
- * @param msg - requested message
- */
-void CAfStorageAsyncTask::ApplicationActivitiesL(CAfStorage& dataStorage, 
-                                                 const RMessage2& msg)
-{
-    CAfEntry *entry = CAfEntry::NewLC();
-    ReadEntryL(*entry, msg);
-    dataStorage.ActivitiesL(mInternalizedData, entry->ApplicationId());
-    CleanupStack::PopAndDestroy(entry);
-    ExternalizeL();
-    WriteResponseL(msg);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle getting application activity request
- * @param dataStorage - data storage
- * @param msg - requested message
- */
-void CAfStorageAsyncTask::ApplicationActivityL(CAfStorage& dataStorage, 
-                                               const RMessage2& msg)
-{
-    CAfEntry *src(CAfEntry::NewLC()) , *dst(0);
-    ReadEntryL(*src, msg);
-    dataStorage.ActivityL(dst, *src);
-    CleanupStack::PushL(dst);
-    ExternalizeL(*dst);
-    CleanupStack::PopAndDestroy(dst);
-    CleanupStack::PopAndDestroy(src);
-    WriteResponseL(msg);
-}
-
-// -----------------------------------------------------------------------------
-void CAfStorageAsyncTask::ExternalizeL()
-{
-    mExternalizedData << mInternalizedData;
-    mInternalizedData.ResetAndDestroy();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Externalzie entry into output buffer
- * @param entry - source entry
- */
-void CAfStorageAsyncTask::ExternalizeL(const CAfEntry &entry)
-{
-    CAfEntry::ReallocL(mExternalizedData, entry.Size());
-    RDesWriteStream writer(mExternalizedData);
-    CleanupClosePushL(writer);
-    writer << entry;
-    CleanupStack::PopAndDestroy(&writer);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Write response data into request message
- * @param msg - destination message
- */
-void CAfStorageAsyncTask::WriteResponseL(const RMessage2& msg)
-{
-    if (EFalse == msg.IsNull()) {
-        msg.WriteL(1, 
-                   TPckgBuf<TInt>(mExternalizedData.Length()));//write data size
-        msg.WriteL(2, 
-                   TPckgBuf<CBase*>(this));//task identyfier
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Returns ETrue if task is related with session argument
- */
-
-TBool CAfStorageAsyncTask::IsSessionTask(const CSession2* /*session*/)
-{
-	return EFalse;
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afstoragesynctask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,260 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <s32mem.h>
-#include <hash.h>
-#include <fbs.h>
-#include <bautils.h>
-
-#include "afstoragesynctask.h"
-#include "activitycmd.h"
-#include "afentry.h"
-const TInt KMaxPathLength = 256;
-
-_LIT(KUnsupportedStorageSyncTask, "Unsupported sync storage task");
-
-// -----------------------------------------------------------------------------
-/**
- * Handle synchronous data storage requests
- * @param dataStorage - data storage
- * @param msg - request message
- */
-void AfStorageSyncTask::ExecuteL(MAfTaskStorage& observers,
-                                 CAfStorage& dataStorage, 
-                                 const RMessage2& msg)
-{
-    switch (msg.Function()) {
-    case AddActivity: 
-        AddActivityL(dataStorage, msg);
-        break;
-    case UpdateActivity:
-        UpdateActivityL(dataStorage, msg);
-        break;
-    case RemoveActivity:
-        DeleteActivityL(dataStorage, msg);
-        break;
-    case RemoveApplicationActivities:
-        DeleteApplicationActivitiesL(dataStorage, msg);
-        break;
-    default:
-        //this code shouldn't be called. fatal error: means wrong session implementation 
-        User::Panic(KUnsupportedStorageSyncTask, KErrGeneral);
-    };
-    msg.Complete(KErrNone);
-    NotifyChangeL(observers, msg);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle adding new activity.
- * @param dataStorage - data storage
- * @param msg - request message
- */
-void AfStorageSyncTask::AddActivityL(CAfStorage& dataStorage, 
-                                     const RMessage2& msg)
-{
-    //Read message and bitmap handle
-    TPckgBuf<TInt> bitmapHdl(0);
-    CAfEntry *entry = CAfEntry::NewLC();
-    ReadEntryL(*entry, msg);
-    msg.ReadL(1, bitmapHdl);
-    
-    RBuf thumbnailPath;
-    CleanupClosePushL(thumbnailPath);
-    ThumbnailPathL(thumbnailPath, 
-                   dataStorage.Fs(), 
-                   entry->ApplicationId(), 
-                   entry->ActivityId());
-    CreateThumbnailL(thumbnailPath, bitmapHdl());
-    entry->SetImageSrcL(thumbnailPath);
-    dataStorage.AddActivityL(*entry);
-    CleanupStack::PopAndDestroy(&thumbnailPath);
-    
-    CleanupStack::PopAndDestroy(entry);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle updating existing activiy
- * @param dataStorage - data storage
- * @param msg - request message
- */
-void AfStorageSyncTask::UpdateActivityL(CAfStorage& dataStorage, 
-                                        const RMessage2& msg)
-{
-    TPckgBuf<TInt> bitmapHdl(0);
-    CAfEntry *entry = CAfEntry::NewLC();
-    ReadEntryL(*entry, msg);
-    msg.ReadL(1, bitmapHdl);
-        
-    RBuf thumbnailPath;
-    CleanupClosePushL(thumbnailPath);
-    ThumbnailPathL(thumbnailPath, 
-                   dataStorage.Fs(), 
-                   entry->ApplicationId(), 
-                   entry->ActivityId());
-    CreateThumbnailL(thumbnailPath, bitmapHdl());
-    entry->SetImageSrcL(thumbnailPath);
-    dataStorage.UpdateActivityL(*entry);
-    CleanupStack::PopAndDestroy(&thumbnailPath);
-    CleanupStack::PopAndDestroy(entry);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle removing activity.
- * @param dataStorage - data storage
- * @param msg - request message
- */
-void AfStorageSyncTask::DeleteActivityL(CAfStorage& dataStorage, 
-                                        const RMessage2& msg)
-{
-    CAfEntry *entry = CAfEntry::NewLC();
-    ReadEntryL(*entry, msg);
-    dataStorage.DeleteActivityL(*entry);
-    CleanupStack::PopAndDestroy(entry);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Handle removing all application activities.
- * @param dataStorage - data storage
- * @param msg - request message
- */
-void AfStorageSyncTask::DeleteApplicationActivitiesL(CAfStorage& dataStorage, 
-                                                     const RMessage2& msg)
-{
-    CAfEntry *entry = CAfEntry::NewLC();
-    ReadEntryL(*entry, msg);
-    dataStorage.DeleteActivitiesL(*entry);
-    CleanupStack::PopAndDestroy(entry);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void AfStorageSyncTask::NotifyChangeL(MAfTaskStorage& observers,
-                                      const RMessage2& msg)
-{
-    const RPointerArray<CAfTask> &table(observers.StorageData());
-    for (TInt iter(table.Count() - 1); 0 <= iter; --iter) {
-        table[iter]->BroadcastReceivedL(msg);
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void AfStorageSyncTask::ReadEntryL(CAfEntry& entry, const RMessage2& msg)
-{
-    RBuf8 serializedEntry;
-    CleanupClosePushL(serializedEntry);
-    serializedEntry.CreateL(msg.GetDesLengthL(0));
-    msg.ReadL(0, serializedEntry);
-    RDesReadStream reader(serializedEntry);
-    CleanupClosePushL(reader);
-    
-    reader >> entry;
-    
-    CleanupStack::PopAndDestroy(&reader);
-    CleanupStack::PopAndDestroy(&serializedEntry);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void AfStorageSyncTask::CreateThumbnailL(const TDesC &path, TInt hdl)
-{
-    if (0 >= hdl) {
-        User::Leave(KErrCorrupt);
-    }
-    CFbsBitmap *bitmap = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bitmap);
-    User::LeaveIfError(bitmap->Duplicate(hdl));
-    User::LeaveIfError(bitmap->Save(path));
-    CleanupStack::PopAndDestroy(bitmap);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void AfStorageSyncTask::ThumbnailPathL(RBuf &dst, 
-                                       RFs& fileSystem, 
-                                       TInt uid, 
-                                       const TDesC &activityName)
-{
-    _LIT(KUidFormat, "%+08x\\");
-    _LIT(KExtFormat, ".mbm");
-    //Generate activity hash
-    RBuf8 buff8;
-    CleanupClosePushL(buff8);
-    buff8.CreateL(activityName.Length());
-    buff8.Copy(activityName);
-    HBufC8 *activityHash = Md5HexDigestL(buff8);
-    CleanupStack::PopAndDestroy(&buff8);
-    CleanupStack::PushL(activityHash);
-    
-    //Get private path
-    RBuf privatePath;
-    CleanupClosePushL(privatePath);
-    privatePath.CreateL(KMaxPathLength);
-    User::LeaveIfError(fileSystem.PrivatePath(privatePath));
-    
-    //Format activity path
-    privatePath.AppendFormat( KUidFormat, uid);
-    
-    const TInt requiredSize(privatePath.Length() + 
-                            activityHash->Length() + 
-                            KExtFormat().Length());
-    CAfEntry::ReallocL(dst, requiredSize);
-    
-    //Copy path
-    dst.Copy(privatePath);
-    privatePath.Copy(*activityHash);//reuse already allocated buffer to convert 8 -> 16
-    dst.Append(privatePath);
-    dst.Append(KExtFormat());
-    
-    CleanupStack::PopAndDestroy(&privatePath);
-    CleanupStack::PopAndDestroy(activityHash);
-    
-    BaflUtils::EnsurePathExistsL(fileSystem, dst);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-HBufC8* AfStorageSyncTask::Md5HexDigestL(const TDes8 &string)
-{
-    _LIT8(KMd5HexFormat, "%+02x");
-    CMD5* md5 = CMD5::NewL();
-    CleanupStack::PushL(md5);
-    
-    TPtrC8 hashedSig(md5->Hash(string));
-    
-    HBufC8* buf = HBufC8::NewL(hashedSig.Length() * 2);
-    TPtr8 bufPtr = buf->Des();
-    
-    for(TInt i(0); i< hashedSig.Length(); ++i) {
-        bufPtr.AppendFormat(KMd5HexFormat,hashedSig[i]);
-    }
-    CleanupStack::PopAndDestroy(md5);
-    return buf;
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/afthumbnailtask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,135 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "afthumbnailtask.h"
-#include "activitycmd.h"
-
-#include <fbs.h>
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor for performing 1st stage construction
- */
-CAfThumbnailTask::CAfThumbnailTask(MAfTaskStorage& storage, 
-                                   const RMessage2 msg)
-:
-    mStorage(storage), 
-    mMsg(msg)
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor.
- */
-CAfThumbnailTask::~CAfThumbnailTask()
-{
-    delete mService;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CAfThumbnailTask::ExecuteLD(MAfTaskStorage& taskStorage,
-                                 const RMessage2& message)
-{
-    CAfThumbnailTask *self = new (ELeave)CAfThumbnailTask(taskStorage, 
-                                                                      message);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    taskStorage.PushL(self);
-    CleanupStack::Pop(self);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * EPOC default constructor for performing 2nd stage construction
- */
-void CAfThumbnailTask::ConstructL()
-{
-    TPckgBuf<int> width(0), height(0);
-    RBuf path;
-    RBuf8 mime;
-    CleanupClosePushL(path);
-    CleanupClosePushL(mime);
-    mMsg.ReadL(0, width);
-    mMsg.ReadL(1, height);
-    path.CreateL(mMsg.GetDesLengthL(2));
-    mMsg.ReadL(2, path);
-    mime.CreateL(mMsg.GetDesLengthL(3));
-    mMsg.ReadL(3, mime);
-    
-    CFbsBitmap *bitmap = new (ELeave) CFbsBitmap();
-    CleanupStack::PushL(bitmap);
-    User::LeaveIfError(bitmap->Load(path));
-    mService = CTsGraphicFileScalingHandler::NewL(*this, 
-                                                  *bitmap, 
-                                                  TSize(width(), height()), 
-                                                  CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding);
-    CleanupStack::PopAndDestroy(bitmap);
-
-    CleanupStack::PopAndDestroy(&mime);
-    CleanupStack::PopAndDestroy(&path);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CAfThumbnailTask::ImageReadyCallBack(TInt error,const CFbsBitmap *bitmap)
-{
-    if (EFalse == mMsg.IsNull() &&
-        KErrNone == error) {
-        mMsg.Write(0, TPckgBuf<int>(const_cast<CFbsBitmap*>(bitmap)->Handle()));
-        mMsg.Write(1, TPckgBuf<void *>(this));
-        mMsg.Complete(error);
-    } else {
-        if (EFalse == mMsg.IsNull()) {
-         mMsg.Complete(error);
-        }
-        mStorage.Pop(this);
-        delete this;
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-const TDesC8& CAfThumbnailTask::Data() const
-{
-    return KNullDesC8();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CAfThumbnailTask::BroadcastReceivedL(const RMessage2&)
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Returns ETrue if task is related with session argument
- */
-TBool CAfThumbnailTask::IsSessionTask(const CSession2* session)
-{
-    return mMsg.Session() == session ? ETrue : EFalse;
-}
--- a/activityfw/activitydatabase/hsactivitydbserver/src/main.cpp	Tue Jul 06 14:37:10 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:
-*
-*/
-#include "afserver.h"
-#include <e32base.h>
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-LOCAL_C void StartActivityServerL()
-{
-    CActiveScheduler* activeScheduler = new( ELeave ) CActiveScheduler;
-    CleanupStack::PushL( activeScheduler );
-    CActiveScheduler::Install( activeScheduler );
-    CAfServer* serverObject = CAfServer::NewLC();
-    RProcess::Rendezvous( KErrNone );
-    CActiveScheduler::Start();
-    CleanupStack::PopAndDestroy( serverObject );
-    CleanupStack::PopAndDestroy( activeScheduler );
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-LOCAL_C TInt StartActivityServer()
-{
-    __UHEAP_MARK;
-    TInt errNo(KErrNoMemory);
-    CTrapCleanup* cleanupStack = CTrapCleanup::New();
-    if (cleanupStack) {
-        TRAP(errNo, StartActivityServerL());
-        delete cleanupStack;
-    }
-    __UHEAP_MARKEND;
-    if (KErrNone != errNo) {
-        RProcess::Rendezvous(errNo);
-    }
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TInt E32Main()
-{
-    return StartActivityServer();
-}
--- a/activityfw/activitydatabase/inc/activitycmd.h	Tue Jul 06 14:37:10 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: 
-*
-*/
-#ifndef ACTIVITYCMD_H
-#define ACTIVITYCMD_H
-
-const TInt KRequestAppIdOffset(0);
-const TInt KRequestActOffset(1);
-const TInt KRequestData(2);
-const TInt KRequestIdOffset(0);
-
-const TInt KResponseDataSizeOffset(0);
-const TInt KResponseIdOffset(3);
-const TInt KResponseDataOffset(1);
-
-
-enum ActivityCmd {
-    AddActivity =0,
-    UpdateActivity,
-    RemoveActivity,
-    RemoveApplicationActivities,
-    Activities,
-    ApplicationActivities,
-    ApplicationActivity,
-    WaitActivity,
-    LaunchActivity,
-    GetThumbnail,
-    GetData,
-    NotifyChange,
-    CancelWait,
-    CancelNotify
-};
-
-#endif  //ACTIVITYCMD_H
-
--- a/activityfw/activitydatabase/inc/hsactivitydbclientinterface.h	Tue Jul 06 14:37:10 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 HSACTIVITYDBCLIENTINTERFACE_H
-#define HSACTIVITYDBCLIENTINTERFACE_H
-#include <qvariant.h>
-#include <activitycmd.h>
-/**
- * Enumerate supported functions
- */
-
-const char ActivityApplicationKeyword [] = ":ApplicationId";
-const char ActivityActivityKeyword [] = ":ActivityName";
-const char ActivityParametersKeyword [] = ":ActivityParams";
-const char ActivityPersistence [] = ":ActivityPersistence";
-const char ActivityVisibility [] = ":ActivityVisibility";
-const char ActivityScreenshotKeyword [] = "screenshot";
-const char ActivityDataKeyword [] = ":ActivityData";
-const char ActivityApplicationName[] = ":ApplicationName";
-
-class HsActivityDbClientInterface
-{
-public:
-
-    /**
-     * Function save provided avtivity in activity storage
-     * @param activity - activity to store
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int addActivity(const QVariantHash &privateData,
-                            const QVariantHash &publicData) =0;
-
-    /**
-     * Function update exiting activity
-     * @param activity - filtering rules
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int updateActivity(const QVariantHash &privateData,
-                               const QVariantHash &publicData) =0;
-
-    /**
-     * Function delete activity
-     * @param activity - filtering rules
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int removeActivity(const QVariantHash &activity) =0;
-
-    /**
-     * Function delete activity for application
-     * @param activity - filtering rules
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int removeApplicationActivities(const QVariantHash &activity) =0;
-
-    /**
-     * Function return list of all activity
-     * @param result - destination list
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int activities(QList<QVariantHash>& result) =0;
-
-    /**
-     * Function return list of all activity
-     * @param result - destination list,
-     * @param activity - filtering rules
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int applicationActivities(QList<QVariantHash>& result,
-                                      const QVariantHash &activity) =0;
-
-    /**
-     * Function returns data for activity
-     * @param result - activity data
-     * @param activity - filtering rules
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int activityData(QVariant &result, const QVariantHash &activity) = 0;
-                                      
-    /**
-     * Function subscribe to activity
-     * @param  activity - filtering rules
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int waitActivity(const QVariantHash &activity)=0;
-
-    /**
-     * Function launch application activity
-     * @param activity - filtering rules
-     * @return 0 on succees, error code otherwise
-     */
-    virtual int launchActivity(const QVariantHash &activity)=0;
-};
-#endif //HSACTIVITYDBCLIENTINTERFACE_H
--- a/activityfw/activitydatabase/s60/inc/afentry.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef AFENTRYDATA_H
-#define AFENTRYDATA_H
-
-#include <e32base.h>
-#include <s32strm.h>
-class RDbColWriteStream;
-class RDbColReadStream;
-const TInt KAfMask(0x0001);
-
-#ifdef AF_ADD_MASK
-#undef AF_ADD_MASK
-#endif
-#define AF_ADD_MASK(n) (KAfMask << n)
-
-class CAfEntry: public CBase
-{
-public:
-    enum AccessRights {
-    Private =0,
-    Public
-    };
-
-    enum Flags {
-    Invisible = KAfMask,
-    Persistent = 0x40000000,
-    };
-
-public:
-    static CAfEntry* NewL();
-
-    static CAfEntry* NewLC();
-
-    static CAfEntry* NewL(TInt flags,
-                          TInt applicationId,
-                          const TDesC &activityId,
-                          const TDesC &imgSrc,
-                          const TDesC8 &privateData,
-                          const TDesC8 &publicData);
-
-    static CAfEntry* NewLC(TInt flags,
-                           TInt applicationId,
-                           const TDesC &activityId,
-                           const TDesC &imgSrc,
-                           const TDesC8 &privateData,
-                           const TDesC8 &publicData);
-
-    ~CAfEntry();
-
-    TInt Size() const;
-
-    TInt DataSize() const;
-
-    void ExternalizeL(RWriteStream &stream) const;
-
-    void InternalizeL(RReadStream &stream);
-
-    void ExternalizeDataOnlyL(RWriteStream &stream) const;
-
-    void InternalizeDataOnlyL(RReadStream &stream);
-
-    TInt Flags() const;
-
-    TInt ApplicationId() const;
-
-    const TDesC& ActivityId() const;
-
-    const TDesC& ImageSrc() const;
-
-    void SetImageSrcL(const TDesC& src);
-
-    const TDesC8& Data(CAfEntry::AccessRights rights) const;
-
-    void SetDataL(const TDesC8& src, CAfEntry::AccessRights rights);
-
-    static void ReallocL(RBuf8 &dst,TInt length);
-
-    static void ReallocL(RBuf &dst,TInt length);
-
-    static void CopyL(RBuf8 &dst,const TDesC8 &src);
-
-    static void CopyL(RBuf &dst,const TDesC &src);
-
-private:
-    CAfEntry();
-
-    void ConstructL(TInt flags,
-                    TInt applicationId,
-                    const TDesC &activityId,
-                    const TDesC &imgSrc,
-                    const TDesC8 &privateData,
-                    const TDesC8 &publicData);
-
-    static void InternalizeL(RBuf8 &dst, RReadStream &src);
-
-    static void InternalizeL(RBuf &dst, RReadStream &src);
-
-    static void ExternalizeL(RWriteStream &dst,const TDesC8 & src);
-
-    static void ExternalizeL(RWriteStream &dst,const TDesC& src);
-private:
-    TInt mFlags;
-    TInt mAppId;
-    RBuf mActivityId;
-    RBuf mImgSrc;
-    RBuf8 mPrivateData;
-    RBuf8 mPublicData;
-
-};
-
-RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src);
-
-RBuf8& operator << (RBuf8 &dst, const RPointerArray<CAfEntry>& src);
-
-#endif
--- a/activityfw/activitydatabase/s60/inc/hsactivityglobals.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef ACTIVITYSYMBIAN_H
-#define ACTIVITYSYMBIAN_H
-
-#include <e32base.h>
-const TUid KActivityServerUid = {0x200267B4};
-_LIT(KActivityServerName, "hsactivitydbserver");
-_LIT(KErr400, "Bad Reqest");
-_LIT(KErr403, "Access denied");
-
-#endif
--- a/activityfw/activitydatabase/s60/inc/hsserializer.h	Tue Jul 06 14:37:10 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 HSSERIALIZER_H
-#define HSSERIALIZER_H
-
-#include <qvariant.h>
-
-/**
- * Operator serialize VarinatHash to RBuf8
- */
-RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src);
-
-/**
- * Operator deserialize RBuf8 to VarinatHash
- */
-QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src);
-
-#endif
--- a/activityfw/activitydatabase/s60/src/afentry.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,446 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "afentry.h"
-#include <s32mem.h>
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create and initialize instance
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewL()
-{
-    CAfEntry *self = CAfEntry::NewLC();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create, initialize and push instance into cleanup stack
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewLC()
-{
-    CAfEntry *self = new (ELeave)CAfEntry();
-    CleanupStack::PushL(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create and initialize instance
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewL(TInt flags,
-                         TInt applicationId,
-                         const TDesC &activityId,
-                         const TDesC &imgSrc,
-                         const TDesC8 &privateData,
-                         const TDesC8 &publicData)
-{
-    CAfEntry* self = CAfEntry::NewLC(flags, 
-                                     applicationId, 
-                                     activityId, 
-                                     imgSrc, 
-                                     privateData, 
-                                     publicData);
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create, initialize and push instance into cleanup stack
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewLC(TInt flags,
-                          TInt applicationId,
-                          const TDesC &activityId,
-                          const TDesC &imgSrc,
-                          const TDesC8 &privateData,
-                          const TDesC8 &publicData)
-{
-    CAfEntry *self = CAfEntry::NewLC();
-    self->ConstructL(flags, 
-                     applicationId, 
-                     activityId, 
-                     imgSrc, 
-                     privateData, 
-                     publicData);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * First phase constructor
- */
-CAfEntry::CAfEntry()
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Second phase constructor. Initialize instance
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data 
- */
-void CAfEntry::ConstructL(TInt flags,
-                          TInt applicationId,
-                          const TDesC &activityId,
-                          const TDesC &imgSrc,
-                          const TDesC8 &privateData,
-                          const TDesC8 &publicData)
-{
-    mFlags = flags;
-    mAppId = applicationId;
-    CopyL(mActivityId, activityId);
-    CopyL(mImgSrc, imgSrc);
-    CopyL(mPrivateData, privateData);
-    CopyL(mPublicData, publicData);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor. Release allocated resources 
- */
-CAfEntry::~CAfEntry()
-{
-    mActivityId.Close();
-    mPrivateData.Close();
-    mPublicData.Close();
-    mImgSrc.Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide size of serialized entry
- * @return size of serialized entry instance
- */
-TInt CAfEntry::Size() const
-{
-    return (sizeof(TInt) * 3) + //flags + appId + actId size info 
-           mActivityId.Size() + //actId content size
-           DataSize(); //data size
-           
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide size of serialized entry
- * @return size of serialized entry instance
- */
-TInt CAfEntry::DataSize() const
-{
-    return (sizeof(TInt) * 3) + //privData size info + pubData size info + imgSrc size info
-            mImgSrc.Size() + //imgSize content size
-            mPrivateData.Size() + //privData content size
-            mPublicData.Size(); //pubData content size 
-}
-// -----------------------------------------------------------------------------
-/**
- * Serialize entry content into output stream.
- * @param stream - output stream
- */
-void CAfEntry::ExternalizeL(RWriteStream &stream) const
-{
-    stream.WriteInt32L(mFlags);
-    stream.WriteInt32L(mAppId);
-    ExternalizeL(stream, mActivityId);
-    ExternalizeDataOnlyL(stream);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize entry content from input stream
- * @param stream - input stream
- */
-void CAfEntry::InternalizeL(RReadStream &stream)
-{
-    mFlags = stream.ReadInt32L();
-    mAppId = stream.ReadInt32L();
-    InternalizeL(mActivityId, stream);
-    InternalizeDataOnlyL(stream);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize entry content into output stream.
- * @param stream - output stream
- */
-void CAfEntry::ExternalizeDataOnlyL(RWriteStream &stream) const
-{
-    ExternalizeL(stream, mImgSrc);
-    ExternalizeL(stream, mPrivateData);
-    ExternalizeL(stream, mPublicData);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize entry content from input stream
- * @param stream - input stream
- */
-void CAfEntry::InternalizeDataOnlyL(RReadStream &stream)
-{
-    
-    InternalizeL(mImgSrc, stream);
-    InternalizeL(mPrivateData, stream);
-    InternalizeL(mPublicData, stream);
-    
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity flags
- * @return activity flags 
- */
-TInt CAfEntry::Flags() const
-{
-    return mFlags;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity identifier.
- * @return activity identifier
- */
-TInt CAfEntry::ApplicationId() const
-{
-    return mAppId;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity identifier.
- * @return activity identifier
- */
-const TDesC& CAfEntry::ActivityId() const
-{
-    return mActivityId;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity data.
- * @param rights - type of requested data
- * @return activity data
- */
-const TDesC8& CAfEntry::Data(CAfEntry::AccessRights rights) const
-{
-    return Private == rights ? mPrivateData : mPublicData;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity data.
- * @param rights - type of requested data
- * @return activity data
- */
-void CAfEntry::SetDataL(const TDesC8& src, CAfEntry::AccessRights rights)
-{
-    CopyL(Private == rights ? mPrivateData : mPublicData, src);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity thumbail path
- * @return path to activity thumbnail 
- */
-const TDesC& CAfEntry::ImageSrc() const
-{
-    return mImgSrc;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Set new value of image source
- */
-void CAfEntry::SetImageSrcL(const TDesC& src)
-{
-    CopyL(mImgSrc, src);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Reallocate blob buffer to requested size
- * @param dst - destination buffer
- * @param length - requested length
- */
-void CAfEntry::ReallocL(RBuf8 &dst,TInt length)
-{
-    if (0 < length) {
-        if (dst.MaxLength() < length) {
-            dst.ReAllocL(length);
-        }
-    } else {
-        dst.Close();
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Reallocate text buffer to requested size
- * @param dst - destination buffer
- * @param length - requested length
- */
-void CAfEntry::ReallocL(RBuf &dst,TInt length)
-{
-    if (0 < length) {
-        if (dst.MaxLength() < length) {
-            dst.ReAllocL(length);
-        }
-    } else {
-        dst.Close();
-    }
-}
-// -----------------------------------------------------------------------------
-/**
- * Copy blob content from input stream
- * @param dst - destination buffer
- * @param src - source buffer
- */
-void CAfEntry::CopyL(RBuf8 &dst,const TDesC8 &src)
-{
-    ReallocL(dst, src.Length());
-    if(0 < src.Length()) {
-        dst.Copy(src);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Copy text content from input buffer
- * @param dst - destination buffer
- * @param src - source buffer
- */
-void CAfEntry::CopyL(RBuf &dst,const TDesC &src)
-{
-    ReallocL(dst, src.Length());
-    if(0 < src.Length()) {
-        dst.Copy(src);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize blob content from input stream
- * @param dst - destination buffer
- * @param src - input stream
- */
-void CAfEntry::InternalizeL(RBuf8 &dst, RReadStream &src)
-{
-    const TInt length(src.ReadInt32L());
-    ReallocL(dst, length);
-    if (0 < length) {
-        src.ReadL(dst, length);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize text content from input stream
- * @param dst - destination buffer
- * @param src - input stream
- */
-void CAfEntry::InternalizeL(RBuf &dst, RReadStream &src)
-{
-    const TInt length(src.ReadInt32L());
-    ReallocL(dst, length);
-    if (0 < length) {
-        src.ReadL(dst, length);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize blob content into output stream
- * @param dst - destination stream
- * @param src - input buffer
- */
-void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC8 & src)
-{
-    dst.WriteInt32L(src.Length());
-    if (src.Length()) {
-        dst.WriteL(src, src.Length());
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize text content into output stream
- * @param dst - destination stream
- * @param src - input buffer
- */
-void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC& src)
-{
-    dst.WriteInt32L(src.Length());
-    if (src.Length()) {
-        dst.WriteL(src, src.Length());
-    }
-}
-
-// -----------------------------------------------------------------------------
-RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src)
-{
-    dst.ResetAndDestroy();
-    RDesReadStream srcStream(src);
-    CleanupClosePushL(srcStream);
-    int numOfItems(srcStream.ReadInt32L());
-    for (int i(0); i < numOfItems; ++i) {
-        CAfEntry *entry = CAfEntry::NewLC();
-        srcStream >> (*entry);
-        dst.AppendL(entry);
-        CleanupStack::Pop(entry);
-    }
-    CleanupStack::PopAndDestroy(&srcStream);
-    return dst;
-}
-
-// -----------------------------------------------------------------------------
-RBuf8& operator <<(RBuf8 &dst, const RPointerArray<CAfEntry>& src)
-{
-    int iter(0), 
-        requiredSize(sizeof(int));
-    for(iter =0; iter< src.Count(); ++iter) {
-        requiredSize += src[iter]->Size();
-    }
-    CAfEntry::ReallocL(dst, requiredSize);
-    RDesWriteStream dstStream(dst);
-    CleanupClosePushL(dstStream);
-    dstStream.WriteInt32L(src.Count());
-    for (iter =0; iter < src.Count(); ++iter) {
-        dstStream << *(src[iter]);
-    }
-    CleanupStack::PopAndDestroy(&dstStream);
-    return dst;
-}
--- a/activityfw/activitydatabase/s60/src/hsserializer.cpp	Tue Jul 06 14:37:10 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 <s32mem.h>
-#include "hsserializer.h"
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src)
-{
-    QByteArray buffer;
-    QDataStream stream(&buffer, QIODevice::WriteOnly);
-
-    QT_TRYCATCH_LEAVING(stream << src);
-    const int dataLength(buffer.length());
-    const unsigned char *dataPtr(reinterpret_cast<const unsigned char *>(buffer.constData()));
-    if (dst.MaxLength() < dataLength) {
-        dst.ReAllocL(dataLength);
-    }
-    dst.Copy(dataPtr, dataLength);
-    return dst;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src)
-{
-    QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char *>(src.Ptr()),
-                                               src.Length()) );
-
-    QDataStream stream(&buffer, QIODevice::ReadOnly);
-    QT_TRYCATCH_LEAVING(stream >> dst);
-    return dst;
-}
--- a/activityfw/activityfw.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/activityfw.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -20,7 +20,8 @@
 
 SUBDIRS += tsutils
 
-symbian:SUBDIRS += storage
+symbian:SUBDIRS +=  storage \
+                    afactivitylauncher \
 
 SUBDIRS +=  activityserviceplugin \
             orbitintegration/hbactivityplugin \
--- a/activityfw/activityserviceplugin/activityserviceplugin.pri	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/activityserviceplugin/activityserviceplugin.pri	Wed Aug 18 10:05:49 2010 +0300
@@ -16,5 +16,3 @@
 
 CONFIG += mobility
 MOBILITY = serviceframework
-
-QT += sql
--- a/activityfw/activityserviceplugin/activityserviceplugin.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/activityserviceplugin/activityserviceplugin.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -15,37 +15,59 @@
 #
 
 TEMPLATE = lib
-TARGET = activityserviceplugin
+TARGET = afservice
 
 CONFIG += plugin 
 include(activityserviceplugin.pri)
 
+DEFINES += AFACTIVITIES_LIB
+
 INCLUDEPATH += ./inc \
-               ../../inc
+               ../inc \
+
+HEADERS +=  ./inc/afserviceplugin.h \
+            ./inc/afclient.h \
+            ./inc/afmanager.h \
+            ./inc/afactivitystorage_p.h \
+            ./inc/afactivation_p.h \
+            ./inc/afcommandlineparser.h \
+            ./inc/afstorageproxy.h \
 
-HEADERS +=  ./inc/activityserviceplugin.h \
-            ./inc/afactivityclient.h \
-            ./inc/afactivitymanager.h \
-            ./inc/applicationlauncher.h \
+HEADERS +=  ../../homescreensrv_plat/activity_framework_api/afactivities_global.h \
+            ../../homescreensrv_plat/activity_framework_api/afactivitystorage.h \
+            ../../homescreensrv_plat/activity_framework_api/afactivation.h \
 
-SOURCES +=  ./src/activityserviceplugin.cpp \
-            ./src/afactivityclient.cpp \
-            ./src/afactivitymanager.cpp \
-            ./src/applicationlauncher.cpp \
+SOURCES +=  ./src/afserviceplugin.cpp \
+            ./src/afclient.cpp \
+            ./src/afmanager.cpp \
+            ./src/aflauncher.cpp \
+            ./src/afactivitystorage.cpp \
+            ./src/afactivitystorage_p.cpp \
+            ./src/afactivation.cpp \
+            ./src/afactivation_p.cpp \
+            ./src/afcommandlineparser.cpp \
+            ./src/afstorageproxy.cpp \
 
 symbian {
     INCLUDEPATH += ./s60/inc \
 
-    SOURCES += ./s60/src/applicationlauncher_p.cpp
+    SOURCES +=  ./s60/src/applicationlauncher_p.cpp \
+                ./s60/src/afstorageproxy_p.cpp \
+                ./s60/src/afserializer.cpp \
     
-    HEADERS += ./s60/inc/applicationlauncher_p.h
+    HEADERS +=  ./s60/inc/applicationlauncher_p.h \
+                ./s60/inc/afstorageproxy_p.h \
+                ./s60/inc/afserializer.h \
 
     LIBS += -lapparc \
             -lapgrfx \
             -lcone \
             -lafstorageclient \
-            -lxqutils
- 
+            -lxqutils \
+            -lafstoragecommon.lib \
+            -lestor \
+            -lfbscli \
+
 }
 
 win32 {
@@ -62,15 +84,27 @@
     TARGET.CAPABILITY = ALL -TCB
     TARGET.UID3 = 0x200267B2
 
-    plugin.sources = activityserviceplugin.dll
+    plugin.sources = afservice.dll
     plugin.path = $$QT_PLUGINS_BASE_DIR     
     
-    xml.sources = ./data/activityserviceplugin.xml
+    xml.sources = ./data/afservice.xml
     xml.path = $$RESOURCE_FILES_DIR/activity
     
     DEPLOYMENT += xml
 
     #temporary workaround
-    BLD_INF_RULES.prj_exports += "data/activityserviceplugin.xml z:/resource/activity/activityserviceplugin.xml"
+    BLD_INF_RULES.prj_exports += "data/afservice.xml z:/resource/activity/afservice.xml"
+    
+    #export xml with old name (remove after next release)
+    BLD_INF_RULES.prj_exports += "data/afservice.xml z:/resource/activity/activityserviceplugin.xml"
+    BLD_INF_RULES.prj_exports += "data/afservice.xml $$QT_PLUGINS_BASE_DIR/activityserviceplugin.xml"    
     
+    # we want to export few classes, use standard .def block instead of the one generated by plugin
+    defBlock = \
+        "$${LITERAL_HASH}ifdef WINSCW" \
+        "DEFFILE ./bwins/$${TARGET}.def" \
+        "$${LITERAL_HASH}elif defined EABI" \
+        "DEFFILE ./eabi/$${TARGET}.def" \
+        "$${LITERAL_HASH}endif"
+    MMP_RULES += defBlock
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/bwins/afserviceu.def	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,37 @@
+EXPORTS
+	qt_plugin_query_verification_data @ 1 NONAME
+	qt_plugin_instance @ 2 NONAME
+	?tr@AfActivation@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString AfActivation::tr(char const *, char const *)
+	?qt_metacall@AfActivation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 4 NONAME ; int AfActivation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?tr@AfActivityStorage@@SA?AVQString@@PBD0H@Z @ 5 NONAME ; class QString AfActivityStorage::tr(char const *, char const *, int)
+	?reason@AfActivation@@QBE?AW4ActivationReason@Af@@XZ @ 6 NONAME ; enum Af::ActivationReason AfActivation::reason(void) const
+	?qt_metacast@AfActivation@@UAEPAXPBD@Z @ 7 NONAME ; void * AfActivation::qt_metacast(char const *)
+	?tr@AfActivation@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString AfActivation::tr(char const *, char const *, int)
+	?qt_metacall@AfActivityStorage@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int AfActivityStorage::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??0AfActivation@@QAE@PAVQObject@@@Z @ 10 NONAME ; AfActivation::AfActivation(class QObject *)
+	?activated@AfActivation@@IAEXW4ActivationReason@Af@@VQString@@V?$QHash@VQString@@VQVariant@@@@@Z @ 11 NONAME ; void AfActivation::activated(enum Af::ActivationReason, class QString, class QHash<class QString, class QVariant>)
+	??1AfActivityStorage@@UAE@XZ @ 12 NONAME ; AfActivityStorage::~AfActivityStorage(void)
+	?staticMetaObject@AfActivityStorage@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const AfActivityStorage::staticMetaObject
+	?trUtf8@AfActivation@@SA?AVQString@@PBD0H@Z @ 14 NONAME ; class QString AfActivation::trUtf8(char const *, char const *, int)
+	?activityMetaData@AfActivityStorage@@QBE?AV?$QHash@VQString@@VQVariant@@@@ABVQString@@@Z @ 15 NONAME ; class QHash<class QString, class QVariant> AfActivityStorage::activityMetaData(class QString const &) const
+	?getStaticMetaObject@AfActivityStorage@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & AfActivityStorage::getStaticMetaObject(void)
+	??0AfActivityStorage@@QAE@PAVQObject@@@Z @ 17 NONAME ; AfActivityStorage::AfActivityStorage(class QObject *)
+	?staticMetaObject@AfActivation@@2UQMetaObject@@B @ 18 NONAME ; struct QMetaObject const AfActivation::staticMetaObject
+	?trUtf8@AfActivation@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString AfActivation::trUtf8(char const *, char const *)
+	??_EAfActivation@@UAE@I@Z @ 20 NONAME ; AfActivation::~AfActivation(unsigned int)
+	?allActivities@AfActivityStorage@@QBE?AVQStringList@@XZ @ 21 NONAME ; class QStringList AfActivityStorage::allActivities(void) const
+	?qt_metacast@AfActivityStorage@@UAEPAXPBD@Z @ 22 NONAME ; void * AfActivityStorage::qt_metacast(char const *)
+	?activityData@AfActivityStorage@@QBE?AVQVariant@@ABVQString@@@Z @ 23 NONAME ; class QVariant AfActivityStorage::activityData(class QString const &) const
+	?getStaticMetaObject@AfActivation@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & AfActivation::getStaticMetaObject(void)
+	?tr@AfActivityStorage@@SA?AVQString@@PBD0@Z @ 25 NONAME ; class QString AfActivityStorage::tr(char const *, char const *)
+	?name@AfActivation@@QBE?AVQString@@XZ @ 26 NONAME ; class QString AfActivation::name(void) const
+	?metaObject@AfActivation@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * AfActivation::metaObject(void) const
+	?metaObject@AfActivityStorage@@UBEPBUQMetaObject@@XZ @ 28 NONAME ; struct QMetaObject const * AfActivityStorage::metaObject(void) const
+	?trUtf8@AfActivityStorage@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString AfActivityStorage::trUtf8(char const *, char const *)
+	?trUtf8@AfActivityStorage@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString AfActivityStorage::trUtf8(char const *, char const *, int)
+	??_EAfActivityStorage@@UAE@I@Z @ 31 NONAME ; AfActivityStorage::~AfActivityStorage(unsigned int)
+	?saveActivity@AfActivityStorage@@QAE_NABVQString@@ABVQVariant@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 32 NONAME ; bool AfActivityStorage::saveActivity(class QString const &, class QVariant const &, class QHash<class QString, class QVariant> const &)
+	?parameters@AfActivation@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 33 NONAME ; class QHash<class QString, class QVariant> AfActivation::parameters(void) const
+	??1AfActivation@@UAE@XZ @ 34 NONAME ; AfActivation::~AfActivation(void)
+	?removeActivity@AfActivityStorage@@QAE_NABVQString@@@Z @ 35 NONAME ; bool AfActivityStorage::removeActivity(class QString const &)
+
--- a/activityfw/activityserviceplugin/data/activityserviceplugin.xml	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<service>
-    <name>ActivityService</name>
-    <filepath>activityserviceplugin</filepath>
-    <description>Activities service</description>
-    <interface>
-        <name>com.nokia.qt.activities.ActivityClient</name>
-        <version>1.0</version>
-        <description>Implementation of ActivityClient</description>
-    </interface>
-    <interface>
-        <name>com.nokia.qt.activities.ActivityManager</name>
-        <version>1.0</version>
-        <description>Implementation of ActivityManager</description>
-    </interface>
-</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/data/afservice.xml	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<service>
+    <name>ActivityService</name>
+    <filepath>afservice</filepath>
+    <description>Activities service</description>
+    <interface>
+        <name>com.nokia.qt.activities.ActivityClient</name>
+        <version>1.0</version>
+        <description>Implementation of ActivityClient</description>
+    </interface>
+    <interface>
+        <name>com.nokia.qt.activities.ActivityManager</name>
+        <version>1.0</version>
+        <description>Implementation of ActivityManager</description>
+    </interface>
+    <interface>
+        <name>com.nokia.qt.activities.Storage</name>
+        <version>1.0</version>
+        <description>Implementation of Storage</description>
+    </interface>
+    <interface>
+        <name>com.nokia.qt.activities.Activation</name>
+        <version>1.0</version>
+        <description>Implementation of Activation</description>
+    </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/eabi/afserviceu.def	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,34 @@
+EXPORTS
+	qt_plugin_query_verification_data @ 1 NONAME
+	qt_plugin_instance @ 2 NONAME
+	_ZN12AfActivation11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
+	_ZN12AfActivation11qt_metacastEPKc @ 4 NONAME
+	_ZN12AfActivation16staticMetaObjectE @ 5 NONAME DATA 16
+	_ZN12AfActivation19getStaticMetaObjectEv @ 6 NONAME
+	_ZN12AfActivation9activatedEN2Af16ActivationReasonE7QString5QHashIS2_8QVariantE @ 7 NONAME
+	_ZN12AfActivationC1EP7QObject @ 8 NONAME
+	_ZN12AfActivationC2EP7QObject @ 9 NONAME
+	_ZN17AfActivityStorage11qt_metacallEN11QMetaObject4CallEiPPv @ 10 NONAME
+	_ZN17AfActivityStorage11qt_metacastEPKc @ 11 NONAME
+	_ZN17AfActivityStorage12saveActivityERK7QStringRK8QVariantRK5QHashIS0_S3_E @ 12 NONAME
+	_ZN17AfActivityStorage14removeActivityERK7QString @ 13 NONAME
+	_ZN17AfActivityStorage16staticMetaObjectE @ 14 NONAME DATA 16
+	_ZN17AfActivityStorage19getStaticMetaObjectEv @ 15 NONAME
+	_ZN17AfActivityStorageC1EP7QObject @ 16 NONAME
+	_ZN17AfActivityStorageC2EP7QObject @ 17 NONAME
+	_ZN17AfActivityStorageD0Ev @ 18 NONAME
+	_ZN17AfActivityStorageD1Ev @ 19 NONAME
+	_ZN17AfActivityStorageD2Ev @ 20 NONAME
+	_ZNK12AfActivation10metaObjectEv @ 21 NONAME
+	_ZNK12AfActivation10parametersEv @ 22 NONAME
+	_ZNK12AfActivation4nameEv @ 23 NONAME
+	_ZNK12AfActivation6reasonEv @ 24 NONAME
+	_ZNK17AfActivityStorage10metaObjectEv @ 25 NONAME
+	_ZNK17AfActivityStorage12activityDataERK7QString @ 26 NONAME
+	_ZNK17AfActivityStorage13allActivitiesEv @ 27 NONAME
+	_ZNK17AfActivityStorage16activityMetaDataERK7QString @ 28 NONAME
+	_ZTI12AfActivation @ 29 NONAME
+	_ZTI17AfActivityStorage @ 30 NONAME
+	_ZTV12AfActivation @ 31 NONAME
+	_ZTV17AfActivityStorage @ 32 NONAME
+
--- a/activityfw/activityserviceplugin/inc/activityserviceplugin.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef ACTIVITYSERVICEPLUGIN_H
-#define ACTIVITYSERVICEPLUGIN_H
-
-#include <QObject>
-#include <qserviceplugininterface.h>
-
-QTM_USE_NAMESPACE
-
-class ActivityServicePlugin : public QObject, public QServicePluginInterface
-{
-    Q_OBJECT
-    Q_INTERFACES(QtMobility::QServicePluginInterface)
-
-public:
-    QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session);
-
-};
-
-#endif //ACTIVITYSERVICEPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afactivation_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFACTIVATION_P_H
+#define AFACTIVATION_P_H
+
+#include "afactivities_global.h"
+
+#include <QObject>
+#include <QString>
+#include <QStringList>
+#include <QVariantHash>
+#include <QSharedPointer>
+
+#include "afstorageproxy.h"
+
+class AfActivationPrivate : public QObject
+{
+    Q_OBJECT
+    
+public:
+    AfActivationPrivate(const QSharedPointer<AfStorageProxy> &connection, QObject *parent = 0);
+       
+public:
+    QVariantHash parameters() const;
+    Af::ActivationReason reason() const;
+    QString name() const;
+       
+signals:
+    void activated(Af::ActivationReason reason, QString name, QVariantHash parameters);        
+        
+private slots:
+    void handleActivityRequest(const QString &activityId);
+    void bringToForeground();        
+               
+private:
+    QVariantHash mParameters;
+    Af::ActivationReason mReason;
+    QString mName;
+        
+private:
+    QSharedPointer<AfStorageProxy> mConnection;     
+
+};
+
+#endif // AFACTIVATION_P_H
--- a/activityfw/activityserviceplugin/inc/afactivityclient.h	Tue Jul 06 14:37:10 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 AFACTIVITYCLIENT_H
-#define AFACTIVITYCLIENT_H
-
-#include <QObject>
-#include <QVariant>
-#include <QString>
-
-#include <afstorageclient.h>
-
-class ActivityClient : public QObject
-{
-
-    Q_OBJECT
-
-public:
-    ActivityClient(const QSharedPointer<AfStorageClient> &serviceProvider,QObject *parent = 0);
-    ~ActivityClient();
-
-public slots:
-    bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash &parameters);
-    bool removeActivity(const QString &activityId);
-    bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash &parameters);
-    QList<QVariantHash> activities() const;
-    QVariant activityData(const QString &activityId) const;
-    QVariantHash parseCommandLine(const QStringList &commandLineParams) const;
-
-signals:
-    void activityRequested(const QString &activityId);
-
-private:
-    QSharedPointer<AfStorageClient> mServiceProvider;
-    bool mIsconnected;
-};
-
-#endif // AFACTIVITYCLIENT_H
--- a/activityfw/activityserviceplugin/inc/afactivitymanager.h	Tue Jul 06 14:37:10 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 AFACTIVITYMANAGER_H
-#define AFACTIVITYMANAGER_H
-
-#include <QObject>
-#include <QVariant>
-#include <QList>
-#include <QPixmap>
-#include <QSize>
-
-#include <afstorageclient.h>
-
-class ActivityManager : public QObject
-{
-
-    Q_OBJECT
-
-public:
-    ActivityManager(const QSharedPointer<AfStorageClient> &serviceProvider, QObject *parent = 0);
-    ~ActivityManager();
-
-public slots:
-    QList<QVariantHash> activitiesList();
-    void launchActivity(const QString &uri);
-    void launchActivity(const QUrl &uri);
-    void launchActivity(int applicationId, const QString &activityId, const QVariantHash& parameters = QVariantHash());
-    void getThumbnail(QSize resolution,const QString &thumbnailPath, void *data =0);
-
-signals:
-    void thumbnailReady(QPixmap, void *);
-    void dataChanged();
-
-private:
-    void launchActivity(const QVariantHash& activity);
-    QUrl activityToUri(const QVariantHash& activity) const;
-
-private:
-    QSharedPointer<AfStorageClient> mServiceProvider;
-};
-
-#endif // AFACTIVITYMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afactivitystorage_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFACTIVITYSTORAGE_P_H
+#define AFACTIVITYSTORAGE_P_H
+
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+#include <QSharedPointer>
+
+#include "afstorageproxy.h"
+
+class AfActivityStoragePrivate
+{
+
+public:
+    AfActivityStoragePrivate(const QSharedPointer<AfStorageProxy> &connection);
+
+public:
+    bool saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata);
+    bool removeActivity(const QString &activityId);
+
+    QStringList allActivities() const;
+
+    QVariant activityData(const QString &activityId) const;
+    QVariantHash activityMetaData(const QString &activityId) const;
+
+private: // helper methods
+    static int applicationId();
+    
+private:
+    QSharedPointer<AfStorageProxy> mConnection;
+    
+};
+
+#endif // AFACTIVITYSTORAGE_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afclient.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFCLIENT_H
+#define AFCLIENT_H
+
+#include <QObject>
+#include <QVariant>
+#include <QString>
+#include <QSharedPointer>
+
+#include "afactivitystorage.h"
+#include "afactivation.h"
+
+class AfClient : public QObject
+{
+    Q_OBJECT
+
+public:
+    AfClient(const QSharedPointer<AfActivityStorage> &storage, const QSharedPointer<AfActivation> &activation, QObject *parent = 0);             
+    ~AfClient();
+
+public slots:
+    bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash &parameters);
+    bool removeActivity(const QString &activityId);
+    bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash &parameters);
+    QList<QVariantHash> activities() const;
+    QVariant activityData(const QString &activityId) const;
+    QVariantHash parseCommandLine(const QStringList &commandLineParams) const;
+
+private slots:
+    void handleActivityRequest(Af::ActivationReason reason, const QString &name, const QVariantHash &parameters);
+    
+signals:
+    void activityRequested(const QString &activityId);
+
+private:    
+    QSharedPointer<AfActivityStorage> mStorage;
+    QSharedPointer<AfActivation> mActivation;
+    
+};
+
+#endif // AFCLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afcommandlineparser.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFCOMMANDLINEPARSER_H
+#define AFCOMMANDLINEPARSER_H
+
+#include "afactivities_global.h"
+#include <QVariant>
+#include <QString>
+#include <QHash>
+#include <QStringList>
+
+class AfCommandLineParser {
+public:
+    static void parseCommandLine(const QStringList &commandLineParams,
+            Af::ActivationReason &reason,
+            QString &name,
+            QVariantHash &parameters);   
+private: 
+    static bool isServiceCommand(const QStringList &commandLineParams);
+    static bool isActivityCommand(const QStringList &commandLineParams);
+    static void parseServiceParameters(const QStringList &commandLineParams,
+            Af::ActivationReason &reason,
+            QString &name,
+            QVariantHash &parameters); 
+    static void parseActivityParameters(const QStringList &commandLineParams,
+            Af::ActivationReason &reason,
+            QString &name,
+            QVariantHash &parameters); 
+public: // TODO make privete when deprecated api removed
+    static QVariantHash getActivityParameters(const QStringList &commandLineParams);
+};
+
+#endif // AFCOMMANDLINEPARSER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/aflauncher.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFLAUNCHER_H
+#define AFLAUNCHER_H
+
+class ApplicationLauncherPrivate;
+
+#include <QString>
+#include <QUrl>
+
+class AfLauncher
+{
+
+public:
+    AfLauncher();
+    ~AfLauncher();
+
+public:
+    bool isRunning(int applicationId);
+    void startApplication(int applicationId, const QUrl &uri);
+    void bringToForeground(int applicationId);
+
+private:
+    ApplicationLauncherPrivate *d_ptr;
+
+};
+
+#endif // AFLAUNCHER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afmanager.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFMANAGER_H
+#define AFMANAGER_H
+
+#include <QObject>
+#include <QVariant>
+#include <QList>
+#include <QPixmap>
+#include <QSize>
+
+#include "afstorageproxy.h"
+
+class AfManager : public QObject
+{
+
+    Q_OBJECT
+
+public:
+    AfManager(const QSharedPointer<AfStorageProxy> &serviceProvider, QObject *parent = 0);
+    ~AfManager();
+
+public slots:
+    QList<QVariantHash> activitiesList();
+    void launchActivity(const QString &uri);
+    void launchActivity(const QUrl &uri);
+    void launchActivity(int applicationId, const QString &activityId, const QVariantHash& parameters = QVariantHash());
+    void getThumbnail(QSize resolution,const QString &thumbnailPath, void *data =0);
+
+signals:
+    void thumbnailReady(QPixmap, void *);
+    void dataChanged();
+
+private:
+    void launchActivity(const QVariantHash& activity);
+    QUrl activityToUri(const QVariantHash& activity) const;
+
+private:
+    QSharedPointer<AfStorageProxy> mServiceProvider;
+};
+
+#endif // AFMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afserviceplugin.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFSERVICEPLUGIN_H
+#define AFSERVICEPLUGIN_H
+
+#include <QObject>
+#include <qserviceplugininterface.h>
+
+QTM_USE_NAMESPACE
+
+class AfServicePlugin : public QObject, public QServicePluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+    QObject *createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session);
+
+};
+
+#endif //AFSERVICEPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/inc/afstorageproxy.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef AFSTORAGEPROXY_H
+#define AFSTORAGEPROXY_H
+
+#include <QObject>
+#include <QVariant>
+#include <QStringList>
+
+class AfStorageProxyPrivate;
+
+class AfStorageProxy : public QObject
+{
+    Q_OBJECT
+
+public:
+    AfStorageProxy(QObject *parent = 0);
+    virtual ~AfStorageProxy();
+
+public:    
+    bool addActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+    bool updateActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+    bool saveActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+    bool removeActivity(int applicationId, const QString &activityId);   
+    bool removeApplicationActivities(int applicationId);
+    bool activities(QList<QVariantHash> &list);
+    bool applicationActivities(QStringList &list, int applicationId);
+    bool activityData(QVariant &data, int applicationId, const QString &activityId);
+    bool activityMetaData(QVariantHash &metadata, int applicationId, const QString &activityId);
+    bool waitActivity();    
+    bool launchActivity(int applicationId, const QString &activityUri);
+    bool getThumbnail(const QSize &size, const QString &imagePath, void *userData);
+    bool notifyDataChange();
+
+signals:
+    void activityRequested(const QString &activityUri);
+    void thumbnailRequested(const QPixmap &thumbnailPixmap, void *userData);
+    void dataChanged();
+    
+private:
+    AfStorageProxyPrivate *d_ptr;
+    
+    friend class AfStorageProxyPrivate;
+    
+};
+
+#endif //AFSTORAGEPROXY_H
--- a/activityfw/activityserviceplugin/inc/applicationlauncher.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef APPLICATIONLAUNCHER_H
-#define APPLICATIONLAUNCHER_H
-
-class ApplicationLauncherPrivate;
-
-#include <QString>
-#include <QUrl>
-
-class ApplicationLauncher
-{
-
-public:
-    ApplicationLauncher();
-    ~ApplicationLauncher();
-
-public:
-    bool isRunning(int applicationId);
-    void startApplication(int applicationId, const QUrl &uri);
-    void bringToForeground(int applicationId);
-
-private:
-    ApplicationLauncherPrivate *d_ptr;
-
-};
-
-#endif // APPLICATIONLAUNCHER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/s60/inc/afserializer.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef HSSERIALIZER_H
+#define HSSERIALIZER_H
+
+#include <qvariant.h>
+
+/**
+ * Operator serialize VarinatHash to RBuf8
+ */
+RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src);
+
+/**
+ * Operator deserialize RBuf8 to VarinatHash
+ */
+QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/s60/inc/afstorageproxy_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,67 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef AFSTORAGEPROXY_P_H
+#define AFSTORAGEPROXY_P_H
+
+#include "afasyncrequestobserver.h"
+
+#include <QVariant>
+#include <QStringList>
+
+class CAfStorageClient;
+class CAfEntry;
+class AfStorageProxy;
+
+class AfStorageProxyPrivate : public MAfAsyncRequestObserver
+{
+public:
+    AfStorageProxyPrivate(AfStorageProxy *q);
+    ~AfStorageProxyPrivate();
+
+public:    
+    bool addActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+    bool updateActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+    bool saveActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot);
+    bool removeActivity(int applicationId, const QString &activityId);   
+    bool removeApplicationActivities(int applicationId);
+    bool activities(QList<QVariantHash> &list);
+    bool applicationActivities(QStringList &list, int applicationId);
+    bool activityData(QVariant &data, int applicationId, const QString &activityId);
+    bool activityMetaData(QVariantHash &metadata, int applicationId, const QString &activityId);
+    bool waitActivity();    
+    bool launchActivity(int applicationId, const QString &activityUri);
+    bool getThumbnail(const QSize &size, const QString &imagePath, void *userData);
+    bool notifyDataChange();
+
+public: // from MAfAsyncRequestObserver
+    virtual void waitActivityRequestCompleted(int result, const TDesC8 &data);
+    virtual void getThumbnailRequestCompleted(int result, int bitmapHandle, void *userData);
+    virtual void dataChangeNotificationCompleted(int result);    
+    
+private:
+    CAfEntry *createFilterEntry(int applicationId = 0, const QString &activityId = QString());
+    CAfEntry *createSaveEntry(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata);
+    CAfEntry *getEntry(int applicationId, const QString &activityId);
+    QVariantHash extractMetadata(CAfEntry *entry);
+    
+private:
+    CAfStorageClient *mClient;
+    AfStorageProxy *q_ptr;
+};
+
+#endif //AFSTORAGEPROXY_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/s60/src/afserializer.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <s32mem.h>
+#include "afserializer.h"
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src)
+{
+    QByteArray buffer;
+    QDataStream stream(&buffer, QIODevice::WriteOnly);
+
+    QT_TRYCATCH_LEAVING(stream << src);
+    const int dataLength(buffer.length());
+    const unsigned char *dataPtr(reinterpret_cast<const unsigned char *>(buffer.constData()));
+    if (dst.MaxLength() < dataLength) {
+        dst.ReAllocL(dataLength);
+    }
+    dst.Copy(dataPtr, dataLength);
+    return dst;
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+//
+QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src)
+{
+    QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char *>(src.Ptr()),
+                                               src.Length()) );
+
+    QDataStream stream(&buffer, QIODevice::ReadOnly);
+    QT_TRYCATCH_LEAVING(stream >> dst);
+    return dst;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/s60/src/afstorageproxy_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,296 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "afstorageproxy_p.h"
+
+#include <fbs.h>
+
+#include <QSize>
+#include <QPixmap>
+
+#include <XQConversions>
+
+#include <afstorageglobals.h>
+#include <afstorageclient.h>
+#include <afentry.h>
+
+#include "afstorageproxy.h"
+#include "afserializer.h"
+
+AfStorageProxyPrivate::AfStorageProxyPrivate(AfStorageProxy *q) : mClient(0), q_ptr(q)
+{    
+    QT_TRAP_THROWING(mClient = CAfStorageClient::NewL(*this));
+}
+
+AfStorageProxyPrivate::~AfStorageProxyPrivate()
+{
+    delete mClient;
+}
+
+bool AfStorageProxyPrivate::addActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{    
+    int screenshotHandle(-1);
+    CFbsBitmap* bitmap(screenshot.toSymbianCFbsBitmap());
+    if (bitmap) {
+        screenshotHandle = bitmap->Handle();
+    }
+    
+    CAfEntry *entry = createSaveEntry(applicationId, activityId, activityData, metadata);
+    int result = mClient->addActivity(*entry, screenshotHandle);    
+    delete entry;
+    delete bitmap;
+    
+    return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::updateActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{
+    int screenshotHandle(-1);
+    CFbsBitmap* bitmap(screenshot.toSymbianCFbsBitmap());
+    if (bitmap) {
+        screenshotHandle = bitmap->Handle();
+    }
+    
+    CAfEntry *entry = createSaveEntry(applicationId, activityId, activityData, metadata);
+    int result = mClient->updateActivity(*entry, screenshotHandle);    
+    delete entry;
+    delete bitmap;
+    
+    return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::saveActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{
+    int screenshotHandle(-1);
+    CFbsBitmap* bitmap(screenshot.toSymbianCFbsBitmap());
+    if (bitmap) {
+        screenshotHandle = bitmap->Handle();
+    }
+    
+    CAfEntry *entry = createSaveEntry(applicationId, activityId, activityData, metadata);
+    int result = mClient->saveActivity(*entry, screenshotHandle);    
+    delete entry;
+    delete bitmap;
+    
+    return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::removeActivity(int applicationId, const QString &activityId)
+{
+    CAfEntry *entry = createFilterEntry(applicationId, activityId);
+    int result = mClient->removeActivity(*entry);
+    delete entry;
+    return KErrNone == result;
+}
+   
+bool AfStorageProxyPrivate::removeApplicationActivities(int applicationId)
+{
+    CAfEntry *entry = createFilterEntry(applicationId);
+    int result = mClient->removeApplicationActivities(*entry);
+    delete entry;
+    return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::activities(QList<QVariantHash> &list)
+{
+    RPointerArray<CAfEntry> results;
+    
+    int result = mClient->activities(results);
+    list.clear();
+    for (int i=0; i < results.Count(); ++i) {
+        list.append(extractMetadata(results[i]));
+    }
+   
+    results.ResetAndDestroy();
+    return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::applicationActivities(QStringList &list, int applicationId)
+{
+    RPointerArray<CAfEntry> results;
+    
+    CAfEntry *entry = createFilterEntry(applicationId);
+    int result = mClient->applicationActivities(results, *entry);
+    delete entry;
+    
+    list.clear();
+    for (int i=0; i < results.Count(); ++i) {
+        list.append(XQConversions::s60DescToQString(results[i]->ActivityId()));
+    }
+   
+    results.ResetAndDestroy();
+    return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::activityData(QVariant &data, int applicationId, const QString &activityId)
+{
+    CAfEntry *entry = getEntry(applicationId, activityId);
+    
+    if (!entry) {
+        return false;
+    }
+    
+    QVariantHash deserializedData;
+    deserializedData << entry->Data(CAfEntry::Private);
+    data = deserializedData[ActivityDataKeyword];
+    delete entry;
+    return true;
+}
+
+bool AfStorageProxyPrivate::activityMetaData(QVariantHash &metadata, int applicationId, const QString &activityId)
+{
+    CAfEntry *entry = getEntry(applicationId, activityId);
+    
+    if (entry) {
+        metadata = extractMetadata(entry);
+        delete entry;
+        return true;
+    }    
+    
+    return false;
+}
+
+bool AfStorageProxyPrivate::waitActivity()
+{
+    return KErrNone == mClient->waitActivity();
+}
+    
+bool AfStorageProxyPrivate::launchActivity(int applicationId, const QString &activityUri)
+{
+    CAfEntry *entry = createFilterEntry(applicationId, activityUri);
+    int result = mClient->launchActivity(*entry);
+    delete entry;
+    return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::getThumbnail(const QSize &size, const QString &imagePath, void *userData)
+{
+    HBufC *source = XQConversions::qStringToS60Desc(imagePath);
+    int result = mClient->getThumbnail(TSize(size.width(), size.height()), *source, userData);
+    delete source;
+    return KErrNone == result;
+}
+
+bool AfStorageProxyPrivate::notifyDataChange()
+{
+    return KErrNone == mClient->notifyDataChange();
+}
+
+
+void AfStorageProxyPrivate::waitActivityRequestCompleted(int result, const TDesC8 &data)
+{
+    if (KErrCancel != result) {
+        waitActivity();
+    }
+    if (KErrNone == result) {
+        emit q_ptr->activityRequested(XQConversions::s60Desc8ToQString(data));
+    }
+}
+
+void AfStorageProxyPrivate::getThumbnailRequestCompleted(int result, int bitmapHandle, void *userData)
+{
+    if (KErrNone == result) {
+        CFbsBitmap* bitmap = new CFbsBitmap();
+        if (KErrNone == bitmap->Duplicate(bitmapHandle)) {
+            emit q_ptr->thumbnailRequested(QPixmap::fromSymbianCFbsBitmap(bitmap), userData);
+        }
+        delete bitmap;
+    }
+}
+
+void AfStorageProxyPrivate::dataChangeNotificationCompleted(int result)
+{
+    if (KErrCancel != result) {
+        notifyDataChange();
+    }
+    if (KErrNone == result) {
+        emit q_ptr->dataChanged();
+    }
+}
+ 
+CAfEntry *AfStorageProxyPrivate::createFilterEntry(int applicationId, const QString &activityId)
+{   
+    CAfEntry *entry(0); 
+    QT_TRAP_THROWING(entry = CAfEntry::NewL(0, applicationId, TPtrC(static_cast<const TUint16*>(activityId.utf16())), KNullDesC(), KNullDesC8(), KNullDesC8()));
+    return entry;
+}
+
+CAfEntry *AfStorageProxyPrivate::createSaveEntry(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata)
+{   
+    CAfEntry *entry(0); 
+    
+    QT_TRAP_THROWING(
+        int flags(0);
+        QVariantHash privData;
+        privData.insert(ActivityDataKeyword, activityData);
+        RBuf8 privateBuff;
+        RBuf8 publicBuff;
+        CleanupClosePushL(privateBuff);
+        CleanupClosePushL(publicBuff);
+        privateBuff << privData;
+        publicBuff << metadata;
+        
+        if (metadata.contains(ActivityPersistence) && metadata[ActivityPersistence].toBool()) {
+            flags |= CAfEntry::Persistent;
+        }
+        
+        if (metadata.contains(ActivityVisibility) && !metadata[ActivityVisibility].toBool()) {
+            flags |= CAfEntry::Invisible;
+        }
+        
+        HBufC *actBuff = XQConversions::qStringToS60Desc(activityId);
+        CleanupStack::PushL(actBuff);
+        entry = CAfEntry::NewL(flags, 
+                               applicationId, 
+                               *actBuff, 
+                               KNullDesC, 
+                               privateBuff, 
+                               publicBuff);
+        CleanupStack::PopAndDestroy(actBuff);
+        CleanupStack::PopAndDestroy(&publicBuff);
+        CleanupStack::PopAndDestroy(&privateBuff);
+    );
+    return entry;
+}
+
+CAfEntry *AfStorageProxyPrivate::getEntry(int applicationId, const QString &activityId)
+{
+    CAfEntry *entry = createFilterEntry(applicationId, activityId);
+    CAfEntry *resultEntry(0);
+    int result = mClient->activityData(resultEntry, *entry);
+    delete entry;
+    
+    if (KErrNone != result) {
+        delete resultEntry;
+        resultEntry = 0;
+    }
+    
+    return resultEntry;
+}
+
+QVariantHash AfStorageProxyPrivate::extractMetadata(CAfEntry *entry)
+{
+    QVariantHash metadata;
+    metadata << entry->Data(CAfEntry::Public);
+    metadata.insert(ActivityApplicationKeyword, entry->ApplicationId());
+    metadata.insert(ActivityActivityKeyword, XQConversions::s60DescToQString(entry->ActivityId()));
+    metadata.insert(ActivityScreenshotKeyword, XQConversions::s60DescToQString(entry->ImageSrc()));
+    metadata.insert(ActivityPersistence, (entry->Flags() & CAfEntry::Persistent) ? true : false);
+    metadata.insert(ActivityVisibility, (entry->Flags() & CAfEntry::Invisible) ? false : true); 
+    return metadata;
+}
+
--- a/activityfw/activityserviceplugin/s60/src/applicationlauncher_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/activityserviceplugin/s60/src/applicationlauncher_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -34,7 +34,7 @@
 {
     QString commandLine = QString("-activity %1").arg(QString(uri.toEncoded()));
 
-    QT_TRAP_THROWING( {
+    TRAP_IGNORE(
         HBufC *commandLineAsDescriptor = XQConversions::qStringToS60Desc(commandLine);
         CleanupStack::PushL(commandLineAsDescriptor);
 
@@ -43,20 +43,15 @@
         CleanupClosePushL(apaLsSession);
 
         TApaAppInfo appInfo;
-        TInt retVal = apaLsSession.GetAppInfo(appInfo, TUid::Uid(applicationId));
+        User::LeaveIfError(apaLsSession.GetAppInfo(appInfo, TUid::Uid(applicationId)));
 
-        if (retVal == KErrNone) {
-            RProcess application;
-            User::LeaveIfError(application.Create(appInfo.iFullName, *commandLineAsDescriptor));
-            application.Resume();
-        } else {
-            // @todo ?
-        }
+        RProcess application;
+        User::LeaveIfError(application.Create(appInfo.iFullName, *commandLineAsDescriptor));
+        application.Resume();
 
         CleanupStack::PopAndDestroy(&apaLsSession);
         CleanupStack::PopAndDestroy(commandLineAsDescriptor);
-    }
-                    );
+    );
 }
 
 void ApplicationLauncherPrivate::bringToForeground(int applicationId)
--- a/activityfw/activityserviceplugin/src/activityserviceplugin.cpp	Tue Jul 06 14:37:10 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:
-*
-*/
-
-#include "activityserviceplugin.h"
-
-#include <qserviceinterfacedescriptor.h>
-#include <qabstractsecuritysession.h>
-#include <qservicecontext.h>
-
-#include "afactivityclient.h"
-#include "afactivitymanager.h"
-
-QObject *ActivityServicePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session)
-{
-    Q_UNUSED(context);
-    Q_UNUSED(session);
-
-    if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityClient") {
-        return new ActivityClient(QSharedPointer<AfStorageClient>(new AfStorageClient()));
-    } else if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityManager") {
-        return new ActivityManager(QSharedPointer<AfStorageClient>(new AfStorageClient()));
-    } else {
-        return NULL;
-    }
-}
-
-Q_EXPORT_PLUGIN2(activityserviceplugin, ActivityServicePlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afactivation.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "afactivation.h"
+#include "afactivation_p.h"
+
+#include "afstorageproxy.h"
+
+AfActivation::AfActivation(QObject *parent) : QObject(parent), d_ptr(0)
+{
+    QSharedPointer<AfStorageProxy> connection(new AfStorageProxy());    
+    QT_TRAP_THROWING(
+        User::LeaveIfError(connection->waitActivity());
+    )
+    
+    d_ptr = new AfActivationPrivate(connection, this);
+    connect(d_ptr, SIGNAL(activated(Af::ActivationReason,QString,QVariantHash)), this, SIGNAL(activated(Af::ActivationReason,QString,QVariantHash)));
+}
+    
+QVariantHash AfActivation::parameters() const
+{
+    return d_ptr->parameters();
+}
+
+Af::ActivationReason AfActivation::reason() const
+{
+    return d_ptr->reason();
+}
+
+QString AfActivation::name() const
+{
+    return d_ptr->name();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afactivation_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "afactivation_p.h"
+
+#include <QCoreApplication>
+
+#include "afstorageproxy.h"
+
+#include "aflauncher.h"
+#include "afcommandlineparser.h"
+    
+AfActivationPrivate::AfActivationPrivate(const QSharedPointer<AfStorageProxy> &connection, QObject *parent) : QObject(parent), mReason(Af::ActivationReasonNormal), mConnection(connection)
+{
+    AfCommandLineParser::parseCommandLine(qApp->arguments(),
+            mReason,
+            mName,
+            mParameters);
+    connect(mConnection.data(), SIGNAL(activityRequested(QString)), this, SLOT(handleActivityRequest(QString)));
+    connect(mConnection.data(), SIGNAL(activityRequested(QString)), this, SLOT(bringToForeground()));
+}
+   
+QVariantHash AfActivationPrivate::parameters() const
+{
+    return mParameters;
+}
+
+Af::ActivationReason AfActivationPrivate::reason() const
+{
+    return mReason;
+}
+
+QString AfActivationPrivate::name() const
+{
+    return mName;
+}
+
+void AfActivationPrivate::handleActivityRequest(const QString &activityUri)
+{
+    mReason = Af::ActivationReasonActivity;
+    mName = QString();
+    mParameters = QVariantHash();
+    
+    QUrl uri(activityUri);
+    QVariantHash parameters;
+    QList<QPair<QString, QString> > uriParams = uri.queryItems();
+    for (QList<QPair<QString, QString> >::const_iterator i = uriParams.constBegin(); i != uriParams.constEnd(); ++i) {
+        parameters.insert(i->first, i->second);
+    }
+    if (parameters.contains(Af::KActivityUriNameKey)) {
+        mName = parameters.value(Af::KActivityUriNameKey).toString();
+        parameters.remove(Af::KActivityUriNameKey);
+    }
+    mParameters = parameters;
+    
+    emit activated(mReason, mName, mParameters);
+}
+
+void AfActivationPrivate::bringToForeground()
+{
+    if (!mParameters.contains(Af::KActivityUriBackgroundKey)) {
+        // process all update events from widgets to prevent flickering
+        QCoreApplication::processEvents();
+        AfLauncher().bringToForeground(RProcess().SecureId().iId);
+    }
+}
--- a/activityfw/activityserviceplugin/src/afactivityclient.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <QCoreApplication>
-#include <QStringList>
-#include <QTimer>
-#include <QUrl>
-#include <QDebug>
-#include <QDir>
-
-#include <afstorageentry.h>
-#include <afstorageglobals.h>
-
-#include "afactivityclient.h"
-ActivityClient::ActivityClient(const QSharedPointer<AfStorageClient> &serviceProvider, QObject *parent) 
-: 
-    QObject(parent),
-    mServiceProvider(serviceProvider),
-    mIsconnected(false)
-{
-    mIsconnected = ( KErrNone == mServiceProvider->connect());
-    if( mIsconnected) {
-        mServiceProvider->waitActivity();
-    }
-    connect(mServiceProvider.data(), SIGNAL(activityRequested(QString)), this, SIGNAL(activityRequested(QString)));
-}
-
-ActivityClient::~ActivityClient()
-{
-}
-
-bool ActivityClient::addActivity(const QString &activityId, const QVariant &data, const QVariantHash &parameters)
-{
-    bool result(mIsconnected);
-    if (result) {
-        QVariantHash publicData(parameters);
-        
-        QPixmap screenshot(publicData[ActivityScreenshotKeyword].value<QPixmap>());
-        publicData.remove(ActivityScreenshotKeyword);
-        
-        RProcess process;
-        publicData.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
-        publicData.insert(ActivityActivityKeyword, activityId);
-        AfStorageEntry entry(process.SecureId().iId, activityId, data, publicData);
-        result = (KErrNone == mServiceProvider->addActivity(entry, screenshot));
-    }
-    return result;
-}
-
-bool ActivityClient::removeActivity(const QString &activityId)
-{
-    bool result(mIsconnected);
-    if (result) {
-        RProcess process;
-        AfStorageEntry entry(process.SecureId().iId, activityId);
-        result = (KErrNone == mServiceProvider->removeActivity(entry));
-    }
-    return result;
-}
-
-bool ActivityClient::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash &parameters)
-{
-    bool result(mIsconnected);
-    if (result) {
-        QVariantHash publicData(parameters);
-        QPixmap screenshot(publicData[ActivityScreenshotKeyword].value<QPixmap>());
-        publicData.remove(ActivityScreenshotKeyword);
-        RProcess process;
-        publicData.insert(ActivityApplicationKeyword, static_cast<int>(process.SecureId().iId));
-        publicData.insert(ActivityActivityKeyword, activityId);
-        AfStorageEntry entry(process.SecureId().iId, activityId, data, publicData);
-        result = (KErrNone == mServiceProvider->updateActivity(entry, screenshot));
-    }
-    return result;
-}
-
-QList<QVariantHash> ActivityClient::activities() const
-{
-    QList<QVariantHash> retVal;
-    if (mIsconnected) {
-        RProcess process;
-        AfStorageEntry entry(process.SecureId().iId);
-        QList<AfStorageEntry> activities;
-        mServiceProvider->applicationActivities(activities, entry);
-        
-        QList<AfStorageEntry>::iterator iter(activities.begin());
-        for (; activities.end() != iter; iter = activities.erase(iter)) {
-            retVal.append((*iter).publicData());
-        }
-    }
-    return retVal;
-}
-
-QVariant ActivityClient::activityData(const QString &activityId) const
-{
-    QVariant data;
-    if (mIsconnected) {
-        RProcess process;
-        AfStorageEntry entry(static_cast<int>(process.SecureId().iId), activityId), result;
-        if (0 == mServiceProvider->activityData(result, entry)) {
-            data = result.privateData();
-        }
-    }
-    return data;
-}
-
-QVariantHash ActivityClient::parseCommandLine(const QStringList &commandLineParams) const
-{
-     QVariantHash activityParams;
-    int activityMarkerIndex = commandLineParams.indexOf("-activity");
-    if (activityMarkerIndex != -1 && commandLineParams.count() - 1 > activityMarkerIndex) {
-        QUrl activityUri = QUrl::fromEncoded(commandLineParams.at(activityMarkerIndex+1).toAscii());
-        if (activityUri.scheme() == "appto") {
-            QList<QPair<QString, QString> > parameters = activityUri.queryItems();
-            for (QList<QPair<QString, QString> >::const_iterator i = parameters.constBegin(); i != parameters.constEnd(); ++i) {
-                activityParams.insert(i->first, i->second);
-            }
-
-            if (activityParams.contains("activityname") && !activityParams.value("activityname").toString().isEmpty()) {
-                return activityParams;
-            }
-        }
-    }
-    return QVariantHash();
-}
--- a/activityfw/activityserviceplugin/src/afactivitymanager.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <QStringList>
-#include <QUrl>
-
-#include <afstorageclient.h>
-#include <afstorageentry.h>
-#include <afstorageglobals.h>
-
-#include "afactivitymanager.h"
-#include "applicationlauncher.h"
-
-ActivityManager::ActivityManager(const QSharedPointer<AfStorageClient> &serviceProvider, 
-                                 QObject *parent) 
-: 
-    QObject(parent), 
-    mServiceProvider(serviceProvider)
-{
-    if(0 == mServiceProvider->connect()){
-        mServiceProvider->notifyDataChange();
-    }
-    connect(mServiceProvider.data(),
-            SIGNAL(thumbnailRequested(QPixmap, void *)),
-            this,
-            SIGNAL(thumbnailReady(QPixmap, void *)));
-    connect(mServiceProvider.data(),
-            SIGNAL(dataChanged()),
-            this,
-            SIGNAL(dataChanged()));
-}
-
-ActivityManager::~ActivityManager()
-{
-}
-
-QList<QVariantHash> ActivityManager::activitiesList()
-{
-    QList<AfStorageEntry> results;
-    mServiceProvider->activities(results);
-    
-    QList<QVariantHash> retVal;
-    QList<AfStorageEntry>::iterator iter(results.begin());
-    for (; iter != results.end(); iter = results.erase(iter)) {
-        retVal.append((*iter).publicData());
-    }
-    return retVal;
-}
-
-void ActivityManager::launchActivity(const QUrl &uri)
-{
-    if (uri.scheme() != "appto")
-        return;
-
-    bool conversionOk(false);
-    int applicationId = uri.host().toUInt(&conversionOk, 16);   
-    if (!conversionOk)
-        return;
-        
-    QVariantHash activity;
-    activity.insert(ActivityApplicationKeyword, applicationId);
-    
-    QVariantHash parameters;
-    QList<QPair<QString, QString> > uriParams = uri.queryItems();
-    for (QList<QPair<QString, QString> >::const_iterator i = uriParams.constBegin(); i != uriParams.constEnd(); ++i) {
-        parameters.insert(i->first, i->second);
-    }
-
-    if (parameters.contains("activityname")) {
-        activity.insert(ActivityActivityKeyword, parameters.value("activityname").toString());
-        parameters.remove("activityname");
-    }
-    
-    activity.insert(ActivityParametersKeyword, parameters);
-    
-    launchActivity(activity);
-}
-
-void ActivityManager::launchActivity(const QString &uri)
-{
-    qWarning("AfActivityManager::launchActivity(const QString &uri) is deprecated, use AfActivityManager::launchActivity(const QUrl &uri) instead");
-    launchActivity(QUrl(uri));
-}
-
-void ActivityManager::launchActivity(int applicationId, const QString &activityId, const QVariantHash& parameters)
-{
-    QVariantHash activity;
-    activity.insert(ActivityApplicationKeyword, applicationId);
-    activity.insert(ActivityActivityKeyword, activityId);
-    activity.insert(ActivityParametersKeyword, parameters);
-    
-    launchActivity(activity);
-}
-
-void ActivityManager::getThumbnail(QSize resolution,const QString &thumbnailPath, void *data)
-{
-    mServiceProvider->getThumbnail(resolution, thumbnailPath, data);
-}
-
-void ActivityManager::launchActivity(const QVariantHash& activity)
-{
-    ApplicationLauncher applicationLauncher;
-    int applicationId = activity.value(ActivityApplicationKeyword).toInt();
-    AfStorageEntry entry(applicationId, 
-                         activity[ActivityActivityKeyword].toString());
-    if (applicationLauncher.isRunning(applicationId)) {
-        mServiceProvider->launchActivity(entry);
-        applicationLauncher.bringToForeground(applicationId);
-    } else {
-        applicationLauncher.startApplication(applicationId, activityToUri(activity));
-    }
-}
-
-QUrl ActivityManager::activityToUri(const QVariantHash& activity) const
-{
-    QUrl uri;
-    uri.setScheme("appto");
-    uri.setHost(QString("%1").arg(activity.value(ActivityApplicationKeyword).toUInt(), 8, 16, QChar('0')));
-    
-    if (activity.contains(ActivityActivityKeyword))
-        uri.addQueryItem("activityname", activity.value(ActivityActivityKeyword).toString());
-    
-    QVariantHash parameters = activity.value(ActivityParametersKeyword).toHash();
-    foreach(const QString &key, parameters.keys()) {
-        uri.addQueryItem(key, parameters.value(key).toString());
-    } 
-    return uri;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afactivitystorage.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "afactivitystorage.h"
+#include "afactivitystorage_p.h"
+
+AfActivityStorage::AfActivityStorage(QObject *parent) : QObject(parent), d_ptr(0)
+{
+    QSharedPointer<AfStorageProxy> connection(new AfStorageProxy());
+    d_ptr.reset(new AfActivityStoragePrivate(connection));
+}
+    
+AfActivityStorage::~AfActivityStorage()
+{
+}
+    
+bool AfActivityStorage::saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata)
+{
+    return d_ptr->saveActivity(activityId, activityData, metadata);
+}
+
+bool AfActivityStorage::removeActivity(const QString &activityId)
+{
+    return d_ptr->removeActivity(activityId);
+}
+
+QStringList AfActivityStorage::allActivities() const
+{
+    return d_ptr->allActivities();
+}
+
+QVariant AfActivityStorage::activityData(const QString &activityId) const
+{
+    return d_ptr->activityData(activityId);
+}
+
+QVariantHash AfActivityStorage::activityMetaData(const QString &activityId) const
+{
+    return d_ptr->activityMetaData(activityId);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afactivitystorage_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "afactivitystorage_p.h"
+
+#include <QPixmap>
+
+#include <afstorageglobals.h>
+
+AfActivityStoragePrivate::AfActivityStoragePrivate(const QSharedPointer<AfStorageProxy> &connection) : mConnection(connection)
+{
+}
+
+bool AfActivityStoragePrivate::saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata)
+{
+    QVariantHash publicData(metadata);
+        
+    QPixmap screenshot(publicData[ActivityScreenshotKeyword].value<QPixmap>());
+    publicData.remove(ActivityScreenshotKeyword);
+    
+    publicData.insert(ActivityApplicationKeyword, applicationId());
+    publicData.insert(ActivityActivityKeyword, activityId);
+
+    return mConnection->saveActivity(applicationId(), activityId, activityData, publicData, screenshot);
+}
+
+bool AfActivityStoragePrivate::removeActivity(const QString &activityId)
+{
+    return mConnection->removeActivity(applicationId(), activityId);
+}
+
+QStringList AfActivityStoragePrivate::allActivities() const
+{    
+    QStringList activities;
+    mConnection->applicationActivities(activities, applicationId());        
+    return activities;
+}
+
+QVariant AfActivityStoragePrivate::activityData(const QString &activityId) const
+{
+    QVariant data;
+    mConnection->activityData(data, applicationId(), activityId);
+    return data;
+}
+
+QVariantHash AfActivityStoragePrivate::activityMetaData(const QString &activityId) const
+{
+    QVariantHash metadata;
+    mConnection->activityMetaData(metadata, applicationId(), activityId);
+    return metadata;
+}
+
+int AfActivityStoragePrivate::applicationId()
+{
+    return RProcess().SecureId().iId;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afclient.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -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:
+*
+*/
+#include "afclient.h"
+
+#include "aflauncher.h"
+#include "afcommandlineparser.h"
+
+AfClient::AfClient(const QSharedPointer<AfActivityStorage> &storage, const QSharedPointer<AfActivation> &activation, QObject *parent)
+: 
+    QObject(parent),
+    mStorage(storage),
+    mActivation(activation)
+{
+    connect(mActivation.data(), SIGNAL(activated(Af::ActivationReason,QString,QVariantHash)), this, SLOT(handleActivityRequest(Af::ActivationReason,QString,QVariantHash)));
+}
+
+AfClient::~AfClient()
+{
+}
+
+bool AfClient::addActivity(const QString &activityId, const QVariant &data, const QVariantHash &parameters)
+{
+    return mStorage->saveActivity(activityId, data, parameters);
+}
+
+bool AfClient::removeActivity(const QString &activityId)
+{
+    return mStorage->removeActivity(activityId);
+}
+
+bool AfClient::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash &parameters)
+{
+    return mStorage->saveActivity(activityId, data, parameters);
+}
+
+QList<QVariantHash> AfClient::activities() const
+{
+    QList<QVariantHash> result;
+    
+    QStringList activitiesList = mStorage->allActivities();
+    foreach (const QString &activityId, activitiesList) {
+        result.append(mStorage->activityMetaData(activityId));
+    }
+    return result;
+}
+
+QVariant AfClient::activityData(const QString &activityId) const
+{
+    return mStorage->activityData(activityId);
+}
+
+QVariantHash AfClient::parseCommandLine(const QStringList &commandLineParams) const
+{
+    return AfCommandLineParser::getActivityParameters(commandLineParams);
+}
+
+void AfClient::handleActivityRequest(Af::ActivationReason reason, const QString &name, const QVariantHash &parameters)
+{
+    Q_UNUSED(parameters);
+    if (Af::ActivationReasonActivity == reason) {
+        emit activityRequested(name);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afcommandlineparser.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -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:
+*
+*/
+
+#include "afcommandlineparser.h"
+
+#include <QUrl>
+
+// Startup arguments for services
+static const char * StartupArgEmbedded = "embedded=yes";
+static const char * StartupArgService = "service=yes";
+static const char * StartupArgInterfaceId = "intf=";
+static const char * StartupArgOperationId = "oper=";
+static const char * StartupArgEmbeddedName = "embedded";
+static const char * StartupArgInterfaceName = "intf";
+static const char * StartupArgOperationName = "oper";
+
+// for activities
+const char KCmdLineMarker[] = "-activity";
+
+void AfCommandLineParser::parseCommandLine(const QStringList &commandLineParams,
+            Af::ActivationReason &reason,
+            QString &name,
+            QVariantHash &parameters)
+{
+    if (AfCommandLineParser::isServiceCommand(commandLineParams)) {
+        parseServiceParameters(commandLineParams,
+                reason,
+                name,
+                parameters);
+    }
+    else if (AfCommandLineParser::isActivityCommand(commandLineParams)) {
+        parseActivityParameters(commandLineParams,
+                reason,
+                name,
+                parameters);
+    }  
+}
+
+bool AfCommandLineParser::isServiceCommand(const QStringList &commandLineParams)
+{
+    return commandLineParams.contains(StartupArgService);
+}
+
+bool AfCommandLineParser::isActivityCommand(const QStringList &commandLineParams)
+{
+    return commandLineParams.contains(KCmdLineMarker);
+}
+
+void AfCommandLineParser::parseServiceParameters(const QStringList &commandLineParams,
+        Af::ActivationReason &reason,
+        QString &name,
+        QVariantHash &parameters)
+{
+    reason = Af::ActivationReasonService;
+    parameters = QVariantHash();
+    int num = commandLineParams.count();
+    for ( int i = 0; i < num; i++ ) {
+        QString s = commandLineParams[i] ;
+        if (s.startsWith(StartupArgInterfaceId)) {
+            name = s.remove(StartupArgInterfaceId);
+            parameters.insert(StartupArgInterfaceName,name);
+        } 
+        else if (s.startsWith(StartupArgOperationId)) {
+            parameters.insert(StartupArgOperationName,s.remove(StartupArgOperationId));
+        }
+        else if (s.startsWith(StartupArgEmbedded)) {
+            parameters.insert(StartupArgEmbeddedName,true);
+        }
+    }  
+}
+
+void AfCommandLineParser::parseActivityParameters(const QStringList &commandLineParams,
+        Af::ActivationReason &reason,
+        QString &name,
+        QVariantHash &parameters)
+{
+    QVariantHash startupActivity = AfCommandLineParser::getActivityParameters(commandLineParams);
+    if (!startupActivity.isEmpty() && 
+            !startupActivity.value(Af::KActivityUriNameKey).toString().isEmpty()) {
+        reason = Af::ActivationReasonActivity;
+        parameters = startupActivity;
+        name = startupActivity.value(Af::KActivityUriNameKey).toString();
+    }
+}
+
+QVariantHash AfCommandLineParser::getActivityParameters(const QStringList &commandLineParams)
+{
+    QVariantHash activityParams;
+    int activityMarkerIndex = commandLineParams.indexOf(KCmdLineMarker);
+    if (activityMarkerIndex != -1 && commandLineParams.count() - 1 > activityMarkerIndex) {
+        QUrl activityUri = QUrl::fromEncoded(commandLineParams.at(activityMarkerIndex+1).toAscii());
+        if (activityUri.scheme() == Af::KActivityScheme) {
+            QList<QPair<QString, QString> > parameters = activityUri.queryItems();
+            for (QList<QPair<QString, QString> >::const_iterator i = parameters.constBegin(); i != parameters.constEnd(); ++i) {
+                activityParams.insert(i->first, i->second);
+            }
+
+            if (activityParams.contains(Af::KActivityUriNameKey) && !activityParams.value(Af::KActivityUriNameKey).toString().isEmpty()) {
+                return activityParams;
+            }
+        }
+    }
+    return QVariantHash();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/aflauncher.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "aflauncher.h"
+#include "applicationlauncher_p.h"
+
+AfLauncher::AfLauncher() : d_ptr(new ApplicationLauncherPrivate())
+{
+}
+
+AfLauncher::~AfLauncher()
+{
+    delete d_ptr;
+}
+
+bool AfLauncher::isRunning(int applicationId)
+{
+    return d_ptr->isRunning(applicationId);
+}
+
+void AfLauncher::startApplication(int applicationId, const QUrl &uri)
+{
+    d_ptr->startApplication(applicationId, uri);
+}
+
+void AfLauncher::bringToForeground(int applicationId)
+{
+    d_ptr->bringToForeground(applicationId);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afmanager.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,130 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QStringList>
+#include <QUrl>
+
+#include <afstorageglobals.h>
+
+#include "afactivities_global.h"
+#include "afmanager.h"
+#include "aflauncher.h"
+
+AfManager::AfManager(const QSharedPointer<AfStorageProxy> &serviceProvider, 
+                     QObject *parent) 
+: 
+    QObject(parent), 
+    mServiceProvider(serviceProvider)
+{
+    mServiceProvider->notifyDataChange();
+    connect(mServiceProvider.data(),
+            SIGNAL(thumbnailRequested(QPixmap,void*)),
+            this,
+            SIGNAL(thumbnailReady(QPixmap,void*)));
+    connect(mServiceProvider.data(),
+            SIGNAL(dataChanged()),
+            this,
+            SIGNAL(dataChanged()));
+}
+
+AfManager::~AfManager()
+{
+}
+
+QList<QVariantHash> AfManager::activitiesList()
+{
+    QList<QVariantHash> results;
+    mServiceProvider->activities(results);
+    return results;
+}
+
+void AfManager::launchActivity(const QUrl &uri)
+{
+    if (uri.scheme() != Af::KActivityScheme)
+        return;
+
+    bool conversionOk(false);
+    int applicationId = uri.host().toUInt(&conversionOk, 16);   
+    if (!conversionOk)
+        return;
+        
+    QVariantHash activity;
+    activity.insert(ActivityApplicationKeyword, applicationId);
+    
+    QVariantHash parameters;
+    QList<QPair<QString, QString> > uriParams = uri.queryItems();
+    for (QList<QPair<QString, QString> >::const_iterator i = uriParams.constBegin(); i != uriParams.constEnd(); ++i) {
+        parameters.insert(i->first, i->second);
+    }
+
+    if (parameters.contains(Af::KActivityUriNameKey)) {
+        activity.insert(ActivityActivityKeyword, parameters.value(Af::KActivityUriNameKey).toString());
+        parameters.remove(Af::KActivityUriNameKey);
+    }
+    
+    activity.insert(ActivityParametersKeyword, parameters);
+    
+    launchActivity(activity);
+}
+
+void AfManager::launchActivity(const QString &uri)
+{
+    qWarning("AfManager::launchActivity(const QString &uri) is deprecated, use AfManager::launchActivity(const QUrl &uri) instead");
+    launchActivity(QUrl(uri));
+}
+
+void AfManager::launchActivity(int applicationId, const QString &activityId, const QVariantHash& parameters)
+{
+    QVariantHash activity;
+    activity.insert(ActivityApplicationKeyword, applicationId);
+    activity.insert(ActivityActivityKeyword, activityId);
+    activity.insert(ActivityParametersKeyword, parameters);
+    
+    launchActivity(activity);
+}
+
+void AfManager::getThumbnail(QSize resolution,const QString &thumbnailPath, void *data)
+{
+    mServiceProvider->getThumbnail(resolution, thumbnailPath, data);
+}
+
+void AfManager::launchActivity(const QVariantHash& activity)
+{
+    AfLauncher applicationLauncher;
+    int applicationId = activity.value(ActivityApplicationKeyword).toInt();
+    if (applicationLauncher.isRunning(applicationId)) {
+        mServiceProvider->launchActivity(applicationId, activityToUri(activity).toString());
+    } else {
+        applicationLauncher.startApplication(applicationId, activityToUri(activity));
+    }
+}
+
+QUrl AfManager::activityToUri(const QVariantHash& activity) const
+{
+    QUrl uri;
+    uri.setScheme(Af::KActivityScheme);
+    uri.setHost(QString("%1").arg(activity.value(ActivityApplicationKeyword).toUInt(), 8, 16, QChar('0')));
+    
+    if (activity.contains(ActivityActivityKeyword))
+        uri.addQueryItem(Af::KActivityUriNameKey, activity.value(ActivityActivityKeyword).toString());
+    
+    QVariantHash parameters = activity.value(ActivityParametersKeyword).toHash();
+    foreach(const QString &key, parameters.keys()) {
+        uri.addQueryItem(key, parameters.value(key).toString());
+    } 
+    return uri;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afserviceplugin.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "afserviceplugin.h"
+
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+#include "afstorageproxy.h"
+#include "afclient.h"
+#include "afmanager.h"
+#include "afactivation.h"
+#include "afactivitystorage.h"
+
+QObject *AfServicePlugin::createInstance(const QServiceInterfaceDescriptor &descriptor, QServiceContext *context, QAbstractSecuritySession *session)
+{
+    Q_UNUSED(context);
+    Q_UNUSED(session);
+
+    if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityClient") {
+        return new AfClient(QSharedPointer<AfActivityStorage>(new AfActivityStorage()), QSharedPointer<AfActivation>(new AfActivation()));
+    } else if (descriptor.interfaceName() == "com.nokia.qt.activities.ActivityManager") {
+        return new AfManager(QSharedPointer<AfStorageProxy>(new AfStorageProxy()));
+    } else if (descriptor.interfaceName() == "com.nokia.qt.activities.Storage") {
+        return new AfActivityStorage();
+    } else if (descriptor.interfaceName() == "com.nokia.qt.activities.Activation") {
+        return new AfActivation();
+    } else {
+        return NULL;
+    }
+}
+
+Q_EXPORT_PLUGIN2(activityserviceplugin, AfServicePlugin)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/activityserviceplugin/src/afstorageproxy.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "afstorageproxy.h"
+#include "afstorageproxy_p.h"
+
+AfStorageProxy::AfStorageProxy(QObject *parent) : QObject (parent), d_ptr(new AfStorageProxyPrivate(this))
+{    
+}
+
+AfStorageProxy::~AfStorageProxy()
+{
+    delete d_ptr;
+}
+
+bool AfStorageProxy::addActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{
+    return d_ptr->addActivity(applicationId, activityId, activityData, metadata, screenshot);
+}
+
+bool AfStorageProxy::updateActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{
+    return d_ptr->updateActivity(applicationId, activityId, activityData, metadata, screenshot);
+}
+
+bool AfStorageProxy::saveActivity(int applicationId, const QString &activityId, const QVariant &activityData, const QVariantHash &metadata, const QPixmap &screenshot)
+{
+    return d_ptr->saveActivity(applicationId, activityId, activityData, metadata, screenshot);
+}
+
+bool AfStorageProxy::removeActivity(int applicationId, const QString &activityId)
+{
+    return d_ptr->removeActivity(applicationId, activityId);
+}
+   
+bool AfStorageProxy::removeApplicationActivities(int applicationId)
+{
+    return d_ptr->removeApplicationActivities(applicationId);
+}
+
+bool AfStorageProxy::activities(QList<QVariantHash> &list)
+{
+    return d_ptr->activities(list);
+}
+
+bool AfStorageProxy::applicationActivities(QStringList &list, int applicationId)
+{
+    return d_ptr->applicationActivities(list, applicationId);
+}
+
+bool AfStorageProxy::activityData(QVariant &data, int applicationId, const QString &activityId)
+{
+    return d_ptr->activityData(data, applicationId, activityId);
+}
+
+bool AfStorageProxy::activityMetaData(QVariantHash &metadata, int applicationId, const QString &activityId)
+{
+    return d_ptr->activityMetaData(metadata, applicationId, activityId);
+}
+
+bool AfStorageProxy::waitActivity()
+{
+    return d_ptr->waitActivity();
+}
+    
+bool AfStorageProxy::launchActivity(int applicationId, const QString &activityUri)
+{
+    return d_ptr->launchActivity(applicationId, activityUri);
+}
+
+bool AfStorageProxy::getThumbnail(const QSize &size, const QString &imagePath, void *userData)
+{
+    return d_ptr->getThumbnail(size, imagePath, userData);
+}
+
+bool AfStorageProxy::notifyDataChange()
+{
+    return d_ptr->notifyDataChange();
+}
--- a/activityfw/activityserviceplugin/src/applicationlauncher.cpp	Tue Jul 06 14:37:10 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 "applicationlauncher.h"
-#include "applicationlauncher_p.h"
-
-ApplicationLauncher::ApplicationLauncher() : d_ptr(new ApplicationLauncherPrivate())
-{
-}
-
-ApplicationLauncher::~ApplicationLauncher()
-{
-    delete d_ptr;
-}
-
-bool ApplicationLauncher::isRunning(int applicationId)
-{
-    return d_ptr->isRunning(applicationId);
-}
-
-void ApplicationLauncher::startApplication(int applicationId, const QUrl &uri)
-{
-    d_ptr->startApplication(applicationId, uri);
-}
-
-void ApplicationLauncher::bringToForeground(int applicationId)
-{
-    d_ptr->bringToForeground(applicationId);
-}
--- a/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/activityserviceplugin/symbianinstaller/activityserviceinstaller/activityserviceinstaller.qrc	Wed Aug 18 10:05:49 2010 +0300
@@ -1,5 +1,5 @@
 <RCC>
     <qresource prefix="/" >
-        <file alias="activityserviceplugin.xml">../../data/activityserviceplugin.xml</file>
+        <file alias="activityserviceplugin.xml">../../data/afservice.xml</file>
     </qresource>
 </RCC>
--- a/activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/activityserviceplugin/symbianinstaller/symbianinstaller.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -20,7 +20,7 @@
 symbian {
     load(data_caging_paths) 
 
-    plugin.sources = activityserviceplugin.dll
+    plugin.sources = afservice.dll
     plugin.path = $$QT_PLUGINS_BASE_DIR 
     
     installer.pkg_postrules += "\"$${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/activityserviceinstaller.exe\" \  
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -28,7 +28,7 @@
     if (serviceManager.findInterfaces("ActivityService").isEmpty()) {
         // clean old entries
         serviceManager.removeService("ActivityService");
-        bool servicesAdded = serviceManager.addService(":/activityserviceplugin.xml");
+        bool servicesAdded = serviceManager.addService(":/afservice.xml");
         if (!servicesAdded) {
             qWarning("addService for ActivityService returned false, error %d", serviceManager.error());
         }
--- a/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.qrc	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/orbitintegration/hbactivityplugin/hbactivityplugin.qrc	Wed Aug 18 10:05:49 2010 +0300
@@ -1,5 +1,5 @@
 <RCC>
     <qresource prefix="/" >
-        <file alias="activityserviceplugin.xml">../../activityserviceplugin/data/activityserviceplugin.xml</file>
+        <file alias="afservice.xml">../../activityserviceplugin/data/afservice.xml</file>
     </qresource>
 </RCC> 
\ No newline at end of file
--- a/activityfw/rom/activitymanager_core.iby	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/rom/activitymanager_core.iby	Wed Aug 18 10:05:49 2010 +0300
@@ -17,17 +17,19 @@
 #ifndef __TSACTMAN_CORE_IBY__
 #define __TSACTMAN_CORE_IBY__
 
-file=ABI_DIR\BUILD_DIR\activityserviceplugin.dll					       SHARED_LIB_DIR\activityserviceplugin.dll
-data=\epoc32\data\z\resource\qt\plugins\activityserviceplugin.qtplugin    resource\qt\plugins\activityserviceplugin.qtplugin
+file=ABI_DIR\BUILD_DIR\afservice.dll					       SHARED_LIB_DIR\afservice.dll
+data=\epoc32\data\z\resource\qt\plugins\afservice.qtplugin    resource\qt\plugins\afservice.qtplugin
 
 file=ABI_DIR\BUILD_DIR\hsactivitydbserver.exe                            PROGRAMS_DIR\hsactivitydbserver.exe
 
 file=ABI_DIR\BUILD_DIR\afstorageclient.dll					       SHARED_LIB_DIR\afstorageclient.dll
 file=ABI_DIR\BUILD_DIR\tsutils.dll			    		       SHARED_LIB_DIR\tsutils.dll
+file=ABI_DIR\BUILD_DIR\afactivitylauncher.dll			    		       SHARED_LIB_DIR\afactivitylauncher.dll
 
 file=ABI_DIR\BUILD_DIR\hbactivityplugin.dll					       SHARED_LIB_DIR\hbactivityplugin.dll
 data=\epoc32\data\z\resource\qt\plugins\hbactivityplugin.qtplugin    resource\qt\plugins\hbactivityplugin.qtplugin
 
+data=DATAZ_\resource\activity\afservice.xml resource\activity\afservice.xml
 data=DATAZ_\resource\activity\activityserviceplugin.xml resource\activity\activityserviceplugin.xml
 
 // stub sis
--- a/activityfw/sis/activitymanager.pkg	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/sis/activitymanager.pkg	Wed Aug 18 10:05:49 2010 +0300
@@ -26,13 +26,14 @@
 ;Unique Vendor name
 :"Nokia"
 
-"/epoc32/release/armv5/urel/activityserviceplugin.dll"-"!:\sys\bin\activityserviceplugin.dll"
-"/epoc32/data/z/resource/qt/plugins/activityserviceplugin.qtplugin"-"!:\resource\qt\plugins\activityserviceplugin.qtplugin"
+"/epoc32/release/armv5/urel/afservice.dll"-"!:\sys\bin\afservice.dll"
+"/epoc32/data/z/resource/qt/plugins/afservice.qtplugin"-"!:\resource\qt\plugins\afservice.qtplugin"
 
 "/epoc32/release/armv5/urel/hsactivitydbserver.exe"    - "!:\sys\bin\hsactivitydbserver.exe"
 
 "/epoc32/release/armv5/urel/afstorageclient.dll"    - "!:\sys\bin\afstorageclient.dll"
 "/epoc32/release/armv5/urel/tsutils.dll"    - "!:\sys\bin\tsutils.dll"
+"/epoc32/release/armv5/urel/afactivitylauncher.dll"    - "!:\sys\bin\afactivitylauncher.dll"
 
 "/epoc32/release/armv5/urel/hbactivityplugin.dll"    - "!:\sys\bin\hbactivityplugin.dll"
 "/epoc32/data/z/resource/qt/plugins/hbactivityplugin.qtplugin"-"!:\resource\qt\plugins\hbactivityplugin.qtplugin"
--- a/activityfw/sis/stubs/activitymanager_stub.pkg	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/sis/stubs/activitymanager_stub.pkg	Wed Aug 18 10:05:49 2010 +0300
@@ -32,13 +32,14 @@
 ;Unique Vendor name
 :"Nokia"
 
-"" - "Z:\sys\bin\activityserviceplugin.dll"
-"" - "Z:\resource\qt\plugins\activityserviceplugin.qtplugin"
+"" - "Z:\sys\bin\afservice.dll"
+"" - "Z:\resource\qt\plugins\afservice.qtplugin"
 
 ""    - "Z:\sys\bin\hsactivitydbserver.exe"
 
 ""    - "Z:\sys\bin\afstorageclient.dll"
 ""    - "Z:\sys\bin\tsutils.dll"
+""    - "Z:\sys\bin\afactivitylauncher.dll"
 
 ""    - "Z:\sys\bin\hbactivityplugin.dll"
 "" -  "Z:\resource\qt\plugins\hbactivityplugin.qtplugin"
\ No newline at end of file
Binary file activityfw/sis/stubs/activitymanager_stub.sis has changed
--- a/activityfw/storage/bwins/afstorageclientu.def	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-EXPORTS
-	?updateActivity@AfStorageClient@@QAEHABVAfStorageEntry@@ABVQPixmap@@@Z @ 1 NONAME ; int AfStorageClient::updateActivity(class AfStorageEntry const &, class QPixmap const &)
-	?tr@AfStorageClient@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString AfStorageClient::tr(char const *, char const *, int)
-	?asyncRequestCompleated@AfStorageClient@@EAEXHHABVQString@@@Z @ 3 NONAME ; void AfStorageClient::asyncRequestCompleated(int, int, class QString const &)
-	??_EAfStorageClient@@UAE@I@Z @ 4 NONAME ; AfStorageClient::~AfStorageClient(unsigned int)
-	?dataChanged@AfStorageClient@@IAEXXZ @ 5 NONAME ; void AfStorageClient::dataChanged(void)
-	?waitActivity@AfStorageClient@@QAEHXZ @ 6 NONAME ; int AfStorageClient::waitActivity(void)
-	?asyncRequestCompleated@AfStorageClient@@EAEXHH@Z @ 7 NONAME ; void AfStorageClient::asyncRequestCompleated(int, int)
-	?applicationId@AfStorageEntry@@QBEHXZ @ 8 NONAME ; int AfStorageEntry::applicationId(void) const
-	?removeActivity@AfStorageClient@@QAEHABVAfStorageEntry@@@Z @ 9 NONAME ; int AfStorageClient::removeActivity(class AfStorageEntry const &)
-	?qt_metacall@AfStorageClient@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int AfStorageClient::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??_EAfStorageEntry@@QAE@I@Z @ 11 NONAME ; AfStorageEntry::~AfStorageEntry(unsigned int)
-	?data@AfStorageEntry@@QBEPBVCAfEntry@@XZ @ 12 NONAME ; class CAfEntry const * AfStorageEntry::data(void) const
-	?getStaticMetaObject@AfStorageClient@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & AfStorageClient::getStaticMetaObject(void)
-	?activityData@AfStorageClient@@QAEHAAVAfStorageEntry@@ABV2@@Z @ 14 NONAME ; int AfStorageClient::activityData(class AfStorageEntry &, class AfStorageEntry const &)
-	?activityRequested@AfStorageClient@@IAEXABVQString@@@Z @ 15 NONAME ; void AfStorageClient::activityRequested(class QString const &)
-	?getThumbnail@AfStorageClient@@QAEHVQSize@@VQString@@PAX@Z @ 16 NONAME ; int AfStorageClient::getThumbnail(class QSize, class QString, void *)
-	?metaObject@AfStorageClient@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * AfStorageClient::metaObject(void) const
-	??0AfStorageEntry@@QAE@V?$QSharedPointer@VCAfEntry@@@@@Z @ 18 NONAME ; AfStorageEntry::AfStorageEntry(class QSharedPointer<class CAfEntry>)
-	??0AfStorageClient@@QAE@PAVQObject@@@Z @ 19 NONAME ; AfStorageClient::AfStorageClient(class QObject *)
-	?thumbnailRequested@AfStorageClient@@IAEXVQPixmap@@PAX@Z @ 20 NONAME ; void AfStorageClient::thumbnailRequested(class QPixmap, void *)
-	?staticMetaObject@AfStorageClient@@2UQMetaObject@@B @ 21 NONAME ; struct QMetaObject const AfStorageClient::staticMetaObject
-	?activities@AfStorageClient@@QAEHAAV?$QList@VAfStorageEntry@@@@@Z @ 22 NONAME ; int AfStorageClient::activities(class QList<class AfStorageEntry> &)
-	?publicData@AfStorageEntry@@QBE?AV?$QHash@VQString@@VQVariant@@@@XZ @ 23 NONAME ; class QHash<class QString, class QVariant> AfStorageEntry::publicData(void) const
-	??1AfStorageEntry@@QAE@XZ @ 24 NONAME ; AfStorageEntry::~AfStorageEntry(void)
-	??0AfStorageEntry@@QAE@ABV0@@Z @ 25 NONAME ; AfStorageEntry::AfStorageEntry(class AfStorageEntry const &)
-	?launchActivity@AfStorageClient@@QAEHABVAfStorageEntry@@@Z @ 26 NONAME ; int AfStorageClient::launchActivity(class AfStorageEntry const &)
-	?trUtf8@AfStorageClient@@SA?AVQString@@PBD0H@Z @ 27 NONAME ; class QString AfStorageClient::trUtf8(char const *, char const *, int)
-	?removeApplicationActivities@AfStorageClient@@QAEHABVAfStorageEntry@@@Z @ 28 NONAME ; int AfStorageClient::removeApplicationActivities(class AfStorageEntry const &)
-	?trUtf8@AfStorageClient@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString AfStorageClient::trUtf8(char const *, char const *)
-	?applicationActivities@AfStorageClient@@QAEHAAV?$QList@VAfStorageEntry@@@@ABVAfStorageEntry@@@Z @ 30 NONAME ; int AfStorageClient::applicationActivities(class QList<class AfStorageEntry> &, class AfStorageEntry const &)
-	?connect@AfStorageClient@@QAEHXZ @ 31 NONAME ; int AfStorageClient::connect(void)
-	?tr@AfStorageClient@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString AfStorageClient::tr(char const *, char const *)
-	?notifyDataChange@AfStorageClient@@QAEHXZ @ 33 NONAME ; int AfStorageClient::notifyDataChange(void)
-	?imageSrc@AfStorageEntry@@QBE?AVQString@@XZ @ 34 NONAME ; class QString AfStorageEntry::imageSrc(void) const
-	?asyncRequestCompleated@AfStorageClient@@EAEXHHABVQPixmap@@PAX@Z @ 35 NONAME ; void AfStorageClient::asyncRequestCompleated(int, int, class QPixmap const &, void *)
-	??0AfStorageEntry@@QAE@HABVQString@@ABVQVariant@@ABV?$QHash@VQString@@VQVariant@@@@@Z @ 36 NONAME ; AfStorageEntry::AfStorageEntry(int, class QString const &, class QVariant const &, class QHash<class QString, class QVariant> const &)
-	?addActivity@AfStorageClient@@QAEHABVAfStorageEntry@@ABVQPixmap@@@Z @ 37 NONAME ; int AfStorageClient::addActivity(class AfStorageEntry const &, class QPixmap const &)
-	?privateData@AfStorageEntry@@QBE?AVQVariant@@XZ @ 38 NONAME ; class QVariant AfStorageEntry::privateData(void) const
-	??1AfStorageClient@@UAE@XZ @ 39 NONAME ; AfStorageClient::~AfStorageClient(void)
-	?activityId@AfStorageEntry@@QBE?AVQString@@XZ @ 40 NONAME ; class QString AfStorageEntry::activityId(void) const
-	?flags@AfStorageEntry@@QBEHXZ @ 41 NONAME ; int AfStorageEntry::flags(void) const
-	?qt_metacast@AfStorageClient@@UAEPAXPBD@Z @ 42 NONAME ; void * AfStorageClient::qt_metacast(char const *)
-
--- a/activityfw/storage/client/client.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/client/client.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -14,53 +14,6 @@
 # Description: 
 #
 
-TEMPLATE = lib
-TARGET = afstorageclient
-
-QT        += core \
-             sql
-
-HEADERS   += inc/afstorageclient.h \
-             inc/afstorageentry.h
-
-SOURCES   += src/afstorageclient.cpp \
-             src/afstorageentry.cpp
-
-DEFINES += ACTIVITY_LIB
-
-symbian{
-TARGET.UID3 = 0xE467C21E
-
-HEADERS   += ../s60/inc/afentry.h \
-             ../s60/inc/afserializer.h \
-             s60/inc/afstorageclient_p.h \
-             s60/inc/afstorageclientimp.h \
-			 s60/inc/afasyncrequest_p.h \
-             s60/inc/afthumbnailrequest_p.h
+TEMPLATE = subdirs
 
-SOURCES   += ../s60/src/afentry.cpp \
-             ../s60/src/afserializer.cpp \
-             s60/src/afstorageclient_p.cpp \
-             s60/src/afstorageclientimp.cpp \
-			 s60/src/afasyncrequest_p.cpp \
-             s60/src/afthumbnailrequest_p.cpp
-
-LIBS      += -lxqutils \
-             -lestor \
-             -lfbscli
-
-afstorageclientdll.sources = afstorageclient.dll
-afstorageclientdll.path = $$SHARED_LIB_DIR
-DEPLOYMENT += afstorageclientdll
-
-BLD_INF_RULES.prj_exports += "../inc/afstorageglobals.h /epoc32/include/afstorageglobals.h" \
-                             "../inc/afcmd.h /epoc32/include/afcmd.h" \
-                             "inc/afstorageclient.h |../../../inc/afstorageclient.h" \
-                             "inc/afstorageentry.h |../../../inc/afstorageentry.h" \
-							 "inc/afasyncrequestobserver.h |../../../inc/afasyncrequestobserver.h"
-DEPLOYMENT += api
-TARGET.CAPABILITY = ALL -TCB
-TARGET.EPOCALLOWDLLDATA = 1
-TARGET.UID3 = 0x200267B3
-MMP_RULES += EXPORTUNFROZEN
-}
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/group/bld.inf	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,26 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies 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
+DEFAULT
+
+PRJ_MMPFILES
+client.mmp
+
+PRJ_EXPORTS
+
+../inc/afstorageclient.h |../../../inc/afstorageclient.h
+../inc/afasyncrequestobserver.h |../../../inc/afasyncrequestobserver.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/group/client.mmp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+TARGET          afstorageclient.dll
+TARGETTYPE      dll
+UID             0x1000008d 0x200267B3
+
+EPOCALLOWDLLDATA
+
+MW_LAYER_SYSTEMINCLUDE 
+
+USERINCLUDE     ../inc
+USERINCLUDE     ../../inc
+
+SOURCEPATH      ../src
+SOURCE          afstorageclient.cpp
+SOURCE          afstorageclient_p.cpp
+SOURCE          afstorageclientimp.cpp
+SOURCE          afasyncrequest_p.cpp
+SOURCE          afthumbnailrequest_p.cpp
+
+LIBRARY        euser.lib 
+LIBRARY        estor.lib
+LIBRARY        fbscli.lib
+STATICLIBRARY  afstoragecommon.lib
+
+CAPABILITY     ALL -TCB
+EXPORTUNFROZEN 
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afasyncrequest_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFASYNCREQUESTPRIVATE_H
+#define AFASYNCREQUESTPRIVATE_H
+
+#include <e32base.h>
+#include <afcmd.h>
+
+#include "afasyncrequestobserver.h"
+#include "afasyncsession.h"
+
+class CAfAsyncRequestPrivate : public CActive
+
+{
+public:
+    static void NewLD(MAfAsyncRequestObserver &observer, 
+                      MAfAsyncSession & session,
+                      ActivityCmd cmd);
+
+    ~CAfAsyncRequestPrivate();
+
+protected:
+    void DoCancel();
+
+    void RunL();
+
+    TInt RunError(TInt error);
+
+private:
+    CAfAsyncRequestPrivate(MAfAsyncRequestObserver &, 
+                           MAfAsyncSession &,
+                           ActivityCmd);
+    void ConstructL();
+
+private:
+    MAfAsyncRequestObserver &mObserver;
+    MAfAsyncSession &mSession;
+    const ActivityCmd mCmd;
+    TPckgBuf<TInt> mIds[4];
+};
+#endif // AFASYNCREQUESTPRIVATE_H
--- a/activityfw/storage/client/inc/afasyncrequestobserver.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/client/inc/afasyncrequestobserver.h	Wed Aug 18 10:05:49 2010 +0300
@@ -17,8 +17,8 @@
 
 #ifndef AFASYNCREQUESTOBSERVER_H
 #define AFASYNCREQUESTOBSERVER_H
-#include <QString>
-#include <QPixmap>
+
+#include <e32base.h>
 
 class MAfAsyncRequestObserver
 {
@@ -26,30 +26,25 @@
     /**
      * Function inform observer about asynchronous request results
      * @param result - request result
-     * @param requestType - request type
-     * @param data - respons data
+     * @param data - response data
      */
-    virtual void asyncRequestCompleated(int result,
-                                        int requestType,
-                                        const QString &data)=0;
+    virtual void waitActivityRequestCompleted(int result, 
+                                              const TDesC8 &data) = 0;
 
     /**
      * Function inform observer about asynchronous request results
      * @param result - request result
-     * @param requestType - request type
      * @param pixmap - pixmap respons
      */
-    virtual void asyncRequestCompleated(int result,
-                                        int requestType,
-                                        const QPixmap& pixmap, 
-                                        void* userData)=0;
+    virtual void getThumbnailRequestCompleted(int result,
+                                              int bitmapHandle, 
+                                              void* userData) = 0;
     
     /**
      * Function inform observer about asynchronous request results
      * @param result - request result
-     * @param requestType - request type
      */
-    virtual void asyncRequestCompleated(int result,
-                                        int requestType)=0;
+    virtual void dataChangeNotificationCompleted(int result) = 0;
+    
 };
 #endif // AFASYNCREQUESTOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afasyncsession.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFASYNCSESSION_H
+#define AFASYNCSESSION_H
+#include <e32base.h>
+class MAfAsyncSession
+{
+public:
+    virtual void PushL(CBase* asyncTask) = 0;
+    virtual void Pop(CBase* asyncTask) =0;
+    virtual void executeL(int function) =0;
+    virtual void sendAsync(int function, const TIpcArgs &args, TRequestStatus& status) =0;
+    virtual void getDataL(int id, TDes8& buffer) =0;
+};
+
+#endif //AFASYNCSESSION_H
--- a/activityfw/storage/client/inc/afstorageclient.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/client/inc/afstorageclient.h	Wed Aug 18 10:05:49 2010 +0300
@@ -17,75 +17,40 @@
 
 #ifndef AFSTORAGECLIENT_H
 #define AFSTORAGECLIENT_H
-#include <QObject>
-#include <afasyncrequestobserver.h>
 
-#ifdef ACTIVITY_LIB
-    #define ACTIVITY_EXPORT Q_DECL_EXPORT
-#else
-    #define ACTIVITY_EXPORT Q_DECL_IMPORT
-#endif
+#include "afasyncrequestobserver.h"
 
-class AfStorageClientPrivate;
-class AfStorageEntry;
-
-class ACTIVITY_EXPORT AfStorageClient: public QObject,
-                                       public MAfAsyncRequestObserver
-{
-    Q_OBJECT
-public:
-    AfStorageClient(QObject* =0);
-
-    ~AfStorageClient();
-
-    int connect();
+class CAfStorageClientPrivate;
+class CAfEntry;
 
-    int addActivity(const AfStorageEntry &entry, const QPixmap& imageSource = QPixmap());
-
-    int updateActivity(const AfStorageEntry &entry, const QPixmap& imageSource = QPixmap());
-
-    int removeActivity(const AfStorageEntry &entry);
-
-    int removeApplicationActivities(const AfStorageEntry &entry);
-
-    int activities(QList<AfStorageEntry> &dst);
-
-    int applicationActivities(QList<AfStorageEntry> &dst, 
-                              const AfStorageEntry &entry);
-
-    int activityData(AfStorageEntry &dst, const AfStorageEntry &entry);
-
-    int waitActivity();
-    
-    int launchActivity(const AfStorageEntry &entry);
-    
-    int getThumbnail(QSize size, QString imagePath, void* userDdata);
-    
-    int notifyDataChange();
+NONSHARABLE_CLASS(CAfStorageClient) : public CBase
+{
+public:
+    IMPORT_C static CAfStorageClient *NewL(MAfAsyncRequestObserver &observer);
+    IMPORT_C static CAfStorageClient *NewLC(MAfAsyncRequestObserver &observer);
+    IMPORT_C virtual ~CAfStorageClient();
 
 private:
-    void asyncRequestCompleated(int, int, const QString &);
-
-    void asyncRequestCompleated(int, int, const QPixmap&, void*);
-
-    void asyncRequestCompleated(int result,
-                                int requestType);
-
-signals:
-    void activityRequested(const QString &activityId);
+    CAfStorageClient();
+    void ConstructL(MAfAsyncRequestObserver &observer);
+    
+public:    
+    IMPORT_C int addActivity(const CAfEntry &entry, TInt imageHandle);
+    IMPORT_C int updateActivity(const CAfEntry &entry, TInt imageHandle);
+    IMPORT_C int saveActivity(const CAfEntry &entry, TInt imageHandle);
+    IMPORT_C int removeActivity(const CAfEntry &entry);
+    IMPORT_C int removeApplicationActivities(const CAfEntry &entry);
+    IMPORT_C int activities(RPointerArray<CAfEntry> &dst);
+    IMPORT_C int applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry);
+    IMPORT_C int activityData(CAfEntry *&dst, const CAfEntry &entry);
+    IMPORT_C int waitActivity();
+    IMPORT_C int launchActivity(const CAfEntry &entry);
+    IMPORT_C int getThumbnail(const TSize &size, const TDesC &imagePath, void *userData);
+    IMPORT_C int notifyDataChange();
 
-    void thumbnailRequested(QPixmap thumbnailPixmap, void *userData);
-    
-    void dataChanged();
+private: 
+    CAfStorageClientPrivate *d_ptr;
     
-private:
-    /**
-     * Private client implementation.
-     * Own.
-     */
-    AfStorageClientPrivate *d_ptr;
-    
-    friend class AfStorageClientPrivate;
 };
 
 #endif //AFSTORAGECLIENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afstorageclient_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,60 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef AFSTORAGECLIENTPRIVATE_H
+#define AFSTORAGECLIENTPRIVATE_H
+
+#include <e32base.h>
+#include "afstorageglobals.h"
+#include "afstorageclientimp.h"
+
+class CAfStorageClientPrivate : public CBase
+{
+
+public:
+    static CAfStorageClientPrivate *NewL(MAfAsyncRequestObserver &observer);
+    static CAfStorageClientPrivate *NewLC(MAfAsyncRequestObserver &observer);
+    virtual ~CAfStorageClientPrivate();
+
+private:
+    CAfStorageClientPrivate(MAfAsyncRequestObserver &observer);
+    void ConstructL();
+
+public:
+    int connect();
+    int addActivity(const CAfEntry &sourceEntry, TInt imageHandle);
+    int updateActivity(const CAfEntry &sourceEntry, TInt imageHandle);
+    int saveActivity(const CAfEntry &entry, TInt imageHandle);
+    int removeActivity(const CAfEntry &templateEntry);
+    int removeApplicationActivities(const CAfEntry &templateEntry);
+    int activities(RPointerArray<CAfEntry> &dst);
+    int applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry);
+    int activityData(CAfEntry *&resultEntry, const CAfEntry &templateEntry);
+    int waitActivity();
+    int getThumbnail(const TSize &size, const TDesC &imagePath, void *userData);
+    int notifyDataChange();
+    int launchActivity(const CAfEntry &templateEntry);
+
+private:
+    int execute(int function, const CAfEntry &sourceEntry, TInt imageHandle);
+    int execute(int function, RPointerArray<CAfEntry> &resultsList,const CAfEntry &templateEntry);
+
+private:
+    RAfStorageClientImplementation mImplementation;
+};
+
+#endif // AFSTORAGECLIENTPRIVATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afstorageclientimp.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFSTORAGECLIENTIMPLEMENTATION_H
+#define AFSTORAGECLIENTIMPLEMENTATION_H
+#include <e32base.h>
+#include "afasyncrequestobserver.h"
+#include "afasyncsession.h"
+
+class CAfEntry;
+class CFbsBitmap;
+
+class RAfStorageClientImplementation: protected RSessionBase,
+                                      public MAfAsyncSession
+{
+public:
+    RAfStorageClientImplementation(MAfAsyncRequestObserver &observer);
+
+    ~RAfStorageClientImplementation();
+
+    void Close();
+
+    void executeL(int function, 
+                  const CAfEntry &sourceEntry,
+                  int userData =0);
+
+    void executeL(int function, 
+                  RPointerArray<CAfEntry> &resultsList, 
+                  const CAfEntry& templateEntry);
+    
+    void getThumbnailL(TSize size, 
+                      const TDesC& source,
+                      TAny *userData );
+
+    void connectL();
+
+public:
+    void PushL(CBase* asyncTask);
+
+    void Pop(CBase* asyncTask);
+
+    void executeL(int function);
+
+    void sendAsync(int function, const TIpcArgs &args, TRequestStatus& status);
+
+    void getDataL(int id, TDes8& buffer);
+
+private:
+    void startServerL();
+
+private:
+    RPointerArray<CBase> mAsyncTasks;
+    MAfAsyncRequestObserver &mObserver;
+};
+
+#endif //AFSTORAGECLIENTIMPLEMENTATION_H
--- a/activityfw/storage/client/inc/afstorageentry.h	Tue Jul 06 14:37:10 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 AFSTORAGEENTRY_H
-#define AFSTORAGEENTRY_H
-
-#include <qvariant.h>
-#include <qsharedpointer.h>
-
-class CAfEntry;
-
-#ifdef ACTIVITY_LIB
-    #define ACTIVITY_EXPORT Q_DECL_EXPORT
-#else
-    #define ACTIVITY_EXPORT Q_DECL_IMPORT
-#endif
-
-class ACTIVITY_EXPORT AfStorageEntry
-{
-public:
-    AfStorageEntry(QSharedPointer<CAfEntry> data = QSharedPointer<CAfEntry>(0));
-
-    AfStorageEntry(const AfStorageEntry &templateEntry);
-    
-    AfStorageEntry(int appId, 
-                   const QString &actId = QString(), 
-                   const QVariant &privateData = QVariant(), 
-                   const QVariantHash& publicData = QVariantHash());
-
-    const CAfEntry* data() const;
-
-    int flags() const;
-
-    int applicationId() const;
-
-    QString activityId() const;
-
-    QString imageSrc() const;
-    
-    QVariantHash publicData() const;
-    
-    QVariant privateData() const;
-    
-private:
-    QSharedPointer<CAfEntry> mData;
-
-};
-
-#endif //AFSTORAGEENTRY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/inc/afthumbnailrequest_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFTHUMBNAILREQUESTPRIVATE_H
+#define AFTHUMBNAILREQUESTPRIVATE_H
+
+#include <e32base.h>
+
+#include "afasyncrequestobserver.h"
+#include "afasyncsession.h"
+
+class CAfThumbnailRequestPrivate : public CActive
+
+{
+public:
+    static void NewLD(MAfAsyncRequestObserver &observer, 
+                      MAfAsyncSession & session,
+                      TSize resolution,
+                      const TDesC& source,
+                      TAny* userData);
+
+    ~CAfThumbnailRequestPrivate();
+
+protected:
+    void DoCancel();
+
+    void RunL();
+
+    TInt RunError(TInt error);
+
+private:
+    CAfThumbnailRequestPrivate(MAfAsyncRequestObserver &, 
+                               MAfAsyncSession &, 
+                               TAny*);
+
+    void ConstructL(TSize resolution, const TDesC& source);
+
+private:
+    MAfAsyncRequestObserver &mObserver;
+    MAfAsyncSession &mSession;
+    TPckgBuf<TInt> mIds[4]; 
+    RBuf mImgSrc;
+    TAny* mUserData;
+};
+#endif // AFTHUMBNAILREQUESTPRIVATE_H
--- a/activityfw/storage/client/s60/inc/afasyncrequest_p.h	Tue Jul 06 14:37:10 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 AFASYNCREQUESTPRIVATE_H
-#define AFASYNCREQUESTPRIVATE_H
-#include <e32base.h>
-#include <QVariant>
-#include <QPixmap>
-#include "afasyncrequestobserver.h"
-#include "afstorageclientimp.h"
-#include "afcmd.h"
-
-class CAfAsyncRequestPrivate : public CActive
-
-{
-public:
-    static void NewLD(MAfAsyncRequestObserver &observer, 
-                      RAfStorageClientImplementation & session,
-                      ActivityCmd cmd);
-
-    ~CAfAsyncRequestPrivate();
-
-protected:
-    void DoCancel();
-
-    void RunL();
-
-    TInt RunError(TInt error);
-
-private:
-    CAfAsyncRequestPrivate(MAfAsyncRequestObserver &, 
-                           RAfStorageClientImplementation &,
-                           ActivityCmd);
-    void ConstructL();
-
-private:
-    MAfAsyncRequestObserver &mObserver;
-    RAfStorageClientImplementation &mSession;
-    const ActivityCmd mCmd;
-    TPckgBuf<TInt> mIds[4];
-};
-#endif // AFASYNCREQUESTPRIVATE_H
--- a/activityfw/storage/client/s60/inc/afstorageclient_p.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef AFSTORAGECLIENTPRIVATE_H
-#define AFSTORAGECLIENTPRIVATE_H
-
-#include <e32base.h>
-#include "afstorageglobals.h"
-#include "afstorageclientimp.h"
-
-class AfStorageEntry;
-class AfAsyncRequestPrivate;
-
-class AfStorageClientPrivate
-{
-public:
-    AfStorageClientPrivate(MAfAsyncRequestObserver & observer);
-
-    ~AfStorageClientPrivate();
-
-    int connect();
-
-    int addActivity(const AfStorageEntry &sourceEntry, const QPixmap& sourceImage);
-
-    int updateActivity(const AfStorageEntry &sourceEntry, const QPixmap& sourceImage);
-
-    int removeActivity(const AfStorageEntry &templateEntry);
-
-    int removeApplicationActivities(const AfStorageEntry &templateEntry);
-
-    int activities(QList<AfStorageEntry> &dst);
-
-    int applicationActivities(QList<AfStorageEntry> &dst, 
-                              const AfStorageEntry &entry);
-
-    int activityData(AfStorageEntry &resultEntry, const AfStorageEntry &templateEntry);
-    
-    int waitActivity();
-    
-    int getThumbnail(QSize size, QString imagePath , void *userDdata);
-    
-    int notifyDataChange();
-
-    int launchActivity(const AfStorageEntry &templateEntry);
-
-    int cancelWaitActivity();
-
-    int cancelNotifyDataChange();
-
-private:
-    int execute(int function, const AfStorageEntry &sourceEntry, const QPixmap& sourceImage);
-    int execute(int function, QList<AfStorageEntry>& resultsList,const AfStorageEntry& templateEntry);
-
-private:
-    RAfStorageClientImplementation mImplementation;
-};
-#endif // AFSTORAGECLIENTPRIVATE_H
--- a/activityfw/storage/client/s60/inc/afstorageclientimp.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef AFSTORAGECLIENTIMPLEMENTATION_H
-#define AFSTORAGECLIENTIMPLEMENTATION_H
-#include <e32base.h>
-#include "afasyncrequestobserver.h"
-
-class CAfEntry;
-class CFbsBitmap;
-
-class RAfStorageClientImplementation: protected RSessionBase
-{
-public:
-    RAfStorageClientImplementation(MAfAsyncRequestObserver &observer);
-
-    ~RAfStorageClientImplementation();
-
-    void Close();
-
-    void executeL(int function);
-
-    void executeL(int function, 
-                  const CAfEntry &sourceEntry,
-                  int userData =0);
-
-    void executeL(int function, 
-                  RPointerArray<CAfEntry> &resultsList, 
-                  const CAfEntry& templateEntry);
-    
-    void getThumbnailL(TSize size, 
-                      const TDesC& source,
-                      TAny *userData );
-
-    void connectL();
-
-public:
-    void PushL(CBase* asyncTask);
-
-    void Pop(CBase* asyncTask);
-
-    void sendAsync(int function, const TIpcArgs &args, TRequestStatus& status);
-
-    void getDataL(int id, TDes8& buffer);
-
-private:
-    void startServerL();
-
-private:
-    RPointerArray<CBase> mAsyncTasks;
-    MAfAsyncRequestObserver &mObserver;
-};
-
-#endif //AFSTORAGECLIENTIMPLEMENTATION_H
--- a/activityfw/storage/client/s60/inc/afthumbnailrequest_p.h	Tue Jul 06 14:37:10 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 AFTHUMBNAILREQUESTPRIVATE_H
-#define AFTHUMBNAILREQUESTPRIVATE_H
-#include <e32base.h>
-#include <QVariant>
-#include <QPixmap>
-#include "afasyncrequestobserver.h"
-#include "afstorageclientimp.h"
-
-class CAfThumbnailRequestPrivate : public CActive
-
-{
-public:
-    static void NewLD(MAfAsyncRequestObserver &observer, 
-                      RAfStorageClientImplementation & session,
-                      TSize resolution,
-                      const TDesC& source,
-                      TAny* userData);
-
-    ~CAfThumbnailRequestPrivate();
-
-protected:
-    void DoCancel();
-
-    void RunL();
-
-    TInt RunError(TInt error);
-
-private:
-    CAfThumbnailRequestPrivate(MAfAsyncRequestObserver &, 
-                               RAfStorageClientImplementation &, 
-                               TAny*);
-
-    void ConstructL(TSize resolution, const TDesC& source);
-
-private:
-    MAfAsyncRequestObserver &mObserver;
-    RAfStorageClientImplementation &mSession;
-    TPckgBuf<TInt> mIds[4]; 
-    RBuf mImgSrc;
-    TAny* mUserData;
-};
-#endif // AFTHUMBNAILREQUESTPRIVATE_H
--- a/activityfw/storage/client/s60/src/afasyncrequest_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "afasyncrequest_p.h"
-#include "afstorageclient_p.h"
-#include "afstorageclient.h"
-#include "afentry.h"
-#include <fbs.h>
-#include <XQConversions>
-
-// -----------------------------------------------------------------------------
-/**
- * Create and initialize handler for anyc. activity requests
- * @param observer - request completion observer
- * @param session - activity client implementation
- * @param cmd - requested functionality
- */
-void CAfAsyncRequestPrivate::NewLD(MAfAsyncRequestObserver &observer, 
-                                   RAfStorageClientImplementation & session,
-                                   ActivityCmd cmd)
-{
-    CAfAsyncRequestPrivate* self = new(ELeave)CAfAsyncRequestPrivate(observer, session, cmd);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    session.PushL(self);
-    CleanupStack::Pop(self);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * First phase construction
- * @param observer - request completion observer
- * @param session - activity client implementation
- * @param cmd - requested functionality
- */
-CAfAsyncRequestPrivate::CAfAsyncRequestPrivate(MAfAsyncRequestObserver & observer, 
-                                               RAfStorageClientImplementation & session,
-                                               ActivityCmd cmd)
-:
-CActive(EPriorityStandard),
-mObserver(observer),
-mSession(session),
-mCmd(cmd)
-{
-    CActiveScheduler::Add(this);
-    RProcess process;
-    mIds[0] = static_cast<TInt>(process.SecureId().iId);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Second phase construction
- */
-void CAfAsyncRequestPrivate::ConstructL()
-{
-    mSession.sendAsync(mCmd, 
-                       TIpcArgs(&mIds[0],&mIds[1], &mIds[2], &mIds[3]),
-                       iStatus);
-    SetActive();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor
- */
-CAfAsyncRequestPrivate::~CAfAsyncRequestPrivate()
-{
-    Cancel();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Cancel pending requst
- */
-void CAfAsyncRequestPrivate::DoCancel()
-{
-    TRAP_IGNORE(
-    switch (mCmd) {
-    case WaitActivity: mSession.executeL(CancelWait); break;
-    case NotifyChange: mSession.executeL(CancelNotify); break;
-    }
-    )
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function handle request completion, copy data, forward information and destroy handler 
- */
-void CAfAsyncRequestPrivate::RunL()
-{
-    User::LeaveIfError(iStatus.Int());
-    switch (mCmd) {
-    case WaitActivity:
-        {
-        RBuf8 data;
-        CleanupClosePushL(data);
-        CAfEntry::ReallocL(data, (mIds[0])());
-        mSession.getDataL((mIds[3])(), data);
-        mObserver.asyncRequestCompleated(iStatus.Int(), mCmd, XQConversions::s60Desc8ToQString(data));
-        CleanupStack::PopAndDestroy(&data);
-        break;
-        }
-    case NotifyChange:
-        mObserver.asyncRequestCompleated(iStatus.Int(), mCmd);
-        break;
-    }
-    mSession.Pop(this);
-    delete this;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function handle request processing errors
- * @param error - error code 
- */
-TInt CAfAsyncRequestPrivate::RunError(TInt error)
-{
-    (WaitActivity == mCmd) ? mObserver.asyncRequestCompleated(error, mCmd, QString::null) :
-                             mObserver.asyncRequestCompleated(error, mCmd);
-    mSession.Pop(this);
-    delete this;
-    return KErrNone;
-}
-
-
--- a/activityfw/storage/client/s60/src/afstorageclient_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,282 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <fbs.h>
-#include <s32mem.h>
-
-#include <qvariant.h>
-#include <XQConversions>
-
-#include "afstorageclient_p.h"
-#include "afasyncrequest_p.h"
-#include "afstorageglobals.h"
-#include "afserializer.h"
-#include "afentry.h"
-#include "afstorageentry.h"
-
-
-// -----------------------------------------------------------------------------
-template <class T>
-void RPointerArrayCleanupMethod(TAny *aPtr)
-{
-    static_cast< RPointerArray<T>* >(aPtr)->ResetAndDestroy();
-}
-
-// -----------------------------------------------------------------------------
-template <class T>
-void CleanupResetAndDestroyPushL(RPointerArray<T> &array) {
-    CleanupStack::PushL(TCleanupItem(&RPointerArrayCleanupMethod<T>, &array));
-} 
-// -----------------------------------------------------------------------------
-/**
- * Constructor
- */
-AfStorageClientPrivate::AfStorageClientPrivate(MAfAsyncRequestObserver & observer)
-:
-mImplementation(observer)
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor
- */
-AfStorageClientPrivate::~AfStorageClientPrivate()
-{
-    mImplementation.Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::connect
- */
-int AfStorageClientPrivate::connect()
-{
-    TRAPD(errNo, mImplementation.connectL());
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::addActivity(const AfStorageEntry &,const QPixmap&)
- */
-int AfStorageClientPrivate::addActivity(const AfStorageEntry &entry, 
-                                        const QPixmap& imageSrc)
-{
-    return execute(AddActivity, entry, imageSrc);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::updateActivity(const AfStorageEntry &,const QPixmap&)
- */
-int AfStorageClientPrivate::updateActivity(const AfStorageEntry &entry, 
-                                           const QPixmap& imageSrc)
-{
-    return execute(UpdateActivity, entry, imageSrc);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::removeActivity(const AfStorageEntry &)
- */
-int AfStorageClientPrivate::removeActivity(const AfStorageEntry &entry)
-{
-    return execute(RemoveActivity, entry, QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::removeApplicationActivities(const AfStorageEntry &)
- */
-int AfStorageClientPrivate::removeApplicationActivities(const AfStorageEntry &entry)
-{
-    return execute(RemoveApplicationActivities, entry, QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::activities(QList<AfStorageEntry> &)
- */
-int AfStorageClientPrivate::activities(QList<AfStorageEntry> &results)
-{
-    return execute(Activities, results, AfStorageEntry());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::applicationActivities(QList<AfStorageEntry> &, const AfStorageEntry &)
- */
-int AfStorageClientPrivate::applicationActivities(QList<AfStorageEntry> &results,
-                                                  const AfStorageEntry &templateEntry)
-{
-    return execute(ApplicationActivities, results, templateEntry);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::activityData(AfStorageEntry &, const AfStorageEntry &)
- */
-int AfStorageClientPrivate::activityData(AfStorageEntry &resultEntry, 
-                                         const AfStorageEntry &templateEntry)
-{
-    
-    QList<AfStorageEntry> results;
-    int errNo(execute(ApplicationActivity, results, templateEntry));
-    if (0 == errNo) {
-        resultEntry = results.first();
-    }
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::waitActivity()
- */
-int AfStorageClientPrivate::waitActivity()
-{
-    return execute(WaitActivity, AfStorageEntry(), QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::getThumbnail(QSize, QString, void *)
- */
-int AfStorageClientPrivate::getThumbnail(QSize size, QString imagePath, void *userData)
-{
-    HBufC *source = XQConversions::qStringToS60Desc(imagePath);
-    TRAPD(errNo, mImplementation.getThumbnailL(TSize(size.width(), size.height()), *source, userData);)
-    delete source;
-    return errNo;
-    
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::notifyDataChange()
- */
-int AfStorageClientPrivate::notifyDataChange()
-{
-    return execute(NotifyChange, AfStorageEntry(), QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::launchActivity(const AfStorageEntry &)
- */
-int AfStorageClientPrivate::launchActivity(const AfStorageEntry &templateEntry)
-{
-    return execute(LaunchActivity, templateEntry, QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::cancelWaitActivity()
- */
-int AfStorageClientPrivate::cancelWaitActivity()
-{
-    return execute(CancelWait, AfStorageEntry(), QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function implementation
- * @see AfStorageClient::cancelNotifyDataChange()
- */
-int AfStorageClientPrivate::cancelNotifyDataChange()
-{
-    return execute(CancelNotify, AfStorageEntry(), QPixmap());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function execute activity framework functinality and return results 
- */
-int AfStorageClientPrivate::execute(int function, const AfStorageEntry &sourceEntry, const QPixmap& sourceImage)
-{
-    TRAPD(errNo,
-    const CAfEntry *entry(sourceEntry.data());
-    int userData(-1);
-    CFbsBitmap* bitmap(sourceImage.toSymbianCFbsBitmap());
-    if(0 != bitmap) {
-        CleanupStack::PushL(bitmap);
-        userData = bitmap->Handle();
-    }
-    switch (function) {
-    case AddActivity:
-    case UpdateActivity:
-    case RemoveActivity:
-    case RemoveApplicationActivities:
-    case LaunchActivity:
-        User::LeaveIfNull(entry);
-        mImplementation.executeL(function, *entry, userData);
-        break;
-    
-    case CancelNotify:
-    case CancelWait:
-    case WaitActivity:
-    case NotifyChange:
-        mImplementation.executeL(function);
-        break;
-    }
-    if(0 != bitmap) {
-        CleanupStack::PopAndDestroy(bitmap);
-    }
-    )
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function execute activity framework functinality and return results 
- */
-int AfStorageClientPrivate::execute(int function, QList<AfStorageEntry>& resultsList,const AfStorageEntry& templateEntry)
-{
-    TRAPD(errNo,
-    RPointerArray<CAfEntry> results;
-    CleanupResetAndDestroyPushL<CAfEntry>(results);
-    
-    CAfEntry *entry(const_cast<CAfEntry *>(templateEntry.data()));
-    if(0 == entry) {
-        entry = CAfEntry::NewLC();
-    }
-    mImplementation.executeL(function, results, *entry);
-    if(templateEntry.data() != entry) {
-        CleanupStack::PopAndDestroy(entry);
-    }
-    
-    //copy data
-    while (results.Count()) {
-        resultsList.append(AfStorageEntry(QSharedPointer<CAfEntry>(results[0])));
-        results.Remove(0);
-    }
-    CleanupStack::PopAndDestroy(&results);
-    )
-    return errNo;
-}
--- a/activityfw/storage/client/s60/src/afstorageclientimp.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,190 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <fbs.h>
-#include <s32mem.h>
-#include "afstorageclientimp.h"
-#include "afstorageglobals.h"
-#include "afglobals.h"
-#include "afentry.h"
-#include "afasyncrequest_p.h"
-#include "afthumbnailrequest_p.h"
-
-// -----------------------------------------------------------------------------
-/**
- * Furst phase constructor 
- */
-RAfStorageClientImplementation::RAfStorageClientImplementation(MAfAsyncRequestObserver &observer)
-:
-mObserver(observer)
-{}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor
- */
-RAfStorageClientImplementation::~RAfStorageClientImplementation()
-{
-    Close();
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::Close()
-{
-    mAsyncTasks.ResetAndDestroy();
-    RSessionBase::Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function establish connection to activity server
-  */
-void RAfStorageClientImplementation::connectL()
-{
-    const int asyncMessageSlots(12);
-    const int maxRetry(4);
-    TInt retry = maxRetry;
-    TInt errNo(KErrNone);
-    do {
-        errNo = CreateSession(KActivityServerName, 
-                              TVersion(0, 0, 0), 
-                              asyncMessageSlots);
-        if (KErrNotFound != errNo && KErrServerTerminated != errNo) {
-            retry =0;
-        } else {
-            TRAP(errNo, startServerL());
-            if (KErrNone != errNo && KErrAlreadyExists != errNo) {
-                retry =0;
-                errNo = CreateSession(KActivityServerName, 
-                                      TVersion(0, 0, 0), 
-                                      asyncMessageSlots);
-            }
-        }
-    } while (--retry > 0);
-    User::LeaveIfError(errNo);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::startServerL()
-{
-    RProcess server;
-    const TUidType uid(KNullUid, KNullUid, KActivityServerUid);
-    User::LeaveIfError(server.Create(KActivityServerName, KNullDesC, uid));
-    TRequestStatus stat;
-    server.Rendezvous(stat);
-    if (stat != KRequestPending) {
-        server.Kill(0);
-    } else {
-        server.Resume();
-    }
-    User::WaitForRequest(stat);
-    int errNo = (EExitPanic == server.ExitType()) ?
-                KErrGeneral : stat.Int();
-    if (KErrCancel == errNo) {
-        errNo = KErrNone;
-    }
-    server.Close();
-    User::LeaveIfError(errNo);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::executeL(int function)
-{
-    switch (function) {
-    case WaitActivity:
-    case NotifyChange:
-        CAfAsyncRequestPrivate::NewLD(mObserver, *this, static_cast<ActivityCmd>(function));
-        break;
-    default:
-        User::LeaveIfError(SendReceive(function, TIpcArgs()));
-    }
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::executeL(int function, 
-                                              const CAfEntry &entry,
-                                              int userData)
-{
-    TPckgBuf<TInt> data(userData);
-    RBuf8 serializedEntry;
-    CleanupClosePushL(serializedEntry);
-    serializedEntry.CreateL(entry.Size());
-    RDesWriteStream stream(serializedEntry);
-    CleanupClosePushL(stream);
-    stream << entry;
-    CleanupStack::PopAndDestroy(&stream);
-    User::LeaveIfError(SendReceive(function, TIpcArgs(&serializedEntry, &data)));
-    CleanupStack::PopAndDestroy(&serializedEntry);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::executeL(int function, RPointerArray<CAfEntry> &resultsList, const CAfEntry& templateEntry)
-{
-    resultsList.ResetAndDestroy();
-    RBuf8 buffer;
-    CleanupClosePushL(buffer);
-    CAfEntry::ReallocL(buffer, templateEntry.Size());
-    RDesWriteStream writer(buffer);
-    CleanupClosePushL(writer);
-    writer << templateEntry;
-    CleanupStack::PopAndDestroy(&writer);
-    TPckgBuf<int> length(0), taskId(0);
-    User::LeaveIfError(SendReceive(function,
-                                   TIpcArgs(&buffer, &length, &taskId)));
-    CAfEntry::ReallocL(buffer, length());
-    User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer)));
-    resultsList << buffer;
-    CleanupStack::PopAndDestroy(&buffer);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::getThumbnailL(TSize size, 
-                                                   const TDesC& source, 
-                                                   TAny *userData )
-{
-    CAfThumbnailRequestPrivate::NewLD(mObserver, *this, size, source, userData);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::PushL(CBase* asyncTask)
-{
-    const TInt offset(mAsyncTasks.Find(asyncTask));
-    (KErrNotFound == offset) ? mAsyncTasks.AppendL(asyncTask) : User::Leave(KErrAlreadyExists);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::Pop(CBase* asyncTask)
-{
-    const TInt offset(mAsyncTasks.Find(asyncTask));
-    if (KErrNotFound != offset) {
-        mAsyncTasks.Remove(offset);
-    }
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::sendAsync(int function, 
-                                              const TIpcArgs& args, 
-                                              TRequestStatus& status)
-{
-    SendReceive(function, args, status);
-}
-
-// -----------------------------------------------------------------------------
-void RAfStorageClientImplementation::getDataL(int id, TDes8& buffer)
-{
-    TPckgBuf<int> requestId(id);
-    SendReceive(GetData, TIpcArgs(&requestId, &buffer));
-}
--- a/activityfw/storage/client/s60/src/afthumbnailrequest_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <fbs.h>
-#include <XQConversions>
-
-#include "afthumbnailrequest_p.h"
-#include "afstorageclient_p.h"
-#include "afstorageclient.h"
-#include "afentry.h"
-
-// -----------------------------------------------------------------------------
-/**
- * Create and initialize handler for activity thumbnail request
- * @param observer - request completion observer
- * @param session - activity client implementation
- * @param source - thumbnail source location
- * @param userData - rsponse user data
- */
-void CAfThumbnailRequestPrivate::NewLD(MAfAsyncRequestObserver &observer, 
-                                       RAfStorageClientImplementation & session,
-                                       TSize resolution, 
-                                       const TDesC& source,
-                                       TAny* userData)
-{
-    CAfThumbnailRequestPrivate* self = new(ELeave)CAfThumbnailRequestPrivate(observer, session, userData);
-    CleanupStack::PushL(self);
-    self->ConstructL(resolution, source);
-    session.PushL(self);
-    CleanupStack::Pop(self);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor
- * @param observer - request completion observer
- * @param session - activity client implementation
- * @param userData - rsponse user data
- */
-CAfThumbnailRequestPrivate::CAfThumbnailRequestPrivate(MAfAsyncRequestObserver & observer, 
-                                                       RAfStorageClientImplementation & session,
-                                                       TAny* userData)
-:
-CActive(EPriorityStandard),
-mObserver(observer),
-mSession(session),
-mUserData(userData)
-{
-    CActiveScheduler::Add(this);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Second phase constructor
- * @param resolution - requested thumbnail resolution
- * @param source - thumbnail source location
- */
-void CAfThumbnailRequestPrivate::ConstructL(TSize resolution, const TDesC& source)
-{
-    mIds[0] = resolution.iWidth;
-    mIds[1] = resolution.iHeight;
-    CAfEntry::CopyL(mImgSrc, source);
-    mSession.sendAsync(GetThumbnail, 
-                       TIpcArgs(&mIds[0],&mIds[1], &mImgSrc),
-                       iStatus);
-    SetActive();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destuctor
- */
-CAfThumbnailRequestPrivate::~CAfThumbnailRequestPrivate()
-{
-    Cancel();
-    mImgSrc.Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Cancel pending requst
- */
-void CAfThumbnailRequestPrivate::DoCancel()
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function handle request completion, copy data, forward information and destroy handler 
- */
-void CAfThumbnailRequestPrivate::RunL()
-{
-    User::LeaveIfError(iStatus.Int());
-    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
-    CleanupStack::PushL(bitmap);
-    User::LeaveIfError(bitmap->Duplicate(mIds[0]()));
-    mObserver.asyncRequestCompleated(iStatus.Int(), 
-                                     GetThumbnail, 
-                                     QPixmap::fromSymbianCFbsBitmap(bitmap), 
-                                     mUserData);
-    CleanupStack::PopAndDestroy(bitmap);
-    mSession.Pop(this);
-    delete this;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Function handle request processing errors
- * @param error - error code 
- */
-TInt CAfThumbnailRequestPrivate::RunError(TInt error)
-{
-    mObserver.asyncRequestCompleated(error, GetThumbnail, QPixmap(), mUserData);
-    mSession.Pop(this);
-    delete this;
-    return KErrNone;
-}
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/src/afasyncrequest_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "afasyncrequest_p.h"
+#include "afstorageclient_p.h"
+#include "afstorageclient.h"
+#include "afentry.h"
+
+#include <fbs.h>
+
+// -----------------------------------------------------------------------------
+/**
+ * Create and initialize handler for anyc. activity requests
+ * @param observer - request completion observer
+ * @param session - activity client implementation
+ * @param cmd - requested functionality
+ */
+void CAfAsyncRequestPrivate::NewLD(MAfAsyncRequestObserver &observer, 
+                                   MAfAsyncSession & session,
+                                   ActivityCmd cmd)
+{
+    CAfAsyncRequestPrivate* self = new(ELeave)CAfAsyncRequestPrivate(observer, session, cmd);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    session.PushL(self);
+    CleanupStack::Pop(self);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * First phase construction
+ * @param observer - request completion observer
+ * @param session - activity client implementation
+ * @param cmd - requested functionality
+ */
+CAfAsyncRequestPrivate::CAfAsyncRequestPrivate(MAfAsyncRequestObserver & observer, 
+                                               MAfAsyncSession & session,
+                                               ActivityCmd cmd)
+:
+CActive(EPriorityStandard),
+mObserver(observer),
+mSession(session),
+mCmd(cmd)
+{
+    CActiveScheduler::Add(this);
+    RProcess process;
+    mIds[0] = static_cast<TInt>(process.SecureId().iId);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Second phase construction
+ */
+void CAfAsyncRequestPrivate::ConstructL()
+{
+    mSession.sendAsync(mCmd, 
+                       TIpcArgs(&mIds[0],&mIds[1], &mIds[2], &mIds[3]),
+                       iStatus);
+    SetActive();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destructor
+ */
+CAfAsyncRequestPrivate::~CAfAsyncRequestPrivate()
+{
+    Cancel();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Cancel pending requst
+ */
+void CAfAsyncRequestPrivate::DoCancel()
+{
+    TRAP_IGNORE(
+    switch (mCmd) {
+    case WaitActivity: mSession.executeL(CancelWait); break;
+    case NotifyChange: mSession.executeL(CancelNotify); break;
+    }
+    )
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function handle request completion, copy data, forward information and destroy handler 
+ */
+void CAfAsyncRequestPrivate::RunL()
+{
+    User::LeaveIfError(iStatus.Int());
+    switch (mCmd) {
+    case WaitActivity:
+        {
+        RBuf8 data;
+        CleanupClosePushL(data);
+        CAfEntry::ReallocL(data, (mIds[0])());
+        mSession.getDataL((mIds[3])(), data);
+        mObserver.waitActivityRequestCompleted(iStatus.Int(), data);
+        CleanupStack::PopAndDestroy(&data);
+        break;
+        }
+    case NotifyChange:
+        mObserver.dataChangeNotificationCompleted(iStatus.Int());
+        break;
+    }
+    mSession.Pop(this);
+    delete this;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function handle request processing errors
+ * @param error - error code 
+ */
+TInt CAfAsyncRequestPrivate::RunError(TInt error)
+{
+    (WaitActivity == mCmd) ? mObserver.waitActivityRequestCompleted(error, KNullDesC8()) :
+                             mObserver.dataChangeNotificationCompleted(error);
+    mSession.Pop(this);
+    delete this;
+    return KErrNone;
+}
+
+
--- a/activityfw/storage/client/src/afstorageclient.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/client/src/afstorageclient.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -15,121 +15,99 @@
 *
 */
 #include "afstorageclient.h"
+
+#include <e32debug.h>
+
 #include "afstorageclient_p.h"
+#include "afcmd.h"
 
 // -----------------------------------------------------------------------------
 /**
- * Constructor
+ * Two-phase constructor. Create and initialize instance
+ * @return entry instance
  */
-AfStorageClient::AfStorageClient(QObject *obj)
-:
-QObject(obj),
-d_ptr(0)
+EXPORT_C CAfStorageClient *CAfStorageClient::NewL(MAfAsyncRequestObserver &observer)
 {
-    d_ptr = new AfStorageClientPrivate(*this);
+    CAfStorageClient *self = CAfStorageClient::NewLC(observer);
+    CleanupStack::Pop(self);
+    return self;
 }
 
 // -----------------------------------------------------------------------------
 /**
+ * Two-phase constructor. Create, initialize and push instance into cleanup stack
+ * @return entry instance
+ */
+EXPORT_C CAfStorageClient *CAfStorageClient::NewLC(MAfAsyncRequestObserver &observer)
+{
+    CAfStorageClient *self = new (ELeave) CAfStorageClient();
+    CleanupStack::PushL(self);
+    self->ConstructL(observer);
+    return self;
+}    
+
+// -----------------------------------------------------------------------------
+/**
  * Destructor
  */
-AfStorageClient::~AfStorageClient()
+EXPORT_C CAfStorageClient::~CAfStorageClient()
 {
     delete d_ptr;
 }
-
+    
 // -----------------------------------------------------------------------------
 /**
- * Establish connection with activity server
- * @return 0 on succees, error code otherwise
+ * Constructor
  */
-int AfStorageClient::connect()
+CAfStorageClient::CAfStorageClient()
 {
-    return d_ptr->connect();
 }
 
 // -----------------------------------------------------------------------------
 /**
- * Interface implementation.
- * @see int MAfAsyncRequestObserver::asyncRequestCompleated(int, int, const QString&)
- */
-void AfStorageClient::asyncRequestCompleated(int result,
-                                             int requestType, 
-                                             const QString& data)
-{
-    switch (requestType) {
-    case WaitActivity:
-        if (KErrCancel != result) {
-            waitActivity();
-        }            
-        if (KErrNone == result) {
-            emit activityRequested(data);
-        }
-        
-        break;
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int MAfAsyncRequestObserver::asyncRequestCompleated(int, int, QPixmap&, void*)
+ * 2nd phase of construction
  */
-void AfStorageClient::asyncRequestCompleated(int result,
-                                             int requestType, 
-                                             const QPixmap& pixmap,
-                                             void* userData)
+void CAfStorageClient::ConstructL(MAfAsyncRequestObserver &observer)
 {
-    switch (requestType) {
-    case GetThumbnail:
-        emit thumbnailRequested(0 == result ? pixmap : QPixmap(), 
-                                userData);
-        break;
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Interface implementation.
- * @see int MAfAsyncRequestObserver::asyncRequestCompleated(int, int)
- */
-void AfStorageClient::asyncRequestCompleated(int result,int requestType)
-{
-    switch(requestType) {
-    case NotifyChange:
-        if (KErrCancel != result) {
-            notifyDataChange();
-        }
-        if (KErrNone == result) {
-            emit dataChanged();
-        }
-        break;
-    }
+    d_ptr = CAfStorageClientPrivate::NewL(observer);
 }
 
 // -----------------------------------------------------------------------------
 /**
  * Function add new activity
  * @param entry - activity entry data structure
- * @param imageSource - source for activity thumbnail
+ * @param imageHandle - handle for activity thumbnail
  * @return 0 on success, error code otherwise
  */
-int AfStorageClient::addActivity(const AfStorageEntry &entry, const QPixmap &imageSource)
+EXPORT_C int CAfStorageClient::addActivity(const CAfEntry &entry, TInt imageHandle)
 {
-    return d_ptr->addActivity(entry, imageSource);
+    RDebug::Print(_L("This method is deprecated, please use CAfStorageClient::saveActivity instead"));
+    return d_ptr->addActivity(entry, imageHandle);
 }
 
 // -----------------------------------------------------------------------------
 /**
  * Function update existing activity
  * @param entry - activity entry data structure
- * @param imageSource - source for activity thumbnail
+ * @param imageHandle - handle for activity thumbnail
  * @return 0 on success, error code otherwise
  */
-int AfStorageClient::updateActivity(const AfStorageEntry &entry, 
-                                    const QPixmap &imageSource)
+EXPORT_C int CAfStorageClient::updateActivity(const CAfEntry &entry, TInt imageHandle)
 {
-    return d_ptr->updateActivity(entry, imageSource);
+    RDebug::Print(_L("This method is deprecated, please use CAfStorageClient::saveActivity instead"));
+    return d_ptr->updateActivity(entry, imageHandle);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function save an activity (add new one or update existing one)
+ * @param entry - activity entry data structure
+ * @param imageHandle - handle for activity thumbnail
+ * @return 0 on success, error code otherwise
+ */
+EXPORT_C int CAfStorageClient::saveActivity(const CAfEntry &entry, TInt imageHandle)
+{    
+    return d_ptr->saveActivity(entry, imageHandle);
 }
 
 // -----------------------------------------------------------------------------
@@ -138,7 +116,7 @@
  * @param entry - activity entry template
   * @return 0 on success, error code otherwise
  */
-int AfStorageClient::removeActivity(const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::removeActivity(const CAfEntry &entry)
 {
     return d_ptr->removeActivity(entry);
 }
@@ -149,7 +127,7 @@
  * @param entry - activity entry template
   * @return 0 on success, error code otherwise
  */
-int AfStorageClient::removeApplicationActivities(const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::removeApplicationActivities(const CAfEntry &entry)
 {
     return d_ptr->removeApplicationActivities(entry);
 }
@@ -160,7 +138,7 @@
  * @param dst - list of results
  * @return 0 on success, error code otherwise 
  */
-int AfStorageClient::activities(QList<AfStorageEntry> &dst)
+EXPORT_C int CAfStorageClient::activities(RPointerArray<CAfEntry> &dst)
 {
     return d_ptr->activities(dst);
 }
@@ -172,8 +150,7 @@
  * @param entry - activity template
  * @return 0 on success, error code otherwise 
  */
-int AfStorageClient::applicationActivities(QList<AfStorageEntry> &dst, 
-                                           const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::applicationActivities(RPointerArray<CAfEntry> &dst, const CAfEntry &entry)
 {
     return d_ptr->applicationActivities(dst, entry);
 }
@@ -185,7 +162,7 @@
  * @param entry - activity template
  * @return 0 on success, error code otherwise 
  */
-int AfStorageClient::activityData(AfStorageEntry &dst, const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::activityData(CAfEntry *&dst, const CAfEntry &entry)
 {
     return d_ptr->activityData(dst, entry);
 }
@@ -195,7 +172,7 @@
  * Function subscribe application for notyfication about requested activity changes
  * @return 0 on success, error code otherwise 
  */
-int AfStorageClient::waitActivity()
+EXPORT_C int CAfStorageClient::waitActivity()
 {
     return d_ptr->waitActivity();
 }
@@ -206,15 +183,15 @@
  * @param entry - activity template 
  * @return 0 on success, error code otherwise 
  */
-int AfStorageClient::launchActivity(const AfStorageEntry &entry)
+EXPORT_C int CAfStorageClient::launchActivity(const CAfEntry &entry)
 {
     return d_ptr->launchActivity(entry);
 }
 
 // -----------------------------------------------------------------------------
-int AfStorageClient::getThumbnail(QSize size, QString imagePath, void* userDdata)
+EXPORT_C int CAfStorageClient::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData)
 {
-    return d_ptr->getThumbnail(size, imagePath, userDdata);
+    return d_ptr->getThumbnail(size, imagePath, userData);
 }
 
 // -----------------------------------------------------------------------------
@@ -222,7 +199,7 @@
  * Function subscribe launcher for data model changes
  * @return 0 on success, error code otherwise 
  */
-int AfStorageClient::notifyDataChange()
+EXPORT_C int CAfStorageClient::notifyDataChange()
 {
-    return  d_ptr->notifyDataChange();
+    return d_ptr->notifyDataChange();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/src/afstorageclient_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,250 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "afstorageclient_p.h"
+
+#include <fbs.h>
+#include <s32mem.h>
+
+#include "afasyncrequest_p.h"
+#include "afstorageglobals.h"
+#include "afentry.h"
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create and initialize instance
+ * @return entry instance
+ */
+CAfStorageClientPrivate *CAfStorageClientPrivate::NewL(MAfAsyncRequestObserver &observer)
+{
+    CAfStorageClientPrivate *self = CAfStorageClientPrivate::NewLC(observer);
+    CleanupStack::Pop(self);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create, initialize and push instance into cleanup stack
+ * @return entry instance
+ */
+CAfStorageClientPrivate *CAfStorageClientPrivate::NewLC(MAfAsyncRequestObserver &observer)
+{
+    CAfStorageClientPrivate *self = new (ELeave) CAfStorageClientPrivate(observer);
+    CleanupStack::PushL(self);
+    self->ConstructL();
+    return self;
+}    
+
+// -----------------------------------------------------------------------------
+/**
+ * Destructor
+ */
+CAfStorageClientPrivate::~CAfStorageClientPrivate()
+{
+    mImplementation.Close();
+}
+    
+// -----------------------------------------------------------------------------
+/**
+ * Constructor
+ */
+CAfStorageClientPrivate::CAfStorageClientPrivate(MAfAsyncRequestObserver &observer) : mImplementation(observer)
+{
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * 2nd phase of construction
+ */
+void CAfStorageClientPrivate::ConstructL()
+{
+    mImplementation.connectL();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::addActivity(const CAfEntry &,const QPixmap&)
+ */
+int CAfStorageClientPrivate::addActivity(const CAfEntry &entry, TInt imageHandle)
+{
+    return execute(AddActivity, entry, imageHandle);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::updateActivity(const CAfEntry &,const QPixmap&)
+ */
+int CAfStorageClientPrivate::updateActivity(const CAfEntry &entry, TInt imageHandle)
+{
+    return execute(UpdateActivity, entry, imageHandle);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::saveActivity(const CAfEntry &,const QPixmap&)
+ */
+int CAfStorageClientPrivate::saveActivity(const CAfEntry &entry, TInt imageHandle)
+{
+    return execute(SaveActivity, entry, imageHandle);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::removeActivity(const CAfEntry &)
+ */
+int CAfStorageClientPrivate::removeActivity(const CAfEntry &entry)
+{
+    return execute(RemoveActivity, entry, -1);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::removeApplicationActivities(const CAfEntry &)
+ */
+int CAfStorageClientPrivate::removeApplicationActivities(const CAfEntry &entry)
+{
+    return execute(RemoveApplicationActivities, entry, -1);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::activities(RPointerArray<CAfEntry> &)
+ */
+int CAfStorageClientPrivate::activities(RPointerArray<CAfEntry> &results)
+{
+    CAfEntry *entry = CAfEntry::NewL();
+    TInt result = execute(Activities, results, *entry);
+    delete entry;
+    return result;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::applicationActivities(RPointerArray<CAfEntry> &, const CAfEntry &)
+ */
+int CAfStorageClientPrivate::applicationActivities(RPointerArray<CAfEntry> &results, const CAfEntry &templateEntry)
+{
+    return execute(ApplicationActivities, results, templateEntry);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::activityData(CAfEntry &, const CAfEntry &)
+ */
+int CAfStorageClientPrivate::activityData(CAfEntry *&resultEntry, const CAfEntry &templateEntry)
+{   
+    RPointerArray<CAfEntry> results;
+    int errNo(execute(ApplicationActivity, results, templateEntry));
+    if (KErrNone == errNo && results.Count() > 0) {
+        resultEntry = results[0];
+        results.Remove(0);
+    }
+    results.ResetAndDestroy();
+    return errNo;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::waitActivity()
+ */
+int CAfStorageClientPrivate::waitActivity()
+{
+    CAfEntry *entry = CAfEntry::NewL();
+    TInt result = execute(WaitActivity, *entry, -1);
+    delete entry;
+    return result;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData)
+ */
+int CAfStorageClientPrivate::getThumbnail(const TSize &size, const TDesC &imagePath, void *userData)
+{
+    TRAPD(errNo, mImplementation.getThumbnailL(size, imagePath, userData);)
+    return errNo;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::notifyDataChange()
+ */
+int CAfStorageClientPrivate::notifyDataChange()
+{
+    CAfEntry *entry = CAfEntry::NewL();
+    TInt result = execute(NotifyChange, *entry, -1);
+    delete entry;
+    return result;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function implementation
+ * @see AfStorageClient::launchActivity(const CAfEntry &)
+ */
+int CAfStorageClientPrivate::launchActivity(const CAfEntry &templateEntry)
+{
+    return execute(LaunchActivity, templateEntry, -1);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function execute activity framework functinality and return results 
+ */
+int CAfStorageClientPrivate::execute(int function, const CAfEntry &sourceEntry, TInt imageHandle)
+{
+    TRAPD(errNo,
+        switch (function) {
+        case AddActivity:
+        case UpdateActivity:
+        case SaveActivity:
+        case RemoveActivity:
+        case RemoveApplicationActivities:
+        case LaunchActivity:
+            mImplementation.executeL(function, sourceEntry, imageHandle);
+            break;
+        
+        case WaitActivity:
+        case NotifyChange:
+            mImplementation.executeL(function);
+            break;
+        default:
+            User::Leave(KErrArgument);
+        }
+    )
+    return errNo;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function execute activity framework functinality and return results 
+ */
+int CAfStorageClientPrivate::execute(int function, RPointerArray<CAfEntry>& resultsList,const CAfEntry& templateEntry)
+{
+    TRAPD(errNo, mImplementation.executeL(function, resultsList, templateEntry);)
+    return errNo;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/src/afstorageclientimp.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,192 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "afstorageclientimp.h"
+
+#include <fbs.h>
+#include <s32mem.h>
+
+#include "afstorageglobals.h"
+#include "afglobals.h"
+#include "afentry.h"
+#include "afasyncrequest_p.h"
+#include "afthumbnailrequest_p.h"
+
+// -----------------------------------------------------------------------------
+/**
+ * Furst phase constructor 
+ */
+RAfStorageClientImplementation::RAfStorageClientImplementation(MAfAsyncRequestObserver &observer)
+:
+mObserver(observer)
+{}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destructor
+ */
+RAfStorageClientImplementation::~RAfStorageClientImplementation()
+{
+    Close();
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::Close()
+{
+    mAsyncTasks.ResetAndDestroy();
+    RSessionBase::Close();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function establish connection to activity server
+  */
+void RAfStorageClientImplementation::connectL()
+{
+    const int asyncMessageSlots(12);
+    const int maxRetry(4);
+    TInt retry = maxRetry;
+    TInt errNo(KErrNone);
+    do {
+        errNo = CreateSession(KActivityServerName, 
+                              TVersion(0, 0, 0), 
+                              asyncMessageSlots);
+        if (KErrNotFound != errNo && KErrServerTerminated != errNo) {
+            retry =0;
+        } else {
+            TRAP(errNo, startServerL());
+            if (KErrNone != errNo && KErrAlreadyExists != errNo) {
+                retry =0;
+                errNo = CreateSession(KActivityServerName, 
+                                      TVersion(0, 0, 0), 
+                                      asyncMessageSlots);
+            }
+        }
+    } while (--retry > 0);
+    User::LeaveIfError(errNo);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::startServerL()
+{
+    RProcess server;
+    const TUidType uid(KNullUid, KNullUid, KActivityServerUid);
+    User::LeaveIfError(server.Create(KActivityServerName, KNullDesC, uid));
+    TRequestStatus stat;
+    server.Rendezvous(stat);
+    if (stat != KRequestPending) {
+        server.Kill(0);
+    } else {
+        server.Resume();
+    }
+    User::WaitForRequest(stat);
+    int errNo = (EExitPanic == server.ExitType()) ?
+                KErrGeneral : stat.Int();
+    if (KErrCancel == errNo) {
+        errNo = KErrNone;
+    }
+    server.Close();
+    User::LeaveIfError(errNo);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::executeL(int function)
+{
+    switch (function) {
+    case WaitActivity:
+    case NotifyChange:
+        CAfAsyncRequestPrivate::NewLD(mObserver, *this, static_cast<ActivityCmd>(function));
+        break;
+    default:
+        User::LeaveIfError(SendReceive(function, TIpcArgs()));
+    }
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::executeL(int function, 
+                                              const CAfEntry &entry,
+                                              int userData)
+{
+    TPckgBuf<TInt> data(userData);
+    RBuf8 serializedEntry;
+    CleanupClosePushL(serializedEntry);
+    serializedEntry.CreateL(entry.Size());
+    RDesWriteStream stream(serializedEntry);
+    CleanupClosePushL(stream);
+    stream << entry;
+    CleanupStack::PopAndDestroy(&stream);
+    User::LeaveIfError(SendReceive(function, TIpcArgs(&serializedEntry, &data)));
+    CleanupStack::PopAndDestroy(&serializedEntry);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::executeL(int function, RPointerArray<CAfEntry> &resultsList, const CAfEntry& templateEntry)
+{
+    resultsList.ResetAndDestroy();
+    RBuf8 buffer;
+    CleanupClosePushL(buffer);
+    CAfEntry::ReallocL(buffer, templateEntry.Size());
+    RDesWriteStream writer(buffer);
+    CleanupClosePushL(writer);
+    writer << templateEntry;
+    CleanupStack::PopAndDestroy(&writer);
+    TPckgBuf<int> length(0), taskId(0);
+    User::LeaveIfError(SendReceive(function,
+                                   TIpcArgs(&buffer, &length, &taskId)));
+    CAfEntry::ReallocL(buffer, length());
+    User::LeaveIfError(SendReceive(GetData, TIpcArgs(&taskId, &buffer)));
+    resultsList << buffer;
+    CleanupStack::PopAndDestroy(&buffer);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::getThumbnailL(TSize size, 
+                                                   const TDesC& source, 
+                                                   TAny *userData )
+{
+    CAfThumbnailRequestPrivate::NewLD(mObserver, *this, size, source, userData);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::PushL(CBase* asyncTask)
+{
+    const TInt offset(mAsyncTasks.Find(asyncTask));
+    (KErrNotFound == offset) ? mAsyncTasks.AppendL(asyncTask) : User::Leave(KErrAlreadyExists);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::Pop(CBase* asyncTask)
+{
+    const TInt offset(mAsyncTasks.Find(asyncTask));
+    if (KErrNotFound != offset) {
+        mAsyncTasks.Remove(offset);
+    }
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::sendAsync(int function, 
+                                              const TIpcArgs& args, 
+                                              TRequestStatus& status)
+{
+    SendReceive(function, args, status);
+}
+
+// -----------------------------------------------------------------------------
+void RAfStorageClientImplementation::getDataL(int id, TDes8& buffer)
+{
+    TPckgBuf<int> requestId(id);
+    SendReceive(GetData, TIpcArgs(&requestId, &buffer));
+}
--- a/activityfw/storage/client/src/afstorageentry.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this 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 "afstorageentry.h"
-#include "afentry.h"
-#include "afserializer.h"
-#include "afstorageglobals.h"
-// -----------------------------------------------------------------------------
-/**
- * Constructor. 
- * Initialize object with preallocated symbian specyfic data structure. Function doesn't copy content
- * @param data - pointer to symbian specyfic data structure
- */
-AfStorageEntry::AfStorageEntry(QSharedPointer<CAfEntry> data)
-:
-mData(data)
-{}
-
-// -----------------------------------------------------------------------------
-/**
-* Constructor
-* Initialize object with preallocated data structure. Function doesn't copy content
-* @param data - activity data structure
-*/
-AfStorageEntry::AfStorageEntry(const AfStorageEntry &data)
-:
-    mData(data.mData)
-{}
-
-// -----------------------------------------------------------------------------
-/**
- * Constructor
- * Initialize object with data. Function do deep copy of data
- * @param appId - unique application identifier
- * @param actId - activity identifier
- * @param privateData - private part of activity data
- * @param publicData - public part of activity data
- */
-AfStorageEntry::AfStorageEntry(int appId, 
-                               const QString &actId, 
-                               const QVariant &privateData, 
-                               const QVariantHash& publicData)
-:
-    mData(0)
-{
-    int flags(0);
-    QVariantHash privData;
-    privData.insert(ActivityDataKeyword, privateData);
-    RBuf8 privateBuff, publicBuff;
-    CleanupClosePushL(privateBuff);
-    CleanupClosePushL(publicBuff);
-    privateBuff << privData;
-    publicBuff << publicData;
-    
-    if (publicData.end() != publicData.find(ActivityPersistence) && 
-        publicData[ActivityPersistence].toBool()) {
-        flags |= CAfEntry::Persistent;
-    }
-    
-    if (publicData.end() != publicData.find(ActivityVisibility) && 
-        !publicData[ActivityVisibility].toBool()) {
-        flags |= CAfEntry::Invisible;
-    }
-    
-    HBufC *actBuff = XQConversions::qStringToS60Desc(actId);
-    CleanupStack::PushL(actBuff);
-    mData = QSharedPointer<CAfEntry>(CAfEntry::NewL(flags, 
-                                                    appId, 
-                                                    *actBuff, 
-                                                    KNullDesC, 
-                                                    privateBuff, 
-                                                    publicBuff));
-    CleanupStack::PopAndDestroy(actBuff);
-    CleanupStack::PopAndDestroy(&publicBuff);
-    CleanupStack::PopAndDestroy(&privateBuff);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve S60 structure representation
- */
-const CAfEntry* AfStorageEntry::data() const
-{
-    return mData.data();
-}
- 
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve activity flags
- * @return activity flags
- */
-int AfStorageEntry::flags() const
-{
-    return mData->Flags();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve application unique identifier
- * @return application identifier
- */
-int AfStorageEntry::applicationId() const
-{
-    return mData->ApplicationId();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve activity identifier. Identyfier is unique for each application 
- * @return activity identifier
- */
-QString AfStorageEntry::activityId() const
-{
-    return XQConversions::s60DescToQString(mData->ActivityId());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve path to activity thumbanil path 
- * @return thumbail loacation path
- */
-QString AfStorageEntry::imageSrc() const
-{
-    return XQConversions::s60DescToQString(mData->ImageSrc());
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve public part of activity data 
- * @return public activity data
- */
-QVariantHash AfStorageEntry::publicData() const
-{
-    QVariantHash deserializedData;
-    deserializedData << mData->Data(CAfEntry::Public);
-    deserializedData.insert(ActivityApplicationKeyword, applicationId());
-    deserializedData.insert(ActivityActivityKeyword, activityId());
-    deserializedData.insert(ActivityScreenshotKeyword, imageSrc());
-    deserializedData.insert(ActivityPersistence, (flags() & CAfEntry::Persistent) ? true : false);
-    deserializedData.insert(ActivityVisibility, (flags() & CAfEntry::Invisible) ? false : true);
-    return deserializedData;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Retrieve private part of activity data 
- * @return private activity data
- */
-QVariant AfStorageEntry::privateData() const
-{
-    QVariantHash deserializedData;
-    deserializedData << mData->Data(CAfEntry::Private);
-    return deserializedData[ActivityDataKeyword];
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/client/src/afthumbnailrequest_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,131 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <fbs.h>
+
+#include "afthumbnailrequest_p.h"
+#include "afstorageclient_p.h"
+#include "afstorageclient.h"
+#include "afentry.h"
+#include "afcmd.h"
+
+// -----------------------------------------------------------------------------
+/**
+ * Create and initialize handler for activity thumbnail request
+ * @param observer - request completion observer
+ * @param session - activity client implementation
+ * @param source - thumbnail source location
+ * @param userData - rsponse user data
+ */
+void CAfThumbnailRequestPrivate::NewLD(MAfAsyncRequestObserver &observer, 
+                                       MAfAsyncSession & session,
+                                       TSize resolution, 
+                                       const TDesC& source,
+                                       TAny* userData)
+{
+    CAfThumbnailRequestPrivate* self = new(ELeave)CAfThumbnailRequestPrivate(observer, session, userData);
+    CleanupStack::PushL(self);
+    self->ConstructL(resolution, source);
+    session.PushL(self);
+    CleanupStack::Pop(self);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Constructor
+ * @param observer - request completion observer
+ * @param session - activity client implementation
+ * @param userData - rsponse user data
+ */
+CAfThumbnailRequestPrivate::CAfThumbnailRequestPrivate(MAfAsyncRequestObserver & observer, 
+                                                       MAfAsyncSession & session,
+                                                       TAny* userData)
+:
+CActive(EPriorityStandard),
+mObserver(observer),
+mSession(session),
+mUserData(userData)
+{
+    CActiveScheduler::Add(this);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Second phase constructor
+ * @param resolution - requested thumbnail resolution
+ * @param source - thumbnail source location
+ */
+void CAfThumbnailRequestPrivate::ConstructL(TSize resolution, const TDesC& source)
+{
+    mIds[0] = resolution.iWidth;
+    mIds[1] = resolution.iHeight;
+    CAfEntry::CopyL(mImgSrc, source);
+    mSession.sendAsync(GetThumbnail, 
+                       TIpcArgs(&mIds[0],&mIds[1], &mImgSrc),
+                       iStatus);
+    SetActive();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destuctor
+ */
+CAfThumbnailRequestPrivate::~CAfThumbnailRequestPrivate()
+{
+    Cancel();
+    mImgSrc.Close();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Cancel pending requst
+ */
+void CAfThumbnailRequestPrivate::DoCancel()
+{
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function handle request completion, copy data, forward information and destroy handler 
+ */
+void CAfThumbnailRequestPrivate::RunL()
+{
+    User::LeaveIfError(iStatus.Int());
+    mObserver.getThumbnailRequestCompleted(iStatus.Int(), 
+                                           mIds[0](), 
+                                           mUserData);
+    RBuf8 data;                                        
+    CleanupClosePushL(data);
+    mSession.getDataL((mIds[1])(), data);
+    CleanupStack::PopAndDestroy(&data);
+    mSession.Pop(this);
+    delete this;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Function handle request processing errors
+ * @param error - error code 
+ */
+TInt CAfThumbnailRequestPrivate::RunError(TInt error)
+{
+    mObserver.getThumbnailRequestCompleted(error, -1, mUserData);
+    mSession.Pop(this);
+    delete this;
+    return KErrNone;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/common.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,19 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = subdirs
+
+BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/group/bld.inf	Wed Aug 18 10:05:49 2010 +0300
@@ -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:
+*
+*/
+PRJ_PLATFORMS
+DEFAULT
+
+PRJ_MMPFILES
+common.mmp
+
+PRJ_EXPORTS
+../inc/afcmd.h |../../inc/afcmd.h
+../inc/afglobals.h |../../inc/afglobals.h
+
+// afentry have to be exported also to activityfw, because of dependecies 
+// in afstorageentry.h exported from client.
+../inc/afentry.h |../../inc/afentry.h
+../inc/afentry.h |../../../inc/afentry.h
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/group/common.mmp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+TARGET      afstoragecommon.lib
+TARGETTYPE  LIB
+
+UID         0x20026783
+SECUREID    0x20026783
+
+MW_LAYER_SYSTEMINCLUDE 
+
+USERINCLUDE ../inc
+
+SOURCEPATH  ../src
+SOURCE      afentry.cpp
+
+#ifdef ENABLE_ABIV2_MODE
+DEBUGGABLE_UDEBONLY
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/inc/afcmd.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#ifndef AFCMD_H
+#define AFCMD_H
+
+const TInt KRequestAppIdOffset(0);
+const TInt KRequestActOffset(1);
+const TInt KRequestData(2);
+const TInt KRequestIdOffset(0);
+
+const TInt KResponseDataSizeOffset(0);
+const TInt KResponseIdOffset(3);
+const TInt KResponseDataOffset(1);
+
+
+enum ActivityCmd {
+    AddActivity =0,
+    UpdateActivity,
+    RemoveActivity,
+    RemoveApplicationActivities,
+    Activities,
+    ApplicationActivities,
+    ApplicationActivity,
+    WaitActivity,
+    LaunchActivity,
+    GetThumbnail,
+    GetData,
+    NotifyChange,
+    CancelWait,
+    CancelNotify,
+    SaveActivity
+};
+
+#endif  //AFCMD_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/inc/afentry.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFENTRYDATA_H
+#define AFENTRYDATA_H
+
+#include <e32base.h>
+#include <s32strm.h>
+class RDbColWriteStream;
+class RDbColReadStream;
+const TInt KAfMask(0x0001);
+
+#ifdef AF_ADD_MASK
+#undef AF_ADD_MASK
+#endif
+#define AF_ADD_MASK(n) (KAfMask << n)
+
+class CAfEntry: public CBase
+{
+public:
+    enum AccessRights {
+    Private =0,
+    Public
+    };
+
+    enum Flags {
+    Invisible = KAfMask,
+    Persistent = 0x40000000,
+    };
+
+public:
+    static CAfEntry* NewL();
+
+    static CAfEntry* NewLC();
+
+    static CAfEntry* NewL(TInt flags,
+                          TInt applicationId,
+                          const TDesC &activityId,
+                          const TDesC &imgSrc,
+                          const TDesC8 &privateData,
+                          const TDesC8 &publicData);
+
+    static CAfEntry* NewLC(TInt flags,
+                           TInt applicationId,
+                           const TDesC &activityId,
+                           const TDesC &imgSrc,
+                           const TDesC8 &privateData,
+                           const TDesC8 &publicData);
+    
+    static CAfEntry* NewLC(const RMessage2& msg,
+                           int offset =0);
+
+    ~CAfEntry();
+
+    TInt Size() const;
+
+    TInt DataSize() const;
+
+    void ExternalizeL(RWriteStream &stream) const;
+
+    void InternalizeL(RReadStream &stream);
+
+    void ExternalizeDataOnlyL(RWriteStream &stream) const;
+
+    void InternalizeDataOnlyL(RReadStream &stream);
+
+    TInt Flags() const;
+
+    TInt ApplicationId() const;
+
+    const TDesC& ActivityId() const;
+
+    const TDesC& ImageSrc() const;
+
+    void SetImageSrcL(const TDesC& src);
+
+    const TDesC8& Data(CAfEntry::AccessRights rights) const;
+
+    void SetDataL(const TDesC8& src, CAfEntry::AccessRights rights);
+
+    static void ReallocL(RBuf8 &dst,TInt length);
+
+    static void ReallocL(RBuf &dst,TInt length);
+
+    static void CopyL(RBuf8 &dst,const TDesC8 &src);
+
+    static void CopyL(RBuf &dst,const TDesC &src);
+
+private:
+    CAfEntry();
+
+    void ConstructL(TInt flags,
+                    TInt applicationId,
+                    const TDesC &activityId,
+                    const TDesC &imgSrc,
+                    const TDesC8 &privateData,
+                    const TDesC8 &publicData);
+
+    static void InternalizeL(RBuf8 &dst, RReadStream &src);
+
+    static void InternalizeL(RBuf &dst, RReadStream &src);
+
+    static void ExternalizeL(RWriteStream &dst,const TDesC8 & src);
+
+    static void ExternalizeL(RWriteStream &dst,const TDesC& src);
+private:
+    TInt mFlags;
+    TInt mAppId;
+    RBuf mActivityId;
+    RBuf mImgSrc;
+    RBuf8 mPrivateData;
+    RBuf8 mPublicData;
+
+};
+
+RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src);
+
+RBuf8& operator << (RBuf8 &dst, const RPointerArray<CAfEntry>& src);
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/inc/afglobals.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,24 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFGLOBALS_H
+#define AFGLOBALS_H
+
+#include <e32base.h>
+const TUid KActivityServerUid = {0x200267B4};
+_LIT(KActivityServerName, "hsactivitydbserver");
+
+#endif //AFGLOBALS_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/common/src/afentry.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,461 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "afentry.h"
+#include <s32mem.h>
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create and initialize instance
+ * @return entry instance
+ */
+CAfEntry* CAfEntry::NewL()
+{
+    CAfEntry *self = CAfEntry::NewLC();
+    CleanupStack::Pop(self);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create, initialize and push instance into cleanup stack
+ * @return entry instance
+ */
+CAfEntry* CAfEntry::NewLC()
+{
+    CAfEntry *self = new (ELeave)CAfEntry();
+    CleanupStack::PushL(self);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create and initialize instance
+ * @param flags - entry flags
+ * @param applicationId - application unique identifier
+ * @param activityId - activity unique identifier
+ * @param imgSrc - thumbanail source
+ * @param privateData - privated application data
+ * @param publicData - public activity data
+ * @return entry instance
+ */
+CAfEntry* CAfEntry::NewL(TInt flags,
+                         TInt applicationId,
+                         const TDesC &activityId,
+                         const TDesC &imgSrc,
+                         const TDesC8 &privateData,
+                         const TDesC8 &publicData)
+{
+    CAfEntry* self = CAfEntry::NewLC(flags, 
+                                     applicationId, 
+                                     activityId, 
+                                     imgSrc, 
+                                     privateData, 
+                                     publicData);
+    CleanupStack::Pop(self);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Two-phase constructor. Create, initialize and push instance into cleanup stack
+ * @param flags - entry flags
+ * @param applicationId - application unique identifier
+ * @param activityId - activity unique identifier
+ * @param imgSrc - thumbanail source
+ * @param privateData - privated application data
+ * @param publicData - public activity data
+ * @return entry instance
+ */
+CAfEntry* CAfEntry::NewLC(TInt flags,
+                          TInt applicationId,
+                          const TDesC &activityId,
+                          const TDesC &imgSrc,
+                          const TDesC8 &privateData,
+                          const TDesC8 &publicData)
+{
+    CAfEntry *self = CAfEntry::NewLC();
+    self->ConstructL(flags, 
+                     applicationId, 
+                     activityId, 
+                     imgSrc, 
+                     privateData, 
+                     publicData);
+    return self;
+}
+
+// -----------------------------------------------------------------------------
+CAfEntry* CAfEntry::NewLC(const RMessage2& msg, int offset)
+{
+    CAfEntry* self = CAfEntry::NewLC();
+    RBuf8 serializedEntry;
+    CleanupClosePushL(serializedEntry);
+    ReallocL(serializedEntry, msg.GetDesMaxLength(offset));
+    msg.ReadL(offset, serializedEntry);
+    RDesReadStream entryReader(serializedEntry);
+    CleanupClosePushL(entryReader);
+    entryReader >> (*self);
+    CleanupStack::PopAndDestroy(&entryReader);
+    CleanupStack::PopAndDestroy(&serializedEntry);
+    return self;
+}
+// -----------------------------------------------------------------------------
+/**
+ * First phase constructor
+ */
+CAfEntry::CAfEntry()
+{
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Second phase constructor. Initialize instance
+ * @param flags - entry flags
+ * @param applicationId - application unique identifier
+ * @param activityId - activity unique identifier
+ * @param imgSrc - thumbanail source
+ * @param privateData - privated application data
+ * @param publicData - public activity data 
+ */
+void CAfEntry::ConstructL(TInt flags,
+                          TInt applicationId,
+                          const TDesC &activityId,
+                          const TDesC &imgSrc,
+                          const TDesC8 &privateData,
+                          const TDesC8 &publicData)
+{
+    mFlags = flags;
+    mAppId = applicationId;
+    CopyL(mActivityId, activityId);
+    CopyL(mImgSrc, imgSrc);
+    CopyL(mPrivateData, privateData);
+    CopyL(mPublicData, publicData);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Destructor. Release allocated resources 
+ */
+CAfEntry::~CAfEntry()
+{
+    mActivityId.Close();
+    mPrivateData.Close();
+    mPublicData.Close();
+    mImgSrc.Close();
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide size of serialized entry
+ * @return size of serialized entry instance
+ */
+TInt CAfEntry::Size() const
+{
+    return (sizeof(TInt) * 3) + //flags + appId + actId size info 
+           mActivityId.Size() + //actId content size
+           DataSize(); //data size
+           
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide size of serialized entry
+ * @return size of serialized entry instance
+ */
+TInt CAfEntry::DataSize() const
+{
+    return (sizeof(TInt) * 3) + //privData size info + pubData size info + imgSrc size info
+            mImgSrc.Size() + //imgSize content size
+            mPrivateData.Size() + //privData content size
+            mPublicData.Size(); //pubData content size 
+}
+// -----------------------------------------------------------------------------
+/**
+ * Serialize entry content into output stream.
+ * @param stream - output stream
+ */
+void CAfEntry::ExternalizeL(RWriteStream &stream) const
+{
+    stream.WriteInt32L(mFlags);
+    stream.WriteInt32L(mAppId);
+    ExternalizeL(stream, mActivityId);
+    ExternalizeDataOnlyL(stream);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Deserialize entry content from input stream
+ * @param stream - input stream
+ */
+void CAfEntry::InternalizeL(RReadStream &stream)
+{
+    mFlags = stream.ReadInt32L();
+    mAppId = stream.ReadInt32L();
+    InternalizeL(mActivityId, stream);
+    InternalizeDataOnlyL(stream);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Serialize entry content into output stream.
+ * @param stream - output stream
+ */
+void CAfEntry::ExternalizeDataOnlyL(RWriteStream &stream) const
+{
+    ExternalizeL(stream, mImgSrc);
+    ExternalizeL(stream, mPrivateData);
+    ExternalizeL(stream, mPublicData);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Deserialize entry content from input stream
+ * @param stream - input stream
+ */
+void CAfEntry::InternalizeDataOnlyL(RReadStream &stream)
+{
+    
+    InternalizeL(mImgSrc, stream);
+    InternalizeL(mPrivateData, stream);
+    InternalizeL(mPublicData, stream);
+    
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity flags
+ * @return activity flags 
+ */
+TInt CAfEntry::Flags() const
+{
+    return mFlags;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity identifier.
+ * @return activity identifier
+ */
+TInt CAfEntry::ApplicationId() const
+{
+    return mAppId;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity identifier.
+ * @return activity identifier
+ */
+const TDesC& CAfEntry::ActivityId() const
+{
+    return mActivityId;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity data.
+ * @param rights - type of requested data
+ * @return activity data
+ */
+const TDesC8& CAfEntry::Data(CAfEntry::AccessRights rights) const
+{
+    return Private == rights ? mPrivateData : mPublicData;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity data.
+ * @param rights - type of requested data
+ * @return activity data
+ */
+void CAfEntry::SetDataL(const TDesC8& src, CAfEntry::AccessRights rights)
+{
+    CopyL(Private == rights ? mPrivateData : mPublicData, src);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Provide access to activity thumbail path
+ * @return path to activity thumbnail 
+ */
+const TDesC& CAfEntry::ImageSrc() const
+{
+    return mImgSrc;
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Set new value of image source
+ */
+void CAfEntry::SetImageSrcL(const TDesC& src)
+{
+    CopyL(mImgSrc, src);
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Reallocate blob buffer to requested size
+ * @param dst - destination buffer
+ * @param length - requested length
+ */
+void CAfEntry::ReallocL(RBuf8 &dst,TInt length)
+{
+    if (0 < length) {
+        if (dst.MaxLength() < length) {
+            dst.ReAllocL(length);
+        }
+    } else {
+        dst.Close();
+    }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Reallocate text buffer to requested size
+ * @param dst - destination buffer
+ * @param length - requested length
+ */
+void CAfEntry::ReallocL(RBuf &dst,TInt length)
+{
+    if (0 < length) {
+        if (dst.MaxLength() < length) {
+            dst.ReAllocL(length);
+        }
+    } else {
+        dst.Close();
+    }
+}
+// -----------------------------------------------------------------------------
+/**
+ * Copy blob content from input stream
+ * @param dst - destination buffer
+ * @param src - source buffer
+ */
+void CAfEntry::CopyL(RBuf8 &dst,const TDesC8 &src)
+{
+    ReallocL(dst, src.Length());
+    if(0 < src.Length()) {
+        dst.Copy(src);
+    }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Copy text content from input buffer
+ * @param dst - destination buffer
+ * @param src - source buffer
+ */
+void CAfEntry::CopyL(RBuf &dst,const TDesC &src)
+{
+    ReallocL(dst, src.Length());
+    if(0 < src.Length()) {
+        dst.Copy(src);
+    }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Deserialize blob content from input stream
+ * @param dst - destination buffer
+ * @param src - input stream
+ */
+void CAfEntry::InternalizeL(RBuf8 &dst, RReadStream &src)
+{
+    const TInt length(src.ReadInt32L());
+    ReallocL(dst, length);
+    if (0 < length) {
+        src.ReadL(dst, length);
+    }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Deserialize text content from input stream
+ * @param dst - destination buffer
+ * @param src - input stream
+ */
+void CAfEntry::InternalizeL(RBuf &dst, RReadStream &src)
+{
+    const TInt length(src.ReadInt32L());
+    ReallocL(dst, length);
+    if (0 < length) {
+        src.ReadL(dst, length);
+    }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Serialize blob content into output stream
+ * @param dst - destination stream
+ * @param src - input buffer
+ */
+void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC8 & src)
+{
+    dst.WriteInt32L(src.Length());
+    if (src.Length()) {
+        dst.WriteL(src, src.Length());
+    }
+}
+
+// -----------------------------------------------------------------------------
+/**
+ * Serialize text content into output stream
+ * @param dst - destination stream
+ * @param src - input buffer
+ */
+void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC& src)
+{
+    dst.WriteInt32L(src.Length());
+    if (src.Length()) {
+        dst.WriteL(src, src.Length());
+    }
+}
+
+// -----------------------------------------------------------------------------
+RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src)
+{
+    dst.ResetAndDestroy();
+    RDesReadStream srcStream(src);
+    CleanupClosePushL(srcStream);
+    int numOfItems(srcStream.ReadInt32L());
+    for (int i(0); i < numOfItems; ++i) {
+        CAfEntry *entry = CAfEntry::NewLC();
+        srcStream >> (*entry);
+        dst.AppendL(entry);
+        CleanupStack::Pop(entry);
+    }
+    CleanupStack::PopAndDestroy(&srcStream);
+    return dst;
+}
+
+// -----------------------------------------------------------------------------
+RBuf8& operator <<(RBuf8 &dst, const RPointerArray<CAfEntry>& src)
+{
+    int iter(0), 
+        requiredSize(sizeof(int));
+    for(iter =0; iter< src.Count(); ++iter) {
+        requiredSize += src[iter]->Size();
+    }
+    CAfEntry::ReallocL(dst, requiredSize);
+    RDesWriteStream dstStream(dst);
+    CleanupClosePushL(dstStream);
+    dstStream.WriteInt32L(src.Count());
+    for (iter =0; iter < src.Count(); ++iter) {
+        dstStream << *(src[iter]);
+    }
+    CleanupStack::PopAndDestroy(&dstStream);
+    return dst;
+}
--- a/activityfw/storage/eabi/afstorageclientu.def	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-EXPORTS
-	_ZN14AfStorageEntryC1E14QSharedPointerI8CAfEntryE @ 1 NONAME
-	_ZN14AfStorageEntryC1ERKS_ @ 2 NONAME
-	_ZN14AfStorageEntryC1EiRK7QStringRK8QVariantRK5QHashIS0_S3_E @ 3 NONAME
-	_ZN14AfStorageEntryC2E14QSharedPointerI8CAfEntryE @ 4 NONAME
-	_ZN14AfStorageEntryC2ERKS_ @ 5 NONAME
-	_ZN14AfStorageEntryC2EiRK7QStringRK8QVariantRK5QHashIS0_S3_E @ 6 NONAME
-	_ZN15AfStorageClient10activitiesER5QListI14AfStorageEntryE @ 7 NONAME
-	_ZN15AfStorageClient11addActivityERK14AfStorageEntryRK7QPixmap @ 8 NONAME
-	_ZN15AfStorageClient11dataChangedEv @ 9 NONAME
-	_ZN15AfStorageClient11qt_metacallEN11QMetaObject4CallEiPPv @ 10 NONAME
-	_ZN15AfStorageClient11qt_metacastEPKc @ 11 NONAME
-	_ZN15AfStorageClient12activityDataER14AfStorageEntryRKS0_ @ 12 NONAME
-	_ZN15AfStorageClient12getThumbnailE5QSize7QStringPv @ 13 NONAME
-	_ZN15AfStorageClient12waitActivityEv @ 14 NONAME
-	_ZN15AfStorageClient14launchActivityERK14AfStorageEntry @ 15 NONAME
-	_ZN15AfStorageClient14removeActivityERK14AfStorageEntry @ 16 NONAME
-	_ZN15AfStorageClient14updateActivityERK14AfStorageEntryRK7QPixmap @ 17 NONAME
-	_ZN15AfStorageClient16notifyDataChangeEv @ 18 NONAME
-	_ZN15AfStorageClient16staticMetaObjectE @ 19 NONAME DATA 16
-	_ZN15AfStorageClient17activityRequestedERK7QString @ 20 NONAME
-	_ZN15AfStorageClient18thumbnailRequestedE7QPixmapPv @ 21 NONAME
-	_ZN15AfStorageClient19getStaticMetaObjectEv @ 22 NONAME
-	_ZN15AfStorageClient21applicationActivitiesER5QListI14AfStorageEntryERKS1_ @ 23 NONAME
-	_ZN15AfStorageClient22asyncRequestCompleatedEii @ 24 NONAME
-	_ZN15AfStorageClient22asyncRequestCompleatedEiiRK7QPixmapPv @ 25 NONAME
-	_ZN15AfStorageClient22asyncRequestCompleatedEiiRK7QString @ 26 NONAME
-	_ZN15AfStorageClient27removeApplicationActivitiesERK14AfStorageEntry @ 27 NONAME
-	_ZN15AfStorageClient7connectEv @ 28 NONAME
-	_ZN15AfStorageClientC1EP7QObject @ 29 NONAME
-	_ZN15AfStorageClientC2EP7QObject @ 30 NONAME
-	_ZN15AfStorageClientD0Ev @ 31 NONAME
-	_ZN15AfStorageClientD1Ev @ 32 NONAME
-	_ZN15AfStorageClientD2Ev @ 33 NONAME
-	_ZNK14AfStorageEntry10activityIdEv @ 34 NONAME
-	_ZNK14AfStorageEntry10publicDataEv @ 35 NONAME
-	_ZNK14AfStorageEntry11privateDataEv @ 36 NONAME
-	_ZNK14AfStorageEntry13applicationIdEv @ 37 NONAME
-	_ZNK14AfStorageEntry4dataEv @ 38 NONAME
-	_ZNK14AfStorageEntry5flagsEv @ 39 NONAME
-	_ZNK14AfStorageEntry8imageSrcEv @ 40 NONAME
-	_ZNK15AfStorageClient10metaObjectEv @ 41 NONAME
-	_ZTI15AfStorageClient @ 42 NONAME
-	_ZTV15AfStorageClient @ 43 NONAME
-	_ZThn8_N15AfStorageClient22asyncRequestCompleatedEii @ 44 NONAME
-	_ZThn8_N15AfStorageClient22asyncRequestCompleatedEiiRK7QPixmapPv @ 45 NONAME
-	_ZThn8_N15AfStorageClient22asyncRequestCompleatedEiiRK7QString @ 46 NONAME
-
--- a/activityfw/storage/inc/afcmd.h	Tue Jul 06 14:37:10 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: 
-*
-*/
-#ifndef AFCMD_H
-#define AFCMD_H
-
-const TInt KRequestAppIdOffset(0);
-const TInt KRequestActOffset(1);
-const TInt KRequestData(2);
-const TInt KRequestIdOffset(0);
-
-const TInt KResponseDataSizeOffset(0);
-const TInt KResponseIdOffset(3);
-const TInt KResponseDataOffset(1);
-
-
-enum ActivityCmd {
-    AddActivity =0,
-    UpdateActivity,
-    RemoveActivity,
-    RemoveApplicationActivities,
-    Activities,
-    ApplicationActivities,
-    ApplicationActivity,
-    WaitActivity,
-    LaunchActivity,
-    GetThumbnail,
-    GetData,
-    NotifyChange,
-    CancelWait,
-    CancelNotify
-};
-
-#endif  //AFCMD_H
-
--- a/activityfw/storage/inc/afstorageglobals.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef AFSTORAGEGLOBALS_H
-#define AFSTORAGEGLOBALS_H
-#include <qvariant.h>
-#include <afcmd.h>
-/**
- * Enumerate supported functions
- */
-
-const char ActivityApplicationKeyword [] = ":ApplicationId";
-const char ActivityActivityKeyword [] = ":ActivityName";
-const char ActivityParametersKeyword [] = ":ActivityParams";
-const char ActivityPersistence [] = ":ActivityPersistence";
-const char ActivityVisibility [] = ":ActivityVisibility";
-const char ActivityScreenshotKeyword [] = "screenshot";
-const char ActivityDataKeyword [] = ":ActivityData";
-const char ActivityApplicationName[] = ":ApplicationName";
-
-#endif //AFSTORAGEGLOBALS_H
--- a/activityfw/storage/s60/inc/afentry.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef AFENTRYDATA_H
-#define AFENTRYDATA_H
-
-#include <e32base.h>
-#include <s32strm.h>
-class RDbColWriteStream;
-class RDbColReadStream;
-const TInt KAfMask(0x0001);
-
-#ifdef AF_ADD_MASK
-#undef AF_ADD_MASK
-#endif
-#define AF_ADD_MASK(n) (KAfMask << n)
-
-class CAfEntry: public CBase
-{
-public:
-    enum AccessRights {
-    Private =0,
-    Public
-    };
-
-    enum Flags {
-    Invisible = KAfMask,
-    Persistent = 0x40000000,
-    };
-
-public:
-    static CAfEntry* NewL();
-
-    static CAfEntry* NewLC();
-
-    static CAfEntry* NewL(TInt flags,
-                          TInt applicationId,
-                          const TDesC &activityId,
-                          const TDesC &imgSrc,
-                          const TDesC8 &privateData,
-                          const TDesC8 &publicData);
-
-    static CAfEntry* NewLC(TInt flags,
-                           TInt applicationId,
-                           const TDesC &activityId,
-                           const TDesC &imgSrc,
-                           const TDesC8 &privateData,
-                           const TDesC8 &publicData);
-    
-    static CAfEntry* NewLC(const RMessage2& msg,
-                           int offset =0);
-
-    ~CAfEntry();
-
-    TInt Size() const;
-
-    TInt DataSize() const;
-
-    void ExternalizeL(RWriteStream &stream) const;
-
-    void InternalizeL(RReadStream &stream);
-
-    void ExternalizeDataOnlyL(RWriteStream &stream) const;
-
-    void InternalizeDataOnlyL(RReadStream &stream);
-
-    TInt Flags() const;
-
-    TInt ApplicationId() const;
-
-    const TDesC& ActivityId() const;
-
-    const TDesC& ImageSrc() const;
-
-    void SetImageSrcL(const TDesC& src);
-
-    const TDesC8& Data(CAfEntry::AccessRights rights) const;
-
-    void SetDataL(const TDesC8& src, CAfEntry::AccessRights rights);
-
-    static void ReallocL(RBuf8 &dst,TInt length);
-
-    static void ReallocL(RBuf &dst,TInt length);
-
-    static void CopyL(RBuf8 &dst,const TDesC8 &src);
-
-    static void CopyL(RBuf &dst,const TDesC &src);
-
-private:
-    CAfEntry();
-
-    void ConstructL(TInt flags,
-                    TInt applicationId,
-                    const TDesC &activityId,
-                    const TDesC &imgSrc,
-                    const TDesC8 &privateData,
-                    const TDesC8 &publicData);
-
-    static void InternalizeL(RBuf8 &dst, RReadStream &src);
-
-    static void InternalizeL(RBuf &dst, RReadStream &src);
-
-    static void ExternalizeL(RWriteStream &dst,const TDesC8 & src);
-
-    static void ExternalizeL(RWriteStream &dst,const TDesC& src);
-private:
-    TInt mFlags;
-    TInt mAppId;
-    RBuf mActivityId;
-    RBuf mImgSrc;
-    RBuf8 mPrivateData;
-    RBuf8 mPublicData;
-
-};
-
-RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src);
-
-RBuf8& operator << (RBuf8 &dst, const RPointerArray<CAfEntry>& src);
-
-#endif
--- a/activityfw/storage/s60/inc/afglobals.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef AFGLOBALS_H
-#define AFGLOBALS_H
-
-#include <e32base.h>
-const TUid KActivityServerUid = {0x200267B4};
-_LIT(KActivityServerName, "hsactivitydbserver");
-_LIT(KErr400, "Bad Reqest");
-_LIT(KErr403, "Access denied");
-
-#endif //AFGLOBALS_H
--- a/activityfw/storage/s60/inc/afserializer.h	Tue Jul 06 14:37:10 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 HSSERIALIZER_H
-#define HSSERIALIZER_H
-
-#include <qvariant.h>
-
-/**
- * Operator serialize VarinatHash to RBuf8
- */
-RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src);
-
-/**
- * Operator deserialize RBuf8 to VarinatHash
- */
-QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src);
-
-#endif
--- a/activityfw/storage/s60/src/afentry.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,461 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "afentry.h"
-#include <s32mem.h>
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create and initialize instance
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewL()
-{
-    CAfEntry *self = CAfEntry::NewLC();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create, initialize and push instance into cleanup stack
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewLC()
-{
-    CAfEntry *self = new (ELeave)CAfEntry();
-    CleanupStack::PushL(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create and initialize instance
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewL(TInt flags,
-                         TInt applicationId,
-                         const TDesC &activityId,
-                         const TDesC &imgSrc,
-                         const TDesC8 &privateData,
-                         const TDesC8 &publicData)
-{
-    CAfEntry* self = CAfEntry::NewLC(flags, 
-                                     applicationId, 
-                                     activityId, 
-                                     imgSrc, 
-                                     privateData, 
-                                     publicData);
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Two-phase constructor. Create, initialize and push instance into cleanup stack
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data
- * @return entry instance
- */
-CAfEntry* CAfEntry::NewLC(TInt flags,
-                          TInt applicationId,
-                          const TDesC &activityId,
-                          const TDesC &imgSrc,
-                          const TDesC8 &privateData,
-                          const TDesC8 &publicData)
-{
-    CAfEntry *self = CAfEntry::NewLC();
-    self->ConstructL(flags, 
-                     applicationId, 
-                     activityId, 
-                     imgSrc, 
-                     privateData, 
-                     publicData);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-CAfEntry* CAfEntry::NewLC(const RMessage2& msg, int offset)
-{
-    CAfEntry* self = CAfEntry::NewLC();
-    RBuf8 serializedEntry;
-    CleanupClosePushL(serializedEntry);
-    ReallocL(serializedEntry, msg.GetDesMaxLength(offset));
-    msg.ReadL(offset, serializedEntry);
-    RDesReadStream entryReader(serializedEntry);
-    CleanupClosePushL(entryReader);
-    entryReader >> (*self);
-    CleanupStack::PopAndDestroy(&entryReader);
-    CleanupStack::PopAndDestroy(&serializedEntry);
-    return self;
-}
-// -----------------------------------------------------------------------------
-/**
- * First phase constructor
- */
-CAfEntry::CAfEntry()
-{
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Second phase constructor. Initialize instance
- * @param flags - entry flags
- * @param applicationId - application unique identifier
- * @param activityId - activity unique identifier
- * @param imgSrc - thumbanail source
- * @param privateData - privated application data
- * @param publicData - public activity data 
- */
-void CAfEntry::ConstructL(TInt flags,
-                          TInt applicationId,
-                          const TDesC &activityId,
-                          const TDesC &imgSrc,
-                          const TDesC8 &privateData,
-                          const TDesC8 &publicData)
-{
-    mFlags = flags;
-    mAppId = applicationId;
-    CopyL(mActivityId, activityId);
-    CopyL(mImgSrc, imgSrc);
-    CopyL(mPrivateData, privateData);
-    CopyL(mPublicData, publicData);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Destructor. Release allocated resources 
- */
-CAfEntry::~CAfEntry()
-{
-    mActivityId.Close();
-    mPrivateData.Close();
-    mPublicData.Close();
-    mImgSrc.Close();
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide size of serialized entry
- * @return size of serialized entry instance
- */
-TInt CAfEntry::Size() const
-{
-    return (sizeof(TInt) * 3) + //flags + appId + actId size info 
-           mActivityId.Size() + //actId content size
-           DataSize(); //data size
-           
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide size of serialized entry
- * @return size of serialized entry instance
- */
-TInt CAfEntry::DataSize() const
-{
-    return (sizeof(TInt) * 3) + //privData size info + pubData size info + imgSrc size info
-            mImgSrc.Size() + //imgSize content size
-            mPrivateData.Size() + //privData content size
-            mPublicData.Size(); //pubData content size 
-}
-// -----------------------------------------------------------------------------
-/**
- * Serialize entry content into output stream.
- * @param stream - output stream
- */
-void CAfEntry::ExternalizeL(RWriteStream &stream) const
-{
-    stream.WriteInt32L(mFlags);
-    stream.WriteInt32L(mAppId);
-    ExternalizeL(stream, mActivityId);
-    ExternalizeDataOnlyL(stream);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize entry content from input stream
- * @param stream - input stream
- */
-void CAfEntry::InternalizeL(RReadStream &stream)
-{
-    mFlags = stream.ReadInt32L();
-    mAppId = stream.ReadInt32L();
-    InternalizeL(mActivityId, stream);
-    InternalizeDataOnlyL(stream);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize entry content into output stream.
- * @param stream - output stream
- */
-void CAfEntry::ExternalizeDataOnlyL(RWriteStream &stream) const
-{
-    ExternalizeL(stream, mImgSrc);
-    ExternalizeL(stream, mPrivateData);
-    ExternalizeL(stream, mPublicData);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize entry content from input stream
- * @param stream - input stream
- */
-void CAfEntry::InternalizeDataOnlyL(RReadStream &stream)
-{
-    
-    InternalizeL(mImgSrc, stream);
-    InternalizeL(mPrivateData, stream);
-    InternalizeL(mPublicData, stream);
-    
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity flags
- * @return activity flags 
- */
-TInt CAfEntry::Flags() const
-{
-    return mFlags;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity identifier.
- * @return activity identifier
- */
-TInt CAfEntry::ApplicationId() const
-{
-    return mAppId;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity identifier.
- * @return activity identifier
- */
-const TDesC& CAfEntry::ActivityId() const
-{
-    return mActivityId;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity data.
- * @param rights - type of requested data
- * @return activity data
- */
-const TDesC8& CAfEntry::Data(CAfEntry::AccessRights rights) const
-{
-    return Private == rights ? mPrivateData : mPublicData;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity data.
- * @param rights - type of requested data
- * @return activity data
- */
-void CAfEntry::SetDataL(const TDesC8& src, CAfEntry::AccessRights rights)
-{
-    CopyL(Private == rights ? mPrivateData : mPublicData, src);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Provide access to activity thumbail path
- * @return path to activity thumbnail 
- */
-const TDesC& CAfEntry::ImageSrc() const
-{
-    return mImgSrc;
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Set new value of image source
- */
-void CAfEntry::SetImageSrcL(const TDesC& src)
-{
-    CopyL(mImgSrc, src);
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Reallocate blob buffer to requested size
- * @param dst - destination buffer
- * @param length - requested length
- */
-void CAfEntry::ReallocL(RBuf8 &dst,TInt length)
-{
-    if (0 < length) {
-        if (dst.MaxLength() < length) {
-            dst.ReAllocL(length);
-        }
-    } else {
-        dst.Close();
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Reallocate text buffer to requested size
- * @param dst - destination buffer
- * @param length - requested length
- */
-void CAfEntry::ReallocL(RBuf &dst,TInt length)
-{
-    if (0 < length) {
-        if (dst.MaxLength() < length) {
-            dst.ReAllocL(length);
-        }
-    } else {
-        dst.Close();
-    }
-}
-// -----------------------------------------------------------------------------
-/**
- * Copy blob content from input stream
- * @param dst - destination buffer
- * @param src - source buffer
- */
-void CAfEntry::CopyL(RBuf8 &dst,const TDesC8 &src)
-{
-    ReallocL(dst, src.Length());
-    if(0 < src.Length()) {
-        dst.Copy(src);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Copy text content from input buffer
- * @param dst - destination buffer
- * @param src - source buffer
- */
-void CAfEntry::CopyL(RBuf &dst,const TDesC &src)
-{
-    ReallocL(dst, src.Length());
-    if(0 < src.Length()) {
-        dst.Copy(src);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize blob content from input stream
- * @param dst - destination buffer
- * @param src - input stream
- */
-void CAfEntry::InternalizeL(RBuf8 &dst, RReadStream &src)
-{
-    const TInt length(src.ReadInt32L());
-    ReallocL(dst, length);
-    if (0 < length) {
-        src.ReadL(dst, length);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Deserialize text content from input stream
- * @param dst - destination buffer
- * @param src - input stream
- */
-void CAfEntry::InternalizeL(RBuf &dst, RReadStream &src)
-{
-    const TInt length(src.ReadInt32L());
-    ReallocL(dst, length);
-    if (0 < length) {
-        src.ReadL(dst, length);
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize blob content into output stream
- * @param dst - destination stream
- * @param src - input buffer
- */
-void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC8 & src)
-{
-    dst.WriteInt32L(src.Length());
-    if (src.Length()) {
-        dst.WriteL(src, src.Length());
-    }
-}
-
-// -----------------------------------------------------------------------------
-/**
- * Serialize text content into output stream
- * @param dst - destination stream
- * @param src - input buffer
- */
-void CAfEntry::ExternalizeL(RWriteStream &dst,const TDesC& src)
-{
-    dst.WriteInt32L(src.Length());
-    if (src.Length()) {
-        dst.WriteL(src, src.Length());
-    }
-}
-
-// -----------------------------------------------------------------------------
-RPointerArray<CAfEntry>& operator <<(RPointerArray<CAfEntry>& dst, const TDesC8 &src)
-{
-    dst.ResetAndDestroy();
-    RDesReadStream srcStream(src);
-    CleanupClosePushL(srcStream);
-    int numOfItems(srcStream.ReadInt32L());
-    for (int i(0); i < numOfItems; ++i) {
-        CAfEntry *entry = CAfEntry::NewLC();
-        srcStream >> (*entry);
-        dst.AppendL(entry);
-        CleanupStack::Pop(entry);
-    }
-    CleanupStack::PopAndDestroy(&srcStream);
-    return dst;
-}
-
-// -----------------------------------------------------------------------------
-RBuf8& operator <<(RBuf8 &dst, const RPointerArray<CAfEntry>& src)
-{
-    int iter(0), 
-        requiredSize(sizeof(int));
-    for(iter =0; iter< src.Count(); ++iter) {
-        requiredSize += src[iter]->Size();
-    }
-    CAfEntry::ReallocL(dst, requiredSize);
-    RDesWriteStream dstStream(dst);
-    CleanupClosePushL(dstStream);
-    dstStream.WriteInt32L(src.Count());
-    for (iter =0; iter < src.Count(); ++iter) {
-        dstStream << *(src[iter]);
-    }
-    CleanupStack::PopAndDestroy(&dstStream);
-    return dst;
-}
--- a/activityfw/storage/s60/src/afserializer.cpp	Tue Jul 06 14:37:10 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 <s32mem.h>
-#include "afserializer.h"
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-RBuf8 &operator <<(RBuf8 &dst, const QVariantHash &src)
-{
-    QByteArray buffer;
-    QDataStream stream(&buffer, QIODevice::WriteOnly);
-
-    QT_TRYCATCH_LEAVING(stream << src);
-    const int dataLength(buffer.length());
-    const unsigned char *dataPtr(reinterpret_cast<const unsigned char *>(buffer.constData()));
-    if (dst.MaxLength() < dataLength) {
-        dst.ReAllocL(dataLength);
-    }
-    dst.Copy(dataPtr, dataLength);
-    return dst;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-QVariantHash &operator <<(QVariantHash &dst, const TDesC8 &src)
-{
-    QByteArray buffer(QByteArray::fromRawData(reinterpret_cast<const char *>(src.Ptr()),
-                                               src.Length()) );
-
-    QDataStream stream(&buffer, QIODevice::ReadOnly);
-    QT_TRYCATCH_LEAVING(stream >> dst);
-    return dst;
-}
--- a/activityfw/storage/server/group/server.mmp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/group/server.mmp	Wed Aug 18 10:05:49 2010 +0300
@@ -22,7 +22,6 @@
 
 USERINCLUDE     ../inc
 USERINCLUDE     ../../inc
-USERINCLUDE     ../../s60/inc
 USERINCLUDE     ../../../../inc
 
 SOURCEPATH      ../src
@@ -36,12 +35,14 @@
 SOURCE          afstorageasynctask.cpp
 SOURCE          afobservertask.cpp
 SOURCE          afthumbnailtask.cpp
-
-SOURCEPATH      ../../s60/src
-SOURCE          afentry.cpp
+SOURCE          afapplicationsmonitor.cpp
+SOURCE          afapplicationscollection.cpp
+SOURCE          afapplicationsstorage.cpp
+SOURCE          afapplicationsengine.cpp
 
 LIBRARY        euser.lib 
 LIBRARY        estor.lib
+LIBRARY		   apgrfx.lib
 LIBRARY        edbms.lib  
 LIBRARY        efsrv.lib
 LIBRARY        bafl.lib
@@ -50,6 +51,7 @@
 LIBRARY        bitmaptransforms.lib
 LIBRARY        imageconversion.lib
 LIBRARY        tsutils.lib
+STATICLIBRARY        afstoragecommon.lib
 
 CAPABILITY     ALL -TCB
 EPOCHEAPSIZE   0x100000 0x600000 // 1MB - 6MB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationscollection.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFAPPLICATIONSCOLLECTION_H
+#define AFAPPLICATIONSCOLLECTION_H
+
+#include <e32base.h>
+#include "afapplicationsobserver.h"
+#include "afapplicationsregistry.h"
+
+
+class CAfApplicationsCollection: public CBase,
+                                 public MAfApplicationsObserver,
+                                 public MAfApplicationsRegistry
+{
+public:
+    static CAfApplicationsCollection* NewL(RApaLsSession& serviceProvider, MAfApplicationsObserver* observer =0);
+    ~CAfApplicationsCollection();
+    void applicationsChanged();
+    TArray<TUid> removedApplications()const;
+    void setObserver(MAfApplicationsObserver& oserver);
+private:
+    CAfApplicationsCollection(RApaLsSession& serviceProvider, MAfApplicationsObserver* observer);
+    void collectsApplicationsInfoL();
+    
+private:
+    RApaLsSession& mServiceProvider;
+    MAfApplicationsObserver* mObserver;
+    RArray<TUid> mDeinstalledApplications;
+};
+
+#endif // AFAPPLICATIONSCOLLECTION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsengine.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFAPPLICATIONSENGINE_H
+#define AFAPPLICATIONSENGINE_H
+
+#include <e32base.h>
+#include "afstorage.h"
+
+class RApaLsSession;
+class CAfApplicationsCollection;
+class CAfApplicationsStorage;
+class CAfApplicationsMonitor;
+
+class CAfApplicationsEngine: public CBase
+{
+public:
+    static CAfApplicationsEngine* NewL(RApaLsSession& serviceProvider, CAfStorage& storage);
+    ~CAfApplicationsEngine();
+
+private:
+    CAfApplicationsEngine();
+    void ConstructL(CAfStorage& storage, RApaLsSession& serviceProvider);
+
+private:
+    CAfApplicationsCollection *mCollection;
+    CAfApplicationsMonitor *mMonitor;
+    CAfApplicationsStorage *mStorage;
+};
+
+#endif //AFAPPLICATIONSENGINE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsmonitor.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFAPPLICATIONMONITOR_H
+#define AFAPPLICATIONMONITOR_H
+
+#include <e32base.h>
+#include <apgcli.h>
+
+#include "afapplicationsobserver.h"
+
+class CAfApplicationsMonitor: public CActive
+{
+public:
+    static CAfApplicationsMonitor* NewL(RApaLsSession& serviceProvider, 
+                                        MAfApplicationsObserver& observer);
+    ~CAfApplicationsMonitor();
+private:
+    CAfApplicationsMonitor(RApaLsSession& serviceProvider, 
+                          MAfApplicationsObserver& observer);
+    
+    void RunL();
+    void Subscribe();
+    TInt RunError(TInt error);
+    void DoCancel();
+
+private:
+    RApaLsSession& mServiceProvider;
+    MAfApplicationsObserver &mObserver;
+};
+
+#endif // AFAPPLICATIONMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsobserver.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFAPPLICATIONSOBSERVER_H
+#define AFAPPLICATIONSOBSERVER_H
+
+#include <e32base.h>
+#include <apgcli.h>
+
+class MAfApplicationsObserver
+{
+public:
+    virtual void applicationsChanged()= 0;
+};
+
+#endif // AFAPPLICATIONMONITOR_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsregistry.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFAPPLICATIONSREGISTRY_H
+#define AFAPPLICATIONSREGISTRY_H
+
+class MAfApplicationsRegistry
+{
+public:
+    
+    virtual TArray<TUid> removedApplications() const =0;
+    //TODO extend by additional functions if needed
+};
+
+#endif // AFAPPLICATIONSREGISTRY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/inc/afapplicationsstorage.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFAPPLICATIONSSTORAGE_H
+#define AFAPPLICATIONSSTORAGE_H
+
+#include <e32base.h>
+#include "afstorage.h"
+#include "afapplicationsobserver.h"
+#include "afapplicationsregistry.h"
+
+
+class CAfApplicationsStorage: public CBase,
+                               public MAfApplicationsObserver
+{
+public:
+    static CAfApplicationsStorage* NewL(CAfStorage& storage, const MAfApplicationsRegistry& provider);
+    ~CAfApplicationsStorage();
+    void applicationsChanged();
+    
+private:
+    CAfApplicationsStorage(CAfStorage& storage, const MAfApplicationsRegistry& provider);
+    void deleteActivityL(TUid appId);
+private:
+    CAfStorage& mStorage;
+    const MAfApplicationsRegistry &mProvider;
+};
+
+#endif // AFAPPLICATIONSSTORAGE_H
--- a/activityfw/storage/server/inc/afserver.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/inc/afserver.h	Wed Aug 18 10:05:49 2010 +0300
@@ -23,6 +23,7 @@
 #include <e32std.h>
 #include <e32base.h>
 #include <f32file.h>    // RFs
+#include <apgcli.h>
 
 #include "aftaskstorage.h"
 
@@ -54,9 +55,11 @@
     void RemoveNotValidTasks(const CSession2* session);
 
 private:
+    RApaLsSession mApaSession;
     RFs mFsSession;
     CAfStorage* mStorage;
     RPointerArray<CAfTask> mObservers;
+    CBase* mAppEngine;
 };
 
 #endif // AFSERVER_H
--- a/activityfw/storage/server/inc/afstorage.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/inc/afstorage.h	Wed Aug 18 10:05:49 2010 +0300
@@ -35,6 +35,8 @@
     void AddActivityL(CAfEntry &entry);
     
     void UpdateActivityL(CAfEntry &entry);
+    
+    void SaveActivityL(CAfEntry &entry);
 
     void DeleteActivityL(CAfEntry &entry);
 
--- a/activityfw/storage/server/inc/afstoragesynctask.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/inc/afstoragesynctask.h	Wed Aug 18 10:05:49 2010 +0300
@@ -44,6 +44,9 @@
     static void UpdateActivityL(CAfStorage& dataStorage, 
                                 const RMessage2& msg);
 
+    static void SaveActivityL(CAfStorage& dataStorage, 
+                                const RMessage2& msg);
+                                
     static void DeleteActivityL(CAfStorage& dataStorage, 
                                 const RMessage2& msg);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/src/afapplicationscollection.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include <apgupdate.h>
+
+#include "afapplicationscollection.h"
+//------------------------------------------------------------------------------
+CAfApplicationsCollection* CAfApplicationsCollection::NewL(RApaLsSession& serviceProvider,
+                                                           MAfApplicationsObserver* observer)
+{
+    CAfApplicationsCollection *self = new(ELeave) CAfApplicationsCollection(serviceProvider, observer);
+    return self;
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsCollection::CAfApplicationsCollection(RApaLsSession& serviceProvider, MAfApplicationsObserver* observer)
+:
+    mServiceProvider(serviceProvider),
+    mObserver(observer)
+{}
+
+//------------------------------------------------------------------------------
+CAfApplicationsCollection::~CAfApplicationsCollection()
+{
+    mDeinstalledApplications.Close();
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsCollection::applicationsChanged()
+{
+    TRAP_IGNORE(collectsApplicationsInfoL());
+    if (mObserver) {
+        mObserver->applicationsChanged();
+    }
+}
+
+//------------------------------------------------------------------------------
+TArray<TUid> CAfApplicationsCollection::removedApplications()const
+{
+    return mDeinstalledApplications.Array();
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsCollection::setObserver(MAfApplicationsObserver& observer)
+{
+    mObserver = &observer;
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsCollection::collectsApplicationsInfoL()
+{
+    mDeinstalledApplications.Close();
+    RArray< TApaAppUpdateInfo > updatedApps;
+    CleanupClosePushL(updatedApps);
+    TInt errNo = mServiceProvider.UpdatedAppsInfoL(updatedApps);
+    User::LeaveIfError(errNo);
+    for (TInt offset(0); offset < updatedApps.Count(); ++offset) {
+        const TApaAppUpdateInfo::TApaAppAction action(updatedApps[offset].iAction);
+        switch (action) {
+        case TApaAppUpdateInfo::EAppNotPresent:
+            mDeinstalledApplications.AppendL(updatedApps[offset].iAppUid);
+            break;
+        //TODO add implementation for other cases when needed
+        }
+    }
+    CleanupStack::PopAndDestroy(&updatedApps);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/src/afapplicationsengine.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "afapplicationsengine.h"
+#include "afapplicationsstorage.h"
+#include "afapplicationscollection.h"
+#include "afapplicationsmonitor.h"
+
+//------------------------------------------------------------------------------
+CAfApplicationsEngine* CAfApplicationsEngine::NewL(RApaLsSession& serviceProvider, 
+                                                   CAfStorage& storage)
+{
+    CAfApplicationsEngine *self = new(ELeave)CAfApplicationsEngine();
+    CleanupStack::PushL(self);
+    self->ConstructL(storage, serviceProvider);
+    CleanupStack::Pop(self);
+    return self;
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsEngine::CAfApplicationsEngine()
+{}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsEngine::ConstructL(CAfStorage& storage, 
+                                       RApaLsSession& serviceProvider)
+{
+    mCollection = CAfApplicationsCollection::NewL(serviceProvider);
+    mMonitor = CAfApplicationsMonitor::NewL(serviceProvider, *mCollection);
+    mStorage = CAfApplicationsStorage::NewL(storage, *mCollection);
+    
+    mCollection->setObserver(*mStorage);
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsEngine::~CAfApplicationsEngine()
+{
+    delete mMonitor;
+    delete mStorage;
+    delete mCollection;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/src/afapplicationsmonitor.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#include "afapplicationsmonitor.h"
+
+//------------------------------------------------------------------------------
+CAfApplicationsMonitor* CAfApplicationsMonitor::NewL(RApaLsSession& serviceProvider,
+                                                   MAfApplicationsObserver& observer)
+{
+    CAfApplicationsMonitor* self = new (ELeave) CAfApplicationsMonitor(serviceProvider, observer);
+    self->Subscribe();
+    return self;
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsMonitor::CAfApplicationsMonitor(RApaLsSession& serviceProvider, 
+                                             MAfApplicationsObserver& observer)
+:
+    CActive(EPriorityLow),
+    mServiceProvider(serviceProvider),
+    mObserver(observer)
+{
+    CActiveScheduler::Add(this);
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsMonitor::~CAfApplicationsMonitor()
+{
+    Cancel();
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsMonitor::RunL()
+{
+    User::LeaveIfError(iStatus.Int());
+    mObserver.applicationsChanged();
+    Subscribe();
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsMonitor::Subscribe()
+{
+    mServiceProvider.SetNotify(EFalse, iStatus);
+    SetActive();
+}
+
+//------------------------------------------------------------------------------
+TInt CAfApplicationsMonitor::RunError(TInt /*error*/)
+{
+    Subscribe();
+    return KErrNone;
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsMonitor::DoCancel()
+{
+    mServiceProvider.CancelNotify();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/activityfw/storage/server/src/afapplicationsstorage.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -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 "afapplicationsstorage.h"
+//------------------------------------------------------------------------------
+CAfApplicationsStorage* CAfApplicationsStorage::NewL(CAfStorage& storage, 
+                                                     const MAfApplicationsRegistry& provider)
+{
+    CAfApplicationsStorage *self = new (ELeave)CAfApplicationsStorage(storage, provider);
+    return self;
+    
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsStorage::CAfApplicationsStorage(CAfStorage& storage, 
+                                               const MAfApplicationsRegistry& provider)
+:
+    mStorage(storage),
+    mProvider(provider)
+{
+}
+
+//------------------------------------------------------------------------------
+CAfApplicationsStorage::~CAfApplicationsStorage()
+{}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsStorage::applicationsChanged()
+{
+    const TArray<TUid> removedApp(mProvider.removedApplications());
+    for (TInt iter(0); iter < removedApp.Count(); ++iter) {
+        TRAP_IGNORE(deleteActivityL(removedApp[iter]));
+    }
+}
+
+//------------------------------------------------------------------------------
+void CAfApplicationsStorage::deleteActivityL(TUid appId)
+{
+    CAfEntry *entry(CAfEntry::NewLC(0, 
+                                    static_cast<TInt>(appId.iUid),
+                                    KNullDesC,
+                                    KNullDesC,
+                                    KNullDesC8,
+                                    KNullDesC8));
+    mStorage.DeleteActivitiesL(*entry);
+    CleanupStack::PopAndDestroy(entry);
+}
+
--- a/activityfw/storage/server/src/afbroadcasttask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/src/afbroadcasttask.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -27,11 +27,7 @@
 {
     const RPointerArray<CAfTask> &tasks(storage.StorageData());
     for (TInt iter(tasks.Count() - 1); iter >= 0 ; --iter ) {
-        if(EFalse == msg.IsNull()) {
-            (tasks[iter])->BroadcastReceivedL(msg);
-        }
+        (tasks[iter])->BroadcastReceivedL(msg);
     }
-    if(EFalse == msg.IsNull()) {
-        msg.Complete(KErrNone);
-    }
+    msg.Complete(KErrNone);
 }
--- a/activityfw/storage/server/src/afdataprovidertask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/src/afdataprovidertask.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -51,8 +51,6 @@
 void AfDataProviderTask::ProvideDataL(const RMessage2& msg, 
                                       const CAfTask& src)
 {
-    if (EFalse ==msg.IsNull()) {
-        msg.WriteL(KResponseDataOffset, src.Data());
-        msg.Complete(KErrNone);
-    }
+    msg.WriteL(KResponseDataOffset, src.Data());
+    msg.Complete(KErrNone);
 }
--- a/activityfw/storage/server/src/afserver.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/src/afserver.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -20,6 +20,7 @@
 #include "afsession.h"
 #include "afstorage.h"
 #include "aftask.h"
+#include "afapplicationsengine.h"
 
 _LIT( KActivityServerName, "hsactivitydbserver" );
 _LIT(KObserverAlreadyExists, "Observer task exists");
@@ -41,8 +42,10 @@
  */
 CAfServer::~CAfServer()
 {
+    delete mAppEngine;
     delete mStorage;
     mFsSession.Close();
+    mApaSession.Close();
     mObservers.ResetAndDestroy();
     RFbsSession::Disconnect();
 }
@@ -66,10 +69,11 @@
 void CAfServer::ConstructL()
 {
     StartL(KActivityServerName);
+    User::LeaveIfError(mApaSession.Connect());
     User::LeaveIfError(mFsSession.Connect());
     User::LeaveIfError(RFbsSession::Connect(mFsSession));
     mStorage = CAfStorage::NewL(mFsSession);
-    mObservers.Array();
+    mAppEngine = CAfApplicationsEngine::NewL(mApaSession, *mStorage);
 }
 
 // -----------------------------------------------------------------------------
--- a/activityfw/storage/server/src/afsession.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/src/afsession.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -94,6 +94,7 @@
     switch (message.Function()) {
     case AddActivity:
     case UpdateActivity:
+    case SaveActivity:
     case RemoveActivity:
     case RemoveApplicationActivities:
         AfStorageSyncTask::ExecuteL(mTasksStorage, mStorage, message);
--- a/activityfw/storage/server/src/afstorage.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/src/afstorage.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -49,6 +49,8 @@
  */
 CAfStorage::~CAfStorage()
 {
+    mActDb.Close();
+    delete mFileStore;
 }
 
 // -----------------------------------------------------------------------------
@@ -113,12 +115,6 @@
                                             EFileRead|EFileWrite);
     mFileStore->SetTypeL(mFileStore->Layout()); /* Set file store type*/
     mActDb.OpenL(mFileStore,mFileStore->Root());
-    CDbTableNames* tables = mActDb.TableNamesL();
-    CleanupStack::PushL(tables);
-    if (0 == tables->Count()) {
-        CreateTableL();
-    }
-    CleanupStack::PopAndDestroy(tables);
 }
 
 // -----------------------------------------------------------------------------
@@ -233,10 +229,6 @@
     ExternalizeDataL(view, entry, colSet->ColNo(KDataColumnName));
 
     view.PutL();
-    if (KErrNone != errNo) {
-        view.Cancel();
-        User::Leave(errNo);
-    }
     CleanupStack::PopAndDestroy(colSet);)
 
     if (KErrNone != errNo) {
@@ -248,6 +240,64 @@
 
 // -----------------------------------------------------------------------------
 /**
+ * Save activity
+ * @param entry - activity data
+ */
+void CAfStorage::SaveActivityL(CAfEntry &entry)
+{
+    // @todo check if this can be tidied up
+    //verify if row already exists
+    TInt errNo(KErrNone);
+    RDbView view;
+    CleanupClosePushL(view);
+    TRAP(errNo, GetActivityForUpdateL(view, entry.ApplicationId(), entry.ActivityId()));
+    if (KErrNone == errNo) {
+        // update
+        view.UpdateL();
+        TRAPD(errNo,
+        CDbColSet* colSet = view.ColSetL();
+        CleanupStack::PushL(colSet);
+
+        view.SetColL(colSet->ColNo(KFlagsColumnName), entry.Flags());
+        ExternalizeDataL(view, entry, colSet->ColNo(KDataColumnName));
+
+        view.PutL();
+        CleanupStack::PopAndDestroy(colSet);)
+
+        if (KErrNone != errNo) {
+            view.Cancel();
+            User::Leave(errNo);
+        }
+    } else {
+        // insert
+
+        //write table
+        RDbTable table;
+        CleanupClosePushL(table);
+        User::LeaveIfError(table.Open(mActDb, KActivityTableName, table.EUpdatable));
+        CDbColSet *row = table.ColSetL();
+        CleanupStack::PushL(row);
+
+        table.InsertL();
+        TRAP(errNo,
+        table.SetColL(row->ColNo(KApplicationColumnName), TInt64(entry.ApplicationId()));
+        table.SetColL(row->ColNo(KActivityColumnName), entry.ActivityId());
+        table.SetColL(row->ColNo(KFlagsColumnName), entry.Flags());
+        ExternalizeDataL(table, entry, row->ColNo(KDataColumnName));
+        table.PutL();)
+        if (KErrNone != errNo) {
+            table.Cancel();
+            User::Leave(errNo);
+        }
+        CleanupStack::PopAndDestroy(row);
+        CleanupStack::PopAndDestroy(&table);
+    }
+            
+    CleanupStack::PopAndDestroy(&view);
+}
+
+// -----------------------------------------------------------------------------
+/**
  * Delete activity
  * @param appId - application id
  * @param actId - activity id
--- a/activityfw/storage/server/src/afstorageasynctask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/src/afstorageasynctask.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -19,8 +19,6 @@
 #include "afstorageasynctask.h"
 #include "afcmd.h"
 
-_LIT(KUnsupportedStorageAsyncTask, "Unsupported async storage task");
-
 // -----------------------------------------------------------------------------
 /**
  * Constructor for performing 1st stage construction
@@ -56,9 +54,7 @@
     self->ExecuteL(dataStorage, msg);
     taskStorage.PushL(self);
     CleanupStack::Pop(self);
-    if (EFalse == msg.IsNull()) {
-        msg.Complete(KErrNone);
-    }
+    msg.Complete(KErrNone);
 }
 
 // -----------------------------------------------------------------------------
@@ -100,9 +96,6 @@
     case ApplicationActivity:
         ApplicationActivityL(dataStorage, msg);
         break;
-    default:
-        //this code shouldn't be called. fatal error: means wrong session implementation 
-        User::Panic(KUnsupportedStorageAsyncTask, KErrGeneral);
     };
 }
 
@@ -166,12 +159,10 @@
  */
 void CAfStorageAsyncTask::WriteResponseL(const RMessage2& msg)
 {
-    if (EFalse == msg.IsNull()) {
-        msg.WriteL(1, 
-                   TPckgBuf<TInt>(mExternalizedData.Length()));//write data size
-        msg.WriteL(2, 
-                   TPckgBuf<CBase*>(this));//task identyfier
-    }
+    msg.WriteL(1, 
+               TPckgBuf<TInt>(mExternalizedData.Length()));//write data size
+    msg.WriteL(2, 
+               TPckgBuf<CBase*>(this));//task identyfier
 }
 
 // -----------------------------------------------------------------------------
--- a/activityfw/storage/server/src/afstoragesynctask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/server/src/afstoragesynctask.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -41,6 +41,9 @@
     case UpdateActivity:
         UpdateActivityL(dataStorage, msg);
         break;
+    case SaveActivity:
+        SaveActivityL(dataStorage, msg);
+        break;        
     case RemoveActivity:
         DeleteActivityL(dataStorage, msg);
         break;
@@ -51,7 +54,10 @@
         //this code shouldn't be called. fatal error: means wrong session implementation 
         User::Panic(KUnsupportedStorageSyncTask, KErrGeneral);
     };
-    msg.Complete(KErrNone);
+    if(SaveActivity != msg.Function()) {
+        //function SaveActivityL complete message. DON'T DO THIS HERE
+        msg.Complete(KErrNone);
+    }
     NotifyChangeL(observers, msg);
 }
 
@@ -80,7 +86,6 @@
     entry->SetImageSrcL(thumbnailPath);
     dataStorage.AddActivityL(*entry);
     CleanupStack::PopAndDestroy(&thumbnailPath);
-    
     CleanupStack::PopAndDestroy(entry);
 }
 
@@ -102,7 +107,6 @@
     DeleteActivityScreenshotL(dataStorage, 
                     entry->ApplicationId(), 
                     entry->ActivityId());
-    
     dataStorage.ThumbnailPathL(thumbnailPath, 
                    dataStorage.Fs(), 
                    entry->ApplicationId(), 
@@ -117,6 +121,38 @@
 
 // -----------------------------------------------------------------------------
 /**
+ * Handle saving activiy
+ * @param dataStorage - data storage
+ * @param msg - request message
+ */
+void AfStorageSyncTask::SaveActivityL(CAfStorage& dataStorage, const RMessage2& msg)
+{
+    TPckgBuf<TInt> bitmapHdl(0);
+    CAfEntry *entry = CAfEntry::NewLC(msg);
+    msg.ReadL(1, bitmapHdl);
+        
+    RBuf thumbnailPath;
+    CleanupClosePushL(thumbnailPath);
+    DeleteActivityScreenshotL(dataStorage, 
+                    entry->ApplicationId(), 
+                    entry->ActivityId());
+    
+    dataStorage.ThumbnailPathL(thumbnailPath, 
+                   dataStorage.Fs(), 
+                   entry->ApplicationId(), 
+                   entry->ActivityId(),
+                   entry->Flags() & CAfEntry::Persistent);
+    CreateThumbnailL(thumbnailPath, bitmapHdl());
+    //all data is retrieved. compleate message to improve response time
+    msg.Complete(KErrNone);
+    TRAP_IGNORE(entry->SetImageSrcL(thumbnailPath);
+    dataStorage.SaveActivityL(*entry);)
+    CleanupStack::PopAndDestroy(&thumbnailPath);
+    CleanupStack::PopAndDestroy(entry);
+}
+
+// -----------------------------------------------------------------------------
+/**
  * Handle removing activity.
  * @param dataStorage - data storage
  * @param msg - request message
--- a/activityfw/storage/storage.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/activityfw/storage/storage.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -16,5 +16,8 @@
 
 TEMPLATE = subdirs
 
-SUBDIRS += client \
-           server
+CONFIG += ordered
+
+SUBDIRS +=  common \
+            client \
+            server \
--- a/common.pri	Tue Jul 06 14:37:10 2010 +0300
+++ b/common.pri	Wed Aug 18 10:05:49 2010 +0300
@@ -38,7 +38,7 @@
     SUBDIRPART = release
 }
 
-win32: OUTPUT_DIR = $$PWD/../bin/$$SUBDIRPART
+!symbian: OUTPUT_DIR = $$PWD/../bin/$$SUBDIRPART
 symbian: OUTPUT_DIR = $$PWD/bin
 
 SOURCE_DIR = $$PWD/inc
@@ -73,19 +73,17 @@
     INCLUDEPATH += $$MOC_DIR
     TARGET.CAPABILITY = ALL -TCB
     TARGET.EPOCALLOWDLLDATA=1
-}
-
-win32 {
+} else {
     # add platfrom API for windows
     INCLUDEPATH += \                
                 $$PWD/homescreensrv_plat/contentstorage_api \
-                $$PWD/homescreensrv_plat/hswidgetmodel_api \                
+                $$PWD/homescreensrv_plat/hswidgetmodel_api \
                 $$PWD/homescreensrv_plat/homescreen_information_api/inc
 }
 
 plugin: !isEmpty(PLUGIN_SUBDIR): DESTDIR = $$OUTPUT_DIR/$$PLUGIN_SUBDIR
 
-win32: plugin { # copy manifiers
+!symbian: plugin { # copy manifiers
     manifest.path = $$DESTDIR
     manifest.files = ./resource/*.manifest ./resource/*.xml
     manifest.CONFIG += no_build
@@ -105,9 +103,6 @@
     qtplugins.path = $$PLUGIN_SUBDIR
     qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
 
-    message(Remove "contains(MOBILITY, serviceframework)" after the QtSF refactorig is done!)
-        
-    !contains(MOBILITY, serviceframework):qtplugins.sources += resource/$${TARGET}.manifest
     contains(MOBILITY, serviceframework):BLD_INF_RULES.prj_exports += "resource/$${TARGET}.xml z:$$qtplugins.path/$${TARGET}.xml"
     
     for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin z:$$qtplugins.path/$$basename(qtplugin)"
@@ -120,8 +115,7 @@
         for(entry, entries) : BLD_INF_RULES.prj_exports += "./$$entry z:/$$replace(2, ^/,)/$$basename(entry)"
     }
     export ( BLD_INF_RULES.prj_exports)
-}
-win32 {
+} else {
     name = $$replace(1, [/\\\\\.\*], _)
     eval ($${name}.path = $${OUTPUT_DIR}/$${2})
     eval ($${name}.files = $$1)
--- a/contentstorage/bwins/camenuu.def	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/bwins/camenuu.def	Wed Aug 18 10:05:49 2010 +0300
@@ -23,4 +23,6 @@
 	?GetEntriesIdsL@CCaStorageProxy@@QAEXPBVCCaInnerQuery@@AAV?$RArray@H@@@Z @ 22 NONAME ; void CCaStorageProxy::GetEntriesIdsL(class CCaInnerQuery const *, class RArray<int> &)
 	?NewL@CCaSrvMmcHistory@@SAPAV1@XZ @ 23 NONAME ; class CCaSrvMmcHistory * CCaSrvMmcHistory::NewL(void)
 	?AddLocalizationL@CCaStorageProxy@@QAEXABVCCaLocalizationEntry@@@Z @ 24 NONAME ; void CCaStorageProxy::AddLocalizationL(class CCaLocalizationEntry const &)
+	?SaveDatabaseL@CCaStorageProxy@@QAEXXZ @ 25 NONAME ; void CCaStorageProxy::SaveDatabaseL(void)
+	?RestoreDatabaseL@CCaStorageProxy@@QAEXXZ @ 26 NONAME ; void CCaStorageProxy::RestoreDatabaseL(void)
 
--- a/contentstorage/bwins/cautilsu.def	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/bwins/cautilsu.def	Wed Aug 18 10:05:49 2010 +0300
@@ -1,36 +1,36 @@
 EXPORTS
 	?NewLC@CCaInnerNotifierFilter@@SAPAV1@W4TNotifierType@1@@Z @ 1 NONAME ; class CCaInnerNotifierFilter * CCaInnerNotifierFilter::NewLC(enum CCaInnerNotifierFilter::TNotifierType)
-	?ExternalizeL@RCaIdsArray@@QBEXAAVRWriteStream@@@Z @ 2 NONAME ; void RCaIdsArray::ExternalizeL(class RWriteStream &) const
-	?GetAttributes@CCaInnerQuery@@QBEABVRCaEntryAttrArray@@XZ @ 3 NONAME ; class RCaEntryAttrArray const & CCaInnerQuery::GetAttributes(void) const
-	?SetEntryTypeNameL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 4 NONAME ; void CCaInnerEntry::SetEntryTypeNameL(class TDesC16 const &)
-	?SetSort@CCaInnerQuery@@QAEXW4TSortAttribute@1@@Z @ 5 NONAME ; void CCaInnerQuery::SetSort(enum CCaInnerQuery::TSortAttribute)
-	?SetIconId@CCaInnerEntry@@QAEXH@Z @ 6 NONAME ; void CCaInnerEntry::SetIconId(int)
-	?SetUid@CCaInnerEntry@@QAEXJ@Z @ 7 NONAME ; void CCaInnerEntry::SetUid(long)
-	?SetLocalizedStringL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 8 NONAME ; void CCaLocalizationEntry::SetLocalizedStringL(class TDesC16 const &)
-	?GetQmFilename@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 9 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetQmFilename(void) const
-	?GetText@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 10 NONAME ; class RBuf16 const & CCaInnerEntry::GetText(void) const
-	?InternalizeL@RCaEntriesArray@@QAEXAAVRReadStream@@@Z @ 11 NONAME ; void RCaEntriesArray::InternalizeL(class RReadStream &)
-	?SetIdsL@CCaInnerNotifierFilter@@QAEXABV?$RArray@H@@@Z @ 12 NONAME ; void CCaInnerNotifierFilter::SetIdsL(class RArray<int> const &)
-	?GetTextId@CCaLocalizationEntry@@QBEHXZ @ 13 NONAME ; int CCaLocalizationEntry::GetTextId(void) const
-	?GetUid@CCaInnerEntry@@QBEJXZ @ 14 NONAME ; long CCaInnerEntry::GetUid(void) const
-	?SetId@CCaInnerEntry@@QAEXI@Z @ 15 NONAME ; void CCaInnerEntry::SetId(unsigned int)
-	?GetSort@CCaInnerQuery@@QBE?AW4TSortAttribute@1@XZ @ 16 NONAME ; enum CCaInnerQuery::TSortAttribute CCaInnerQuery::GetSort(void) const
-	?SetCount@CCaInnerQuery@@QAEXI@Z @ 17 NONAME ; void CCaInnerQuery::SetCount(unsigned int)
-	?ExternalizeL@CCaInnerNotifierFilter@@QBEXAAVRWriteStream@@@Z @ 18 NONAME ; void CCaInnerNotifierFilter::ExternalizeL(class RWriteStream &) const
-	?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 19 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TDes16 &)
-	?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 20 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TDes16 &)
-	?SetRowId@CCaLocalizationEntry@@QAEXI@Z @ 21 NONAME ; void CCaLocalizationEntry::SetRowId(unsigned int)
-	?GetUid@CCaInnerQuery@@QBEIXZ @ 22 NONAME ; unsigned int CCaInnerQuery::GetUid(void) const
-	?SetFlags@CCaInnerEntry@@QAEXI@Z @ 23 NONAME ; void CCaInnerEntry::SetFlags(unsigned int)
-	?SetAttributeNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 24 NONAME ; void CCaLocalizationEntry::SetAttributeNameL(class TDesC16 const &)
-	?GetCount@CCaInnerQuery@@QBEIXZ @ 25 NONAME ; unsigned int CCaInnerQuery::GetCount(void) const
-	?GetParentId@CCaInnerNotifierFilter@@QBEHXZ @ 26 NONAME ; int CCaInnerNotifierFilter::GetParentId(void) const
-	?SetId@CCaInnerIconDescription@@QAEXH@Z @ 27 NONAME ; void CCaInnerIconDescription::SetId(int)
-	?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 28 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const
-	?GetFlags@CCaInnerEntry@@QBEIXZ @ 29 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const
-	?NewL@CCaInnerIconDescription@@SAPAV1@XZ @ 30 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewL(void)
-	?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 31 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &)
-	?Find@RCaEntryAttrArray@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 32 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TPtrC16 &)
+	?Find@RCaEntryAttrArray@@QBEHABVTDesC16@@AAVTPtrC16@@@Z @ 2 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TPtrC16 &) const
+	?ExternalizeL@RCaIdsArray@@QBEXAAVRWriteStream@@@Z @ 3 NONAME ; void RCaIdsArray::ExternalizeL(class RWriteStream &) const
+	?GetAttributes@CCaInnerQuery@@QBEABVRCaEntryAttrArray@@XZ @ 4 NONAME ; class RCaEntryAttrArray const & CCaInnerQuery::GetAttributes(void) const
+	?SetEntryTypeNameL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 5 NONAME ; void CCaInnerEntry::SetEntryTypeNameL(class TDesC16 const &)
+	?SetSort@CCaInnerQuery@@QAEXW4TSortAttribute@1@@Z @ 6 NONAME ; void CCaInnerQuery::SetSort(enum CCaInnerQuery::TSortAttribute)
+	?SetIconId@CCaInnerEntry@@QAEXH@Z @ 7 NONAME ; void CCaInnerEntry::SetIconId(int)
+	?SetUid@CCaInnerEntry@@QAEXJ@Z @ 8 NONAME ; void CCaInnerEntry::SetUid(long)
+	?SetLocalizedStringL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 9 NONAME ; void CCaLocalizationEntry::SetLocalizedStringL(class TDesC16 const &)
+	?GetQmFilename@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 10 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetQmFilename(void) const
+	?GetText@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 11 NONAME ; class RBuf16 const & CCaInnerEntry::GetText(void) const
+	?InternalizeL@RCaEntriesArray@@QAEXAAVRReadStream@@@Z @ 12 NONAME ; void RCaEntriesArray::InternalizeL(class RReadStream &)
+	?SetIdsL@CCaInnerNotifierFilter@@QAEXABV?$RArray@H@@@Z @ 13 NONAME ; void CCaInnerNotifierFilter::SetIdsL(class RArray<int> const &)
+	?GetTextId@CCaLocalizationEntry@@QBEHXZ @ 14 NONAME ; int CCaLocalizationEntry::GetTextId(void) const
+	?GetUid@CCaInnerEntry@@QBEJXZ @ 15 NONAME ; long CCaInnerEntry::GetUid(void) const
+	?SetId@CCaInnerEntry@@QAEXI@Z @ 16 NONAME ; void CCaInnerEntry::SetId(unsigned int)
+	?GetSort@CCaInnerQuery@@QBE?AW4TSortAttribute@1@XZ @ 17 NONAME ; enum CCaInnerQuery::TSortAttribute CCaInnerQuery::GetSort(void) const
+	?SetCount@CCaInnerQuery@@QAEXI@Z @ 18 NONAME ; void CCaInnerQuery::SetCount(unsigned int)
+	?ExternalizeL@CCaInnerNotifierFilter@@QBEXAAVRWriteStream@@@Z @ 19 NONAME ; void CCaInnerNotifierFilter::ExternalizeL(class RWriteStream &) const
+	?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTDes16@@@Z @ 20 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TDes16 &)
+	?GetChildId@CCaInnerQuery@@QBEHXZ @ 21 NONAME ; int CCaInnerQuery::GetChildId(void) const
+	?SetRowId@CCaLocalizationEntry@@QAEXI@Z @ 22 NONAME ; void CCaLocalizationEntry::SetRowId(unsigned int)
+	?GetUid@CCaInnerQuery@@QBEIXZ @ 23 NONAME ; unsigned int CCaInnerQuery::GetUid(void) const
+	?SetFlags@CCaInnerEntry@@QAEXI@Z @ 24 NONAME ; void CCaInnerEntry::SetFlags(unsigned int)
+	?SetAttributeNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 25 NONAME ; void CCaLocalizationEntry::SetAttributeNameL(class TDesC16 const &)
+	?GetCount@CCaInnerQuery@@QBEIXZ @ 26 NONAME ; unsigned int CCaInnerQuery::GetCount(void) const
+	?GetParentId@CCaInnerNotifierFilter@@QBEHXZ @ 27 NONAME ; int CCaInnerNotifierFilter::GetParentId(void) const
+	?SetId@CCaInnerIconDescription@@QAEXH@Z @ 28 NONAME ; void CCaInnerIconDescription::SetId(int)
+	?GetStringId@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 29 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetStringId(void) const
+	?GetFlags@CCaInnerEntry@@QBEIXZ @ 30 NONAME ; unsigned int CCaInnerEntry::GetFlags(void) const
+	?NewL@CCaInnerIconDescription@@SAPAV1@XZ @ 31 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewL(void)
+	?NewL@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 32 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewL(class TDesC16 const &)
 	?SetFileNameL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 33 NONAME ; void CCaInnerIconDescription::SetFileNameL(class TDesC16 const &)
 	?SetParentId@CCaInnerNotifierFilter@@QAEXH@Z @ 34 NONAME ; void CCaInnerNotifierFilter::SetParentId(int)
 	?SetFlagsOn@CCaInnerQuery@@QAEXI@Z @ 35 NONAME ; void CCaInnerQuery::SetFlagsOn(unsigned int)
@@ -43,7 +43,7 @@
 	?GetAttributeName@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 42 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetAttributeName(void) const
 	?GetTUint@MenuUtils@@SAHABVTDesC16@@AAI@Z @ 43 NONAME ; int MenuUtils::GetTUint(class TDesC16 const &, unsigned int &)
 	?AddAttributeL@CCaInnerQuery@@QAEXABVTDesC16@@0@Z @ 44 NONAME ; void CCaInnerQuery::AddAttributeL(class TDesC16 const &, class TDesC16 const &)
-	?Exist@RCaEntryAttrArray@@QAEHABVTDesC16@@@Z @ 45 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &)
+	?SetChildId@CCaInnerQuery@@QAEXH@Z @ 45 NONAME ; void CCaInnerQuery::SetChildId(int)
 	?AddAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@0@Z @ 46 NONAME ; void CCaInnerEntry::AddAttributeL(class TDesC16 const &, class TDesC16 const &)
 	?GetParentId@CCaInnerQuery@@QBEHXZ @ 47 NONAME ; int CCaInnerQuery::GetParentId(void) const
 	?SetEntryRole@CCaInnerNotifierFilter@@QAEXW4TEntryRole@@@Z @ 48 NONAME ; void CCaInnerNotifierFilter::SetEntryRole(enum TEntryRole)
@@ -54,51 +54,51 @@
 	?GetId@CCaInnerEntry@@QBEHXZ @ 53 NONAME ; int CCaInnerEntry::GetId(void) const
 	?SetDescriptionL@CCaInnerEntry@@QAEXABVTDesC16@@H@Z @ 54 NONAME ; void CCaInnerEntry::SetDescriptionL(class TDesC16 const &, int)
 	?SetEntryTypeNames@CCaInnerQuery@@QAEXPAVCDesC16ArrayFlat@@@Z @ 55 NONAME ; void CCaInnerQuery::SetEntryTypeNames(class CDesC16ArrayFlat *)
-	?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 56 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const
-	?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@H@Z @ 57 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &, int)
-	?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 58 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const
-	?SetRole@CCaInnerQuery@@QAEXH@Z @ 59 NONAME ; void CCaInnerQuery::SetRole(int)
-	?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 60 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void)
-	?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 61 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &)
-	?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 62 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &)
-	?SetQmFilenameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 63 NONAME ; void CCaLocalizationEntry::SetQmFilenameL(class TDesC16 const &)
-	?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 64 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const
-	?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 65 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const
-	?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 66 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &)
-	?SetSkinIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 67 NONAME ; void CCaInnerIconDescription::SetSkinIdL(class TDesC16 const &)
-	?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 68 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const
-	?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 69 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const
-	?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 70 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &)
-	?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 71 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &)
-	?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 72 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const
-	?NewL@CCaInnerEntry@@SAPAV1@XZ @ 73 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void)
-	?SetRole@CCaInnerEntry@@QAEXI@Z @ 74 NONAME ; void CCaInnerEntry::SetRole(unsigned int)
-	?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 75 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void)
-	?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 76 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &)
-	?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 77 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const
-	?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 78 NONAME ; int CCaLocalizationEntry::GetRowId(void) const
-	?NewLC@CCaInnerIconDescription@@SAPAV1@XZ @ 79 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewLC(void)
-	?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 80 NONAME ; void CCaInnerQuery::SetIdsL(class RArray<int> const &)
-	?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 81 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int)
-	?Icon@CCaInnerEntry@@QBEPBVCCaInnerIconDescription@@XZ @ 82 NONAME ; class CCaInnerIconDescription const * CCaInnerEntry::Icon(void) const
-	?SetApplicationIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 83 NONAME ; void CCaInnerIconDescription::SetApplicationIdL(class TDesC16 const &)
-	?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 84 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TPtrC16 &)
-	?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 85 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &)
-	?GetRole@CCaInnerEntry@@QBEIXZ @ 86 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const
-	?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 87 NONAME ; class RArray<int> const & CCaInnerQuery::GetIds(void) const
-	?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 88 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const
-	?NewL@CCaInnerQuery@@SAPAV1@XZ @ 89 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void)
-	?isLocalized@CCaInnerEntry@@QBEHW4TLocalizedType@1@@Z @ 90 NONAME ; int CCaInnerEntry::isLocalized(enum CCaInnerEntry::TLocalizedType) const
-	?SetUid@CCaInnerQuery@@QAEXI@Z @ 91 NONAME ; void CCaInnerQuery::SetUid(unsigned int)
-	?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 92 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const
-	?GetRole@CCaInnerQuery@@QBEHXZ @ 93 NONAME ; int CCaInnerQuery::GetRole(void) const
-	?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 94 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const
-	?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 95 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void)
-	?SetParentId@CCaInnerQuery@@QAEXH@Z @ 96 NONAME ; void CCaInnerQuery::SetParentId(int)
-	?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 97 NONAME ; class RArray<int> CCaInnerNotifierFilter::GetIds(void) const
-	?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 98 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &)
-	?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 99 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int)
-	?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 100 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &)
-	?GetChildId@CCaInnerQuery@@QBEHXZ @ 101 NONAME ; int CCaInnerQuery::GetChildId(void) const
-	?SetChildId@CCaInnerQuery@@QAEXH@Z @ 102 NONAME ; void CCaInnerQuery::SetChildId(int)
+	?Exist@RCaEntryAttrArray@@QBEHABVTDesC16@@@Z @ 56 NONAME ; int RCaEntryAttrArray::Exist(class TDesC16 const &) const
+	?GetNotifierType@CCaInnerNotifierFilter@@QBE?AW4TNotifierType@1@XZ @ 57 NONAME ; enum CCaInnerNotifierFilter::TNotifierType CCaInnerNotifierFilter::GetNotifierType(void) const
+	?SetTextL@CCaInnerEntry@@QAEXABVTDesC16@@H@Z @ 58 NONAME ; void CCaInnerEntry::SetTextL(class TDesC16 const &, int)
+	?ExternalizeL@CCaInnerEntry@@QBEXAAVRWriteStream@@@Z @ 59 NONAME ; void CCaInnerEntry::ExternalizeL(class RWriteStream &) const
+	?SetRole@CCaInnerQuery@@QAEXH@Z @ 60 NONAME ; void CCaInnerQuery::SetRole(int)
+	?NewL@CCaLocalizationEntry@@SAPAV1@XZ @ 61 NONAME ; class CCaLocalizationEntry * CCaLocalizationEntry::NewL(void)
+	?InternalizeL@CCaInnerNotifierFilter@@QAEXAAVRReadStream@@@Z @ 62 NONAME ; void CCaInnerNotifierFilter::InternalizeL(class RReadStream &)
+	?InternalizeL@RCaIdsArray@@QAEXAAVRReadStream@@@Z @ 63 NONAME ; void RCaIdsArray::InternalizeL(class RReadStream &)
+	?SetQmFilenameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 64 NONAME ; void CCaLocalizationEntry::SetQmFilenameL(class TDesC16 const &)
+	?MarshalDataLC@RCaIdsArray@@QBEPAVHBufC8@@XZ @ 65 NONAME ; class HBufC8 * RCaIdsArray::MarshalDataLC(void) const
+	?GetEntryTypeNames@CCaInnerQuery@@QBEPBVCDesC16ArrayFlat@@XZ @ 66 NONAME ; class CDesC16ArrayFlat const * CCaInnerQuery::GetEntryTypeNames(void) const
+	?SetValueL@CCaEntryAttribute@@QAEXABVTDesC16@@@Z @ 67 NONAME ; void CCaEntryAttribute::SetValueL(class TDesC16 const &)
+	?SetSkinIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 68 NONAME ; void CCaInnerIconDescription::SetSkinIdL(class TDesC16 const &)
+	?ExternalizeL@CCaInnerQuery@@QBEXAAVRWriteStream@@@Z @ 69 NONAME ; void CCaInnerQuery::ExternalizeL(class RWriteStream &) const
+	?GetLocalizedString@CCaLocalizationEntry@@QBEABVRBuf16@@XZ @ 70 NONAME ; class RBuf16 const & CCaLocalizationEntry::GetLocalizedString(void) const
+	?InternalizeL@CCaInnerQuery@@QAEXAAVRReadStream@@@Z @ 71 NONAME ; void CCaInnerQuery::InternalizeL(class RReadStream &)
+	?NewLC@CCaEntryAttribute@@SAPAV1@ABVTDesC16@@@Z @ 72 NONAME ; class CCaEntryAttribute * CCaEntryAttribute::NewLC(class TDesC16 const &)
+	?GetTypeNames@CCaInnerNotifierFilter@@QBEPAVCDesC16ArrayFlat@@XZ @ 73 NONAME ; class CDesC16ArrayFlat * CCaInnerNotifierFilter::GetTypeNames(void) const
+	?NewL@CCaInnerEntry@@SAPAV1@XZ @ 74 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewL(void)
+	?SetRole@CCaInnerEntry@@QAEXI@Z @ 75 NONAME ; void CCaInnerEntry::SetRole(unsigned int)
+	?NewLC@CCaInnerEntry@@SAPAV1@XZ @ 76 NONAME ; class CCaInnerEntry * CCaInnerEntry::NewLC(void)
+	?SetTableNameL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 77 NONAME ; void CCaLocalizationEntry::SetTableNameL(class TDesC16 const &)
+	?GetAttributes@CCaInnerEntry@@QBEABVRCaEntryAttrArray@@XZ @ 78 NONAME ; class RCaEntryAttrArray const & CCaInnerEntry::GetAttributes(void) const
+	?GetRowId@CCaLocalizationEntry@@QBEHXZ @ 79 NONAME ; int CCaLocalizationEntry::GetRowId(void) const
+	?NewLC@CCaInnerIconDescription@@SAPAV1@XZ @ 80 NONAME ; class CCaInnerIconDescription * CCaInnerIconDescription::NewLC(void)
+	?SetIdsL@CCaInnerQuery@@QAEXABV?$RArray@H@@@Z @ 81 NONAME ; void CCaInnerQuery::SetIdsL(class RArray<int> const &)
+	?SetFlagsOff@CCaInnerQuery@@QAEXI@Z @ 82 NONAME ; void CCaInnerQuery::SetFlagsOff(unsigned int)
+	?Icon@CCaInnerEntry@@QBEPBVCCaInnerIconDescription@@XZ @ 83 NONAME ; class CCaInnerIconDescription const * CCaInnerEntry::Icon(void) const
+	?SetApplicationIdL@CCaInnerIconDescription@@QAEXABVTDesC16@@@Z @ 84 NONAME ; void CCaInnerIconDescription::SetApplicationIdL(class TDesC16 const &)
+	?FindAttribute@CCaInnerEntry@@QAEHABVTDesC16@@AAVTPtrC16@@@Z @ 85 NONAME ; int CCaInnerEntry::FindAttribute(class TDesC16 const &, class TPtrC16 &)
+	?RemoveAttributeL@CCaInnerEntry@@QAEXABVTDesC16@@@Z @ 86 NONAME ; void CCaInnerEntry::RemoveAttributeL(class TDesC16 const &)
+	?GetRole@CCaInnerEntry@@QBEIXZ @ 87 NONAME ; unsigned int CCaInnerEntry::GetRole(void) const
+	?GetIds@CCaInnerQuery@@QBEABV?$RArray@H@@XZ @ 88 NONAME ; class RArray<int> const & CCaInnerQuery::GetIds(void) const
+	?ExternalizeL@RCaEntriesArray@@QBEXAAVRWriteStream@@@Z @ 89 NONAME ; void RCaEntriesArray::ExternalizeL(class RWriteStream &) const
+	?NewL@CCaInnerQuery@@SAPAV1@XZ @ 90 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewL(void)
+	?isLocalized@CCaInnerEntry@@QBEHW4TLocalizedType@1@@Z @ 91 NONAME ; int CCaInnerEntry::isLocalized(enum CCaInnerEntry::TLocalizedType) const
+	?SetUid@CCaInnerQuery@@QAEXI@Z @ 92 NONAME ; void CCaInnerQuery::SetUid(unsigned int)
+	?GetDescription@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 93 NONAME ; class RBuf16 const & CCaInnerEntry::GetDescription(void) const
+	?Find@RCaEntryAttrArray@@QBEHABVTDesC16@@AAVTDes16@@@Z @ 94 NONAME ; int RCaEntryAttrArray::Find(class TDesC16 const &, class TDes16 &) const
+	?GetRole@CCaInnerQuery@@QBEHXZ @ 95 NONAME ; int CCaInnerQuery::GetRole(void) const
+	?GetEntryTypeName@CCaInnerEntry@@QBEABVRBuf16@@XZ @ 96 NONAME ; class RBuf16 const & CCaInnerEntry::GetEntryTypeName(void) const
+	?NewLC@CCaInnerQuery@@SAPAV1@XZ @ 97 NONAME ; class CCaInnerQuery * CCaInnerQuery::NewLC(void)
+	?SetParentId@CCaInnerQuery@@QAEXH@Z @ 98 NONAME ; void CCaInnerQuery::SetParentId(int)
+	?GetIds@CCaInnerNotifierFilter@@QBE?AV?$RArray@H@@XZ @ 99 NONAME ; class RArray<int> CCaInnerNotifierFilter::GetIds(void) const
+	?SetStringIdL@CCaLocalizationEntry@@QAEXABVTDesC16@@@Z @ 100 NONAME ; void CCaLocalizationEntry::SetStringIdL(class TDesC16 const &)
+	?SetTextId@CCaLocalizationEntry@@QAEXI@Z @ 101 NONAME ; void CCaLocalizationEntry::SetTextId(unsigned int)
+	?RemoveAttribute@RCaEntryAttrArray@@QAEXABVTDesC16@@@Z @ 102 NONAME ; void RCaEntryAttrArray::RemoveAttribute(class TDesC16 const &)
 
--- a/contentstorage/caclient/caclient.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/caclient.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -60,7 +60,7 @@
 include(caclient_s60.pri)
 }
 
-win32: {
+!symbian: {
 DEPENDPATH += ./stub/inc \
               ./stub/src
 INCLUDEPATH += ./stub/inc
--- a/contentstorage/caclient/inc/caclient_defines.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/inc/caclient_defines.h	Wed Aug 18 10:05:49 2010 +0300
@@ -25,5 +25,6 @@
 const char URL_ENTRY_TYPE_NAME[] = "url";
 const char PACKAGE_ENTRY_TYPE_NAME[] = "package";
 const char TEMPLATED_APPLICATION_ENTRY_TYPE_NAME[] = "templatedApplication";
+const char COLLECTION_TITLE_NAME[] = "title_name";
 
 #endif //CACLIENT_DEFINES_H
--- a/contentstorage/caclient/inc/caitemmodel_p.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/inc/caitemmodel_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -58,11 +58,15 @@
     QSharedPointer<CaEntry> entry(const QModelIndex &modelIndex) const;
     void setSecondLineVisibility(bool secondLineVisibility);
     bool secondLineVisibility() const;
-    QVariant displayRole(const QModelIndex &modelIndex) const;
+    QVariant displayRole(const CaEntry* entry) const;
     void setParentId(int parentId);
     void setFlagsOn(const EntryFlags &onFlags);
     void setFlagsOff(const EntryFlags &offFlags);
     bool notifierExists() const;
+    
+    QList<int> getUninstallingEntriesIds(int componentId);
+    void updateProgress(int id, int valueOfProgress);
+    
 
 public slots:
 
@@ -85,6 +89,7 @@
     void disconnectSlots();
     void reconnectSlots();
     void emitEmpty(int previousCount);
+    void emitCountChange(int previousCount);
 
 private slots:
 
--- a/contentstorage/caclient/inc/caitemmodellist.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/inc/caitemmodellist.h	Wed Aug 18 10:05:49 2010 +0300
@@ -44,6 +44,7 @@
     QSharedPointer<CaEntry> at(int row) const;
     void reloadEntries(const CaQuery &query);
     void updateEntry(const QSharedPointer<CaEntry> &entry);
+    int updateProgress(int id, int valueOfProgress);
     void updateEntries(const CaQuery &query);
     int indexOf(const int &id) const;
     void insert(int row, int id);
--- a/contentstorage/caclient/s60/inc/cabitmapadapter.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/s60/inc/cabitmapadapter.h	Wed Aug 18 10:05:49 2010 +0300
@@ -32,15 +32,6 @@
 class CaBitmapAdapter
 {
 public:
-
-    //Static convertion methods between Symbian and Qt objects
-
-    /**
-     * Make bitmap copy, used to get rid of compression for extended bitmap
-     * @param input input bitmap.
-     * @return copied bitmap.
-     */
-    static CFbsBitmap *copyBitmapLC(CFbsBitmap *input);
     
     /**
      * Convert from bitmap and mask to qpixmap
--- a/contentstorage/caclient/s60/inc/caobserver.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/s60/inc/caobserver.h	Wed Aug 18 10:05:49 2010 +0300
@@ -74,11 +74,6 @@
      * @param parent pointer to parent. Defaults to NULL.
      */
     CaObserver(QObject *parent = 0);
-
-    /**
-     * Destructor.
-     */
-    ~CaObserver();
     
     /**
      * Method invoked when entry is changed.
--- a/contentstorage/caclient/s60/src/cabitmapadapter.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/s60/src/cabitmapadapter.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -31,43 +31,11 @@
 #include "cadef.h"
 #include "cabitmapadapter.h"
 
-// -----------------------------------------------------------------------------
-// copying compressed bitmap
-//----------------------------------------------------------------------------
-CFbsBitmap *CaBitmapAdapter::copyBitmapLC(CFbsBitmap *input)
-{
-    CFbsBitmap *bmp = new(ELeave) CFbsBitmap();
-    CleanupStack::PushL(bmp);
-    bmp->Create(input->SizeInPixels(), input->DisplayMode());
-
-    CFbsBitmapDevice *bitmapDevice = CFbsBitmapDevice::NewL(bmp);
-    CleanupStack::PushL(bitmapDevice);
-    CFbsBitGc *bmpGc;
-    bitmapDevice->CreateContext(bmpGc);
-    bmpGc->BitBlt(TPoint(0,0), input);
-    delete bmpGc;
-    CleanupStack::PopAndDestroy(bitmapDevice);
-    return bmp;
-}
-
 void CaBitmapAdapter::fromBitmapAndMaskToPixmapL(CFbsBitmap* fbsBitmap,
         CFbsBitmap* fbsMask, QPixmap& pixmap)
 {
-    if (fbsBitmap->Header().iCompression == ENoBitmapCompression) {
-        pixmap = pixmap.fromSymbianCFbsBitmap(fbsBitmap);
-        QPixmap mask;
-        mask = mask.fromSymbianCFbsBitmap(fbsMask);
-        pixmap.setAlphaChannel(mask);
-    } else { // we need special handling for icons in 9.2 (NGA)
-        // let's hope that in future it will be in QT code
-        CFbsBitmap *temp(NULL);
-        temp = CaBitmapAdapter::copyBitmapLC(fbsBitmap);
-        pixmap = pixmap.fromSymbianCFbsBitmap(temp);
-        CleanupStack::PopAndDestroy();
-        temp = CaBitmapAdapter::copyBitmapLC(fbsMask);
-        QPixmap mask;
-        mask = mask.fromSymbianCFbsBitmap(temp);
-        CleanupStack::PopAndDestroy();
-        pixmap.setAlphaChannel(mask);
-    }
+    pixmap = pixmap.fromSymbianCFbsBitmap(fbsBitmap);
+    QPixmap mask;
+    mask = mask.fromSymbianCFbsBitmap(fbsMask);
+    pixmap.setAlphaChannel(mask);
 }
--- a/contentstorage/caclient/s60/src/camenuiconutility.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/s60/src/camenuiconutility.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -67,7 +67,7 @@
  \param sie const reference to icon size.
  \retval icon.
  */
-LOCAL_C HbIcon getIconFromApparcL(const CaEntry& entry, const QSize &size)
+LOCAL_C HbIcon getIconFromApparcL(int uidValue, const QSize &size)
 {
     HbIcon icon;
     
@@ -75,22 +75,20 @@
     CleanupClosePushL(apaLsSession);
     User::LeaveIfError(apaLsSession.Connect());
 
-    QString uidString(entry.attribute(appUidAttributeName));
-    TUid uid;
-    uid = uid.Uid(uidString.toInt());
-    
+    TUid uid = uid.Uid(uidValue);
     CApaAppServiceInfoArray* skinArray(NULL);
-    TRAPD( err, skinArray = apaLsSession.GetAppServiceOpaqueDataLC(uid, TUid::Uid(0x2002DCF3));
-    if (err == KErrNone && skinArray ) {
-        TArray<TApaAppServiceInfo> tmpArray( skinArray->Array() );
-        if ( tmpArray.Count() ) {
-            TPtrC8 opaque(tmpArray[0].OpaqueData());
-            const TPtrC16 iconName((TText16*) opaque.Ptr(),(opaque.Length()+1)>>1);
-            icon = HbIcon( XQConversions:: s60DescToQString( iconName ) );
-        } 
-    }
-    CleanupStack::PopAndDestroy(skinArray);
-    );
+    TRAPD( err, skinArray =
+        apaLsSession.GetAppServiceOpaqueDataLC(uid, TUid::Uid(0x2002DCF3));
+        if (err == KErrNone && skinArray ) {
+            TArray<TApaAppServiceInfo> tmpArray( skinArray->Array() );
+            if ( tmpArray.Count() ) {
+                TPtrC8 opaque(tmpArray[0].OpaqueData());
+                const TPtrC16 iconName((TText16*) opaque.Ptr(),(opaque.Length()+1)>>1);
+                icon = HbIcon( XQConversions:: s60DescToQString( iconName ) );
+            }
+        }
+        CleanupStack::PopAndDestroy(skinArray);
+        );
     
     if (icon.isNull() || !(icon.size().isValid())) {
         TSize iconSize(size.width(), size.height());
@@ -118,8 +116,6 @@
                     
                     TPtr ptr(fileNameFromApparc->Des());
                     CaMenuIconMifUtility::GetPixmapByFilenameL(ptr,size,pixmap);
-        
-                    pixmap = pixmap.scaled(size, Qt::KeepAspectRatioByExpanding);
                     icon = HbIcon(QIcon(pixmap));
                 } else {
                     icon = HbIcon(fileName);
@@ -130,7 +126,6 @@
         CleanupStack::PopAndDestroy(apaMaskedBitmap);
     }
     CleanupStack::PopAndDestroy(&apaLsSession);
-    
     return icon;
 }
 
@@ -152,7 +147,7 @@
             XQConversions::s60DescToQString(KCaTypeCollection) ||
             entry.entryTypeName() == 
             XQConversions::s60DescToQString(KCaTypeCollectionDownload)) {
-        icon = HbIcon("qtg_large_application");
+        icon = HbIcon("qtg_large_applications_user");
     } else if (entry.entryTypeName() ==
         XQConversions::s60DescToQString(KCaTypeUrl)) {
         icon = HbIcon("qtg_large_application");
@@ -216,7 +211,16 @@
     icon = getIconFromEntry(entry);
  
     if (icon.isNull() || !(icon.size().isValid())) {
-        TRAP_IGNORE(icon = getIconFromApparcL(entry, size));
+        QString uidString(entry.attribute(appUidAttributeName));
+        bool uidOk(false);
+        int uidValue = uidString.toInt(&uidOk);
+        if (!uidOk) {
+            uidString = entry.iconDescription().applicationId();
+            uidValue = uidString.toInt(&uidOk);
+        }
+        if (uidOk) {
+            TRAP_IGNORE(icon = getIconFromApparcL(uidValue, size));
+        }
     }
  
     if (icon.isNull() || !(icon.size().isValid())) {
@@ -225,8 +229,8 @@
  
     if (entry.entryTypeName() == XQConversions::s60DescToQString(
             KCaTypeWidget)) {
-        icon.addBadge(Qt::AlignBottom | Qt::AlignLeft,
-		    HbIcon("qtg_small_homescreen"));
+        icon.addProportionalBadge(Qt::AlignBottom | Qt::AlignRight,
+		    HbIcon("qtg_small_homescreen"), QSizeF(0.5, 0.5));
     }
     return icon;
 }
--- a/contentstorage/caclient/s60/src/caobserver.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/s60/src/caobserver.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -27,12 +27,6 @@
     QObject(parent)
 {
 }
-//----------------------------------------------------------------------------
-//
-//----------------------------------------------------------------------------
-CaObserver::~CaObserver()
-{
-}
 
 //----------------------------------------------------------------------------
 //
--- a/contentstorage/caclient/src/caentry.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/src/caentry.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -421,10 +421,8 @@
 HbIcon CaEntry::makeIcon(const QSize &size) const
 {
     CACLIENTTEST_FUNC_ENTRY("CaEntry::makeIcon");
-    HbIcon icon;
-    if (CaIconCache::cache()->exist(*this,size)) {
-        icon = CaIconCache::cache()->icon(*this,size);
-    } else {
+    HbIcon icon = CaIconCache::cache()->icon(*this,size);
+    if (icon.isNull()) {
         icon = m_d->makeIcon(size);
         CaIconCache::cache()->insert(*this, size, icon);
     }
--- a/contentstorage/caclient/src/caiconcache.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/src/caiconcache.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -116,10 +116,12 @@
 HbIcon CaIconCache::icon(const CaEntry &entry, const QSize &size)
 {
     CACLIENTTEST_FUNC_ENTRY("CaIconCache::icon");
-    HbIcon icon;
-    icon = *mCache.object(key(entry,size));
+    HbIcon result;
+    if (HbIcon* tmp = mCache.object(key(entry,size))) {
+        result = *tmp;
+    }
     CACLIENTTEST_FUNC_EXIT("CaIconCache::icon");
-    return icon;
+    return result; 
 }
 
 /*!
--- a/contentstorage/caclient/src/caitemmodel.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/src/caitemmodel.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -388,6 +388,16 @@
     return m_d->entry(index);
 }
 
+QList<int> CaItemModel::getUninstallingEntriesIds(int componentId)
+{
+    return m_d->getUninstallingEntriesIds(componentId);
+}
+
+void CaItemModel::updateProgress(int id, int valueOfProgress)
+{
+    m_d->updateProgress(id, valueOfProgress);
+}
+
 /*!
  Constructor
  \param query needed to create model
@@ -446,33 +456,44 @@
 {
     CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::data");
     QVariant variant;
-    if (modelIndex.isValid()) {
+    QSharedPointer<CaEntry> pEntry = entry(modelIndex);
+    if (!pEntry.isNull()) {
         switch (role) {
         case Qt::DisplayRole:
-            variant = displayRole(modelIndex);
+            variant = displayRole(pEntry.data());
             break;
         case Qt::DecorationRole:
-            variant = QVariant(HbIcon(entry(modelIndex)->makeIcon(mSize)));
+            variant = QVariant(HbIcon(pEntry->makeIcon(mSize)));
             break;
         case CaItemModel::IdRole:
-            variant = QVariant(entry(modelIndex)->id());
+            variant = QVariant(pEntry->id());
             break;
         case CaItemModel::TypeRole:
-            variant = QVariant(entry(modelIndex)->entryTypeName());
+            variant = QVariant(pEntry->entryTypeName());
             break;
         case CaItemModel::FlagsRole:
-            variant = qVariantFromValue(entry(modelIndex)->flags());
+            variant = qVariantFromValue(pEntry->flags());
             break;
         case CaItemModel::TextRole:
-            variant = QVariant(entry(modelIndex)->text());
+            variant = QVariant(pEntry->text());
             break;
         case CaItemModel::FullTextRole:
-            variant = QVariant(entry(modelIndex)->text() + QString(" ")
-                + entry(modelIndex)->description());
+            variant = QVariant(pEntry->text() + QString(" ") + pEntry->description());
             break;
         case CaItemModel::UninstalRole:
-      	    variant = QVariant(entry(modelIndex)->attribute(UNINSTALL_PROGRESS_APPLICATION_ATTRIBUTE_NAME).toInt());
+            variant = QVariant(
+                pEntry->attribute(UNINSTALL_PROGRESS_APPLICATION_ATTRIBUTE_NAME).toInt());
             break;
+        case CaItemModel::CollectionTitleRole:
+            if (!pEntry->attribute(COLLECTION_TITLE_NAME).isNull()) {
+                variant = QVariant(pEntry->
+                    attribute(COLLECTION_TITLE_NAME).toUtf8());
+            }
+            else {
+                variant = QVariant(pEntry->text());
+            }
+            break;
+            
         default:
             variant = QVariant(QVariant::Invalid);
         }
@@ -559,11 +580,21 @@
  */
 QSharedPointer<CaEntry> CaItemModelPrivate::entry(const QModelIndex &modelIndex) const
 {
-    if (modelIndex.column() == 1) {
-        return mParentEntry;
-    } else {
-        return mEntries.at(modelIndex.row());
+    if (modelIndex.isValid()) {
+        if (modelIndex.column() == 1) {
+            return mParentEntry;
+        }
+        else {
+            int row = modelIndex.row();
+            if (row >= mEntries.count()) {
+                return QSharedPointer<CaEntry> ();
+            }
+            else {
+                return mEntries.at(row);
+            }
+        }
     }
+    return QSharedPointer<CaEntry> ();
 }
 
 /*!
@@ -593,22 +624,22 @@
  \param modelIndex item index
  \retval QVariant containing display role
  */
-QVariant CaItemModelPrivate::displayRole(const QModelIndex &modelIndex) const
+QVariant CaItemModelPrivate::displayRole(const CaEntry* entry) const
 {
     CACLIENTTEST_FUNC_ENTRY("CaItemModelPrivate::displayRole")
 
     QVariant result;
     if (mSecondLineVisibility) {
-        if (entry(modelIndex)->description().isEmpty()) {
-            result = entry(modelIndex)->text();
+        if (entry->description().isEmpty()) {
+            result = entry->text();
         } else {
             QList<QVariant> text;
-            text << entry(modelIndex)->text();
-            text << entry(modelIndex)->description();
+            text << entry->text();
+            text << entry->description();
             result = QVariant(text);
         }
     } else {
-        result = entry(modelIndex)->text();
+        result = entry->text();
     }
     CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::displayRole")
     return result;
@@ -672,6 +703,24 @@
 }
 
 
+QList<int> CaItemModelPrivate::getUninstallingEntriesIds(int componentId)
+{
+    CaQuery* query = new CaQuery(mQuery);
+    QString compId(QString().setNum(componentId));
+    query->setAttribute(QString("component_id"), compId);
+    QList<int> ids = mService->getEntryIds(*query);
+    delete query;
+    return ids;
+}
+
+void CaItemModelPrivate::updateProgress(int id, int valueOfProgress)
+{
+    int updateIndex = mEntries.updateProgress(id, valueOfProgress);
+    if (updateIndex >= 0) {
+        emit m_q->dataChanged(
+                index(updateIndex), index(updateIndex));
+    }        
+}
 /*!
  Updates model with fresh entries and resets model
  */
@@ -788,30 +837,30 @@
     const int oldItemCount(mEntries.count());
     if (oldItemCount) {
         const int newItemCount(itemsList.count());
+        int i = 0;
+        QList<int> oldList = mEntries.orderedIdList();
+        //we loop through items to find first added
+        while (i < oldList.count()) {
+            if (oldList[i] != itemsList[i]) {
+                oldList.takeAt(i);
+            } else {
+                ++i;
+            }
+        }
         if (newItemCount == oldItemCount) {
             // count is the same - check if item order changed
-            if (itemsList == mEntries.orderedIdList()) {
+            if (itemsList == oldList) {
                 // assume that if the order has not changed
                 // it had to be the secondary lines
-                updateModel();
+                emit m_q->dataChanged(index(0), index(m_q->rowCount()-1));
             } else {
                 updateLayout();
             }
         } else {
-            int i = 0;
-            QList<int> oldList = mEntries.orderedIdList();
-            //we loop through items to find first added
-            while (i < oldList.count()) {
-                if (oldList[i] != itemsList[i]) {
-                    oldList.takeAt(i);
-                } else {
-                    ++i;
-                }
-            }
             updateModel();
             //i is the index of first added item
-            emit m_q->scrollTo(i, QAbstractItemView::PositionAtTop);
         }
+        emit m_q->scrollTo(i, QAbstractItemView::PositionAtTop);
     } else {
         // items added to an empty list - add all as a single block
         addItemBlock(itemsList);
@@ -1000,6 +1049,7 @@
         removeItems(ids);
     }
     emitEmpty(previousCount);
+    emitCountChange(previousCount);
     CACLIENTTEST_FUNC_EXIT("CaItemModelPrivate::updateModelContent");
 }
 
@@ -1016,3 +1066,15 @@
         emit m_q->empty(false);
     }
 }
+
+/*!
+ Emits empty signal if count of item in model was change
+ \param previousCount 
+ */
+void CaItemModelPrivate::emitCountChange(int previousCount)
+{
+    if (previousCount != rowCount()) {
+        emit m_q->countChange();
+    }
+}
+
--- a/contentstorage/caclient/src/caitemmodellist.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/src/caitemmodellist.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <QIcon>
 
+#include "caclient_defines.h"
 #include "caitemmodellist.h"
 #include "caitemmodel_p.h"
 #include "canotifier.h"
@@ -104,6 +105,25 @@
     CACLIENTTEST_FUNC_EXIT("CaItemModelList::updateEntry");
 }
 
+int CaItemModelList::updateProgress(int id, int valueOfProgress)
+{
+    if (mEntriesHash.contains(id)) {
+        QSharedPointer<CaEntry> entry = at(indexOf(id));
+        if (valueOfProgress < 0) {
+            //we need to reload this entry from database
+            mEntriesHash.insert(id, mService->getEntry(entry->id()));
+        }
+        else {
+            entry->setFlags(entry->flags() | UsedEntryFlag 
+                    | UninstallEntryFlag);
+            entry->setAttribute(UNINSTALL_PROGRESS_APPLICATION_ATTRIBUTE_NAME,
+                    QString().setNum(valueOfProgress));
+            mEntriesHash.insert(id, entry);
+        }
+    }
+    return indexOf(id);
+}
+
 /*!
  Updates entries
  \param query with sort order
--- a/contentstorage/caclient/src/caqtsfhandlerloader.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/src/caqtsfhandlerloader.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -54,7 +54,7 @@
 */
 void CaQtSfHandlerLoader::registerPlugins() const
 {
-    const QString pluginPath("hsresources/plugins/commandhandler");
+    const QString pluginPath("/resource/qt/plugins/commandhandler");
     const QFileInfoList drives = QDir::drives();
     
     foreach (QFileInfo drive, drives) {
--- a/contentstorage/caclient/stub/inc/hswidgetcomponentdescriptor.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/stub/inc/hswidgetcomponentdescriptor.h	Wed Aug 18 10:05:49 2010 +0300
@@ -25,6 +25,8 @@
 class HsWidgetComponentDescriptor
 {
 public:
+    HsWidgetComponentDescriptor();
+    HsWidgetComponentDescriptor(const HsWidgetComponentDescriptor& copyFrom);
     QString installationPath;
     QString uri;
     QString title;
--- a/contentstorage/caclient/stub/src/hswidgetcomponentdescriptor.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/caclient/stub/src/hswidgetcomponentdescriptor.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -18,6 +18,28 @@
 
 #include "hswidgetcomponentdescriptor.h"
 
+
+HsWidgetComponentDescriptor::HsWidgetComponentDescriptor():installationPath(),uri(),title(),
+	description(),iconUri(),hidden(),serviceXml(),version(),library(),translationFilename(),uid(0),previewImage()
+{}
+
+HsWidgetComponentDescriptor::HsWidgetComponentDescriptor(const HsWidgetComponentDescriptor& copyFrom) {
+    this->installationPath = copyFrom.installationPath;
+    this->uri = copyFrom.uri;
+    this->title = copyFrom.title;
+    this->description = copyFrom.description;
+    this->iconUri = copyFrom.iconUri;
+    this->hidden = copyFrom.hidden;
+    this->serviceXml = copyFrom.serviceXml;
+    this->version = copyFrom.version;
+    this->library = copyFrom.library;
+    this->translationFilename = copyFrom.translationFilename;
+    this->uid = copyFrom.uid;
+    this->previewImage = copyFrom.previewImage;
+
+}
+
+
 bool HsWidgetComponentDescriptor::isValid()
 {
     bool ret(false);
--- a/contentstorage/cahandler/app/app.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/cahandler/app/app.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -14,7 +14,7 @@
 CONFIG += plugin hb mobility
 MOBILITY = serviceframework
 
-PLUGIN_SUBDIR = /hsresources/plugins/commandhandler
+PLUGIN_SUBDIR = /resource/qt/plugins/commandhandler
 
 include(../../../common.pri)
 
@@ -49,8 +49,6 @@
     -lscrclient \
     -lxqutils \
     -lcaclient
-
-    exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager):LIBS += -lxqsettingsmanager
 }
 
 
--- a/contentstorage/cahandler/tapp/tapp.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/cahandler/tapp/tapp.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -19,7 +19,7 @@
 CONFIG += plugin mobility
 MOBILITY = serviceframework
 
-PLUGIN_SUBDIR = /hsresources/plugins/commandhandler
+PLUGIN_SUBDIR = /resource/qt/plugins/commandhandler
 
 
 include (../../../common.pri)
--- a/contentstorage/cahandler/url/url.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/cahandler/url/url.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -14,7 +14,7 @@
 CONFIG += plugin hb mobility
 MOBILITY = serviceframework
 
-PLUGIN_SUBDIR = /hsresources/plugins/commandhandler
+PLUGIN_SUBDIR = /resource/qt/plugins/commandhandler
 
 include(../../../common.pri)
 
@@ -47,8 +47,6 @@
     -lefsrv \
     -lxqutils \
     -lcaclient
-
-    exists($${EPOCROOT}epoc32/include/platform/mw/XQSettingsManager):LIBS += -lxqsettingsmanager
 }
 
 
--- a/contentstorage/casoftwareregistry/casoftwareregistry.pri	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casoftwareregistry/casoftwareregistry.pri	Wed Aug 18 10:05:49 2010 +0300
@@ -15,4 +15,5 @@
 #
 
 HEADERS += ../../homescreensrv_plat/contentstorage_api/casoftwareregistry.h
+HEADERS += ../../homescreensrv_plat/contentstorage_api/cauninstallnotifier.h
 SOURCES += ./src/*.cpp
--- a/contentstorage/casoftwareregistry/casoftwareregistry.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casoftwareregistry/casoftwareregistry.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -24,7 +24,8 @@
 DEPENDPATH += ./inc \
               ./src
 INCLUDEPATH += ./inc \
-            ../inc
+            ../inc \
+            ../cautils/inc
             
 symbian: {
 
@@ -40,6 +41,7 @@
         -lbafl \
         -lestor \
         -lscrclient \
+        -lsifnotification \
         -lxqutils \
         -lPlatformEnv \
         -lefsrv
@@ -47,7 +49,7 @@
 include(casoftwareregistry_s60.pri)
 }
 
-win32: {
+!symbian: {
 DEPENDPATH += ./stub/inc \
               ./stub/src
 INCLUDEPATH += ./stub/inc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/inc/caprogresscanner.h	Wed Aug 18 10:05:49 2010 +0300
@@ -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:  ?Description
+ *
+ */
+
+#ifndef CAPROGRESSCANER_H
+#define CAPROGRESSCANER_H
+
+#include <e32base.h>
+#include <usif/sif/sifnotification.h>
+#include <usif/usifcommon.h>
+#include <usif/sif/sifcommon.h>
+#include <usif/scr/scr.h>
+#include "cauninstallobserver.h"
+
+using namespace Usif;
+
+
+/**
+ *  Uninstall Progress notifier.
+ *
+ *  @since S60 v5.0
+ */
+NONSHARABLE_CLASS( CCaProgresScanner ) : public CBase, public MSifOperationsHandler
+    {
+
+public:
+    /**
+     * Creates an instance of CCaProgresScanner.
+     */
+IMPORT_C static CCaProgresScanner* NewL( IUninstallObserver* aObserver );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CCaProgresScanner();
+
+private:
+
+    /**
+     * Constructor.
+     */
+    CCaProgresScanner( IUninstallObserver* aObserver );
+
+    /**
+     * Symbian 2nd phase constructor.
+     */
+    void ConstructL( );
+
+    void UpdateProgressL( const CSifOperationProgressData& aProgressData );
+    void EndOperationL( TInt aError );
+    void SubscribeL( TUint aKey );
+    void CancelSubscribeL();
+
+public:
+    /**
+     * From MSifOperationsHandler
+     */
+    void StartOperationHandler(
+        TUint aKey,
+        const CSifOperationStartData& aStartData );
+
+    /**
+     * From MSifOperationsHandler
+     */
+    void EndOperationHandler( const CSifOperationEndData& aEndData );
+
+    /**
+     * From MSifOperationsHandler
+     */
+    void ProgressOperationHandler(
+        const CSifOperationProgressData& aProgressData );
+
+private:
+
+    /**
+     * USIF notifier
+     * Own.
+     *
+     * Commented out since USIF notifications do not
+     * work on MCL wk20
+     */
+    CSifOperationsNotifier* iNotifier;
+
+    /**
+     * Reference to Software component registry. Not own.
+     */
+    RSoftwareComponentRegistry iSoftwareRegistry;
+
+    TUint iKey;
+
+    TComponentId iComponentId;
+    
+    const IUninstallObserver* iObserver;
+    };
+
+
+#endif /* CAPROGRESSCANER_H */
+
+// End of File
+
+
--- a/contentstorage/casoftwareregistry/s60/inc/casoftwareregistry_p.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casoftwareregistry/s60/inc/casoftwareregistry_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -25,8 +25,9 @@
 
 class QStringList;
 class CaSoftwareRegistry;
+class CaUninstallNotifier;
 
-namespace Usif 
+namespace Usif
 {
     class CComponentEntry;
 }
@@ -45,24 +46,33 @@
         QString &componentName,
         QStringList &applicationsUids,
         QString &confirmationMessage);
-    
+
     bool getApplicationsUids(int componentId,
         QStringList &appUids);
 
     DetailMap entryDetails(int componentId) const;
+
+    QList<DetailMap> retrieveLogEntries() const;
+    CaUninstallNotifier *createUninstallNotifier() const;
     
-    DetailMap entryDetails(
-        const Usif::CComponentEntry& entry) const;
 private:
+    QList<DetailMap> retrieveLogEntriesL() const;
+    DetailMap entryDetailsL(
+            const Usif::CComponentEntry& entry) const;
     void getUninstallDetailsL(int componentId,
         QString &componentName,
         QStringList &appUids,
         QString &confirmationMessage);
     void getApplicationsUidsL(int componentId,
         QStringList &appUids);
+    DetailMap entryDetailsL(int componentId) const;
+    //TODO int should be changed to const Usif::TScrComponentOperationType&
+    //when the problem with usif headers is solved
+    QString operationTypeL(int operationType) const;
+    QString operationTime(TTime time) const;
 private:
     CaSoftwareRegistry *const m_q;
-
+    friend class T_CaSoftwareRegistry;
 };
 
 #endif // CASOFTWAREREGISTRY_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/inc/cauninstallnotifier_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: canotifier.h
+ *
+ */
+
+#ifndef CAUNINSTALLNOTIFIER_P_H
+#define CAUNINSTALLNOTIFIER_P_H
+
+#include <QObject>
+#include <QSharedPointer>
+class CaUninstallObserver;
+class CCaProgresScanner;
+class CaUninstallNotifier;
+class CaSoftwareRegistry;
+
+class CaUninstallNotifierPrivate: public QObject
+{
+Q_OBJECT
+
+public:
+
+    explicit CaUninstallNotifierPrivate();
+
+    virtual ~CaUninstallNotifierPrivate();
+    
+    void makeConnect();
+
+private:
+    CaUninstallObserver* mUninstallObserver;
+    CCaProgresScanner* mProgressScanner;
+    QSharedPointer<CaSoftwareRegistry> mCaSoftwareRegistry;
+    
+    const CaUninstallNotifier *m_q;
+    friend class CaUninstallNotifier;
+
+};
+
+
+#endif // CAUNINSTALLNOTIFIER_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/inc/cauninstallobserver.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ *  Description : Content Arsenal client session
+ *
+ */
+
+#ifndef CAUINSTALLOBSERVER_H_
+#define CAUINSTALLOBSERVER_H_
+
+#include <QObject>
+
+/**
+ *  IDataObserver
+ *
+ */
+class IUninstallObserver
+{
+public:
+    /**
+     * Method invoked when entry is changed.
+     * @param entryId entry id.
+     * @param changeType change type.
+     */
+    virtual void progressChange(TInt componentId,
+                              TInt valueOfProgress) const = 0;
+
+};
+
+
+
+class CaUninstallObserver: public QObject, public IUninstallObserver
+{
+    Q_OBJECT
+public:
+    /**
+     * Constructor.
+     * @param parent pointer to parent. Defaults to NULL.
+     */
+    CaUninstallObserver(QObject *parent = 0);
+
+    /**
+     * Destructor.
+     */
+    ~CaUninstallObserver();
+    
+    /**
+     * Method invoked when entry is changed.
+     * @param entryId entry id.
+     * @param changeType change type.
+     */
+    void progressChange(TInt componentId,
+                              TInt valueOfProgress) const;
+
+
+signals:
+
+    void signalprogressChange(int componentId, int valueOfProgress) const;
+};
+
+
+#endif /* CAUINSTALLOBSERVER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/src/caprogresscanner.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,165 @@
+/*
+ * 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:  ?Description
+ *
+ */
+
+#include <s32mem.h>
+
+#include <usif/scr/scr.h>
+#include <usif/scr/screntries.h>
+
+#include "caprogresscanner.h"
+#include "caarraycleanup.inl"
+
+using namespace Usif;
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+EXPORT_C CCaProgresScanner* CCaProgresScanner::NewL( IUninstallObserver* aObserver )
+    {
+    CCaProgresScanner* self = new ( ELeave ) CCaProgresScanner( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaProgresScanner::~CCaProgresScanner()
+    {
+    delete iNotifier;
+    iSoftwareRegistry.Close();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaProgresScanner::CCaProgresScanner( IUninstallObserver* aObserver ) :
+    iObserver( aObserver )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::ConstructL()
+    {
+    iNotifier = CSifOperationsNotifier::NewL( *this );
+    User::LeaveIfError( iSoftwareRegistry.Connect() );//user leave if error.
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::StartOperationHandler( TUint aKey,
+        const CSifOperationStartData& aStartData )
+    {
+    //TODO: temporary solution. Some error in scr was found
+    if( aStartData.OperationPhase() == EUninstalling 
+            || aStartData.OperationPhase() == EInstalling )
+        {
+        TRAP_IGNORE(
+                iComponentId = iSoftwareRegistry.GetComponentIdL(
+                        aStartData.GlobalComponentId(), 
+                        aStartData.SoftwareType() );
+                SubscribeL( aKey ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::EndOperationHandler(
+        const CSifOperationEndData& aEndData )
+    {
+    TRAP_IGNORE( EndOperationL( aEndData.ErrorCode() ) );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::ProgressOperationHandler(
+        const CSifOperationProgressData& aProgressData )
+    {
+    TRAP_IGNORE( UpdateProgressL( aProgressData ) );
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::UpdateProgressL(
+        const CSifOperationProgressData& aProgressData )
+    {
+    if( aProgressData.Phase() == EUninstalling )
+        {
+        iObserver->progressChange( iComponentId, aProgressData.CurrentProgess() );
+        }
+    else
+    	{
+        //TODO: temporary solution. Some error in scr was found
+        //Progress should be remove for different operation
+        iObserver->progressChange( iComponentId, -1 );
+		CancelSubscribeL();
+    	}
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::EndOperationL( TInt aError )
+    {
+    if( aError == KErrNone )
+        {
+        iObserver->progressChange( iComponentId, 100 );
+        }
+    else
+        {
+        //information for observer that uninstallation was failed
+        iObserver->progressChange( iComponentId, aError ); 
+        }
+    CancelSubscribeL();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::CancelSubscribeL()
+	{
+	iNotifier->CancelSubscribeL( iKey );
+	}
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaProgresScanner::SubscribeL( TUint aKey )
+    {
+    iKey = aKey;
+    iNotifier->SubscribeL( aKey, ETrue );
+    iObserver->progressChange( iComponentId, 0 );
+    }
--- a/contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casoftwareregistry/s60/src/casoftwareregistry_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -15,42 +15,38 @@
  *
  */
 #include <HbParameterLengthLimiter>
+#include <HbExtendedLocale>
 #include <QMetaType>
 #include <QScopedPointer>
 #include <QStringList>
-
+#include <QDateTime>
+#undef SYMBIAN_ENABLE_SPLIT_HEADERS //TODO this is work around
+#include <usif/scr/screntries.h>
 #include <usif/scr/scr.h>
-#include <usif/scr/screntries.h>
 #include <xqconversions.h>
 #include <driveinfo.h>
 
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
 #include "casoftwareregistry.h"
 #include "casoftwareregistry_p.h"
+#include "cadefs.h"
+#include "caarraycleanup.inl"
 
 using namespace Usif;
 
 _LIT(KConfirmMessageKey, "MIDlet-Delete-Confirm");
+_LIT(KCaScrPropertyDomainCategory, "Domain-Category");
+_LIT(KCaScrPropertyMidletDescryption, "MIDlet-Description");
+const int maxLogsCount = 20;  // should be 50 - workaround for 
+// ou1cimx1#476143 Dialog crash when label contains big amount of lines
 
-template <typename RClass>
-struct RClassDeleter
-{
-    static inline void cleanup(RClass *ptr)
-    {
-        ptr->Close();
-    }
-};
-
-typedef QScopedPointer<RSoftwareComponentRegistry, 
-    RClassDeleter<RSoftwareComponentRegistry> > ScrScopedPointer;
-    
-typedef QScopedPointer<RFs, 
-    RClassDeleter<RFs> > RFSScopedPointer;
 /*!
  Constructor
  \param servicePublic Pointer to object of the public class.
  */
 CaSoftwareRegistryPrivate::CaSoftwareRegistryPrivate(
-    CaSoftwareRegistry *servicePublic):
+        CaSoftwareRegistry *servicePublic):
     m_q(servicePublic)
 {
 }
@@ -60,6 +56,7 @@
  */
 CaSoftwareRegistryPrivate::~CaSoftwareRegistryPrivate()
 {
+    
 }
 
 /*!
@@ -74,15 +71,15 @@
  */
 
 bool CaSoftwareRegistryPrivate::getUninstallDetails(int componentId,
-    QString &componentName,
-    QStringList &applicationsUids,
-    QString &confirmationMessage)
+        QString &componentName,
+        QStringList &applicationsUids,
+        QString &confirmationMessage)
 {
     TRAPD(error, getUninstallDetailsL(componentId,
-        componentName,
-        applicationsUids,
-        confirmationMessage)
-         );
+            componentName,
+            applicationsUids,
+            confirmationMessage)
+             );
     return error == KErrNone;
 }
 
@@ -95,7 +92,7 @@
  */
 
 bool CaSoftwareRegistryPrivate::getApplicationsUids(int componentId,
-    QStringList &applicationsUids)
+        QStringList &applicationsUids)
 {
     TRAPD(error, getApplicationsUidsL(componentId, applicationsUids));
     return error == KErrNone;
@@ -112,9 +109,9 @@
       null string means the lack of the message.
  */
 void CaSoftwareRegistryPrivate::getUninstallDetailsL(int componentId,
-    QString &componentName,
-    QStringList &appUids,
-    QString &confirmationMessage)
+        QString &componentName,
+        QStringList &appUids,
+        QString &confirmationMessage)
 {
     componentName.clear();
     appUids.clear();
@@ -132,18 +129,18 @@
 
         CComponentEntry *entry = CComponentEntry::NewLC();
         softwareComponentRegistry.GetComponentL(componentId, *entry);
-        softwareComponentRegistry.GetAppUidsForComponentL(componentIdValue,
-            appUidsArray);
+        softwareComponentRegistry.GetAppUidsForComponentL(
+                componentIdValue, appUidsArray);
 
-        CPropertyEntry *confirmationProperty =
-            softwareComponentRegistry.GetComponentPropertyL(componentId,
-            KConfirmMessageKey);
-        if (confirmationProperty &&
-            confirmationProperty->PropertyType() ==
-                CPropertyEntry::ELocalizedProperty) {
-            confirmationMessageProperty =
-                static_cast<CLocalizablePropertyEntry *>(
-                    confirmationProperty);
+        CPropertyEntry *confirmationProperty
+                = softwareComponentRegistry.GetComponentPropertyL(
+                        componentId, KConfirmMessageKey);
+        if (confirmationProperty
+                && confirmationProperty->PropertyType()
+                        == CPropertyEntry::ELocalizedProperty) {
+            confirmationMessageProperty
+                    = static_cast<CLocalizablePropertyEntry *>(
+                            confirmationProperty);
         } else {
             delete confirmationProperty;
             confirmationProperty = NULL;
@@ -156,7 +153,7 @@
             }
             if (confirmationMessageProperty) {
                 confirmationMessage = XQConversions::s60DescToQString(
-                    confirmationMessageProperty->StrValue());
+                        confirmationMessageProperty->StrValue());
             }
         );
 
@@ -184,8 +181,8 @@
         CleanupClosePushL(softwareComponentRegistry);
         User::LeaveIfError(softwareComponentRegistry.Connect());
 
-        softwareComponentRegistry.GetAppUidsForComponentL(componentIdValue,
-            appUidsArray);
+        softwareComponentRegistry.GetAppUidsForComponentL(
+                componentIdValue, appUidsArray);
 
         QT_TRYCATCH_LEAVING(
             for (TInt i = 0; i<appUidsArray.Count(); i++) {
@@ -199,30 +196,67 @@
 /*!
  \param componentId Component id of the entry which details are requested for.
  \return Map of component details if component id was greater than 0 or
- empty map otherwise. 
+ empty map otherwise.
  */
 CaSoftwareRegistryPrivate::DetailMap CaSoftwareRegistryPrivate::entryDetails(
     int componentId) const
 {
     CaSoftwareRegistry::DetailMap result;
+    TRAP_IGNORE(result=entryDetailsL(componentId));
+    return result;
+}
+
+/*!
+ \param componentId Component id of the entry which details are requested for.
+ \return Map of component details if component id was greater than 0 or
+ empty map otherwise.
+ */
+CaSoftwareRegistryPrivate::DetailMap CaSoftwareRegistryPrivate::entryDetailsL(
+    int componentId) const
+{
+    CaSoftwareRegistry::DetailMap result;
 
     if (componentId >= 1) {
-        RSoftwareComponentRegistry softwareComponentRegistry;
-        ScrScopedPointer scr(&softwareComponentRegistry);
-        if (scr->Connect() == KErrNone) {
-            
-            QScopedPointer<CComponentEntry> entry;
-            
-            QT_TRAP_THROWING(entry.reset(CComponentEntry::NewL()));
-            
-            TBool resultCode = EFalse;
-            TRAPD(leaveCode, resultCode = scr->GetComponentL(componentId, *entry));
-            if (leaveCode == KErrNone && resultCode) {
-                result = entryDetails(*entry);
+        RSoftwareComponentRegistry scr;
+        CleanupClosePushL(scr);
+        if (scr.Connect() == KErrNone) {
+            CComponentEntry* entry = CComponentEntry::NewLC();
+            if (scr.GetComponentL(componentId, *entry)) {
+                result = entryDetailsL(*entry);
+                if (entry->SoftwareType().Compare(KSoftwareTypeJava) == 0) {
+                    CPropertyEntry* domainProperty =
+                        scr.GetComponentPropertyL(componentId,
+                            KCaScrPropertyDomainCategory);
+                    CleanupStack::PushL(domainProperty);
+                    if (domainProperty &&
+                        domainProperty->PropertyType() ==
+                            CPropertyEntry::ELocalizedProperty) {
+                        result[CaSoftwareRegistry::componentProtectionDomainKey()] =
+                            XQConversions::s60DescToQString(
+                                static_cast<CLocalizablePropertyEntry*>(
+                                    domainProperty)->StrValue());
+                    }
+
+                    CPropertyEntry *midletDescryption =
+                        scr.GetComponentPropertyL(componentId,
+                            KCaScrPropertyMidletDescryption);
+                    CleanupStack::PushL(midletDescryption);
+                    if (midletDescryption &&
+                        midletDescryption->PropertyType() ==
+                            CPropertyEntry::ELocalizedProperty) {
+                        result[CaSoftwareRegistry::componentDescriptionKey()] =
+                            XQConversions::s60DescToQString(
+                                static_cast<CLocalizablePropertyEntry*>(
+                                    midletDescryption)->StrValue());
+                    }
+                    CleanupStack::PopAndDestroy(midletDescryption);
+                    CleanupStack::PopAndDestroy(domainProperty);
+                }
             }
+            CleanupStack::PopAndDestroy(entry);
         }
+        CleanupStack::PopAndDestroy(&scr);
     }
-    
     return result;
 }
 
@@ -230,97 +264,190 @@
  \param entry Software registry entry providing details.
  \return Map with details for the component represented by \entry.
  */
-CaSoftwareRegistryPrivate::DetailMap CaSoftwareRegistryPrivate::entryDetails(
+CaSoftwareRegistryPrivate::DetailMap CaSoftwareRegistryPrivate::entryDetailsL(
     const CComponentEntry& entry) const
 {
     CaSoftwareRegistry::DetailMap detailMap;
-    
-    detailMap[CaSoftwareRegistry::componentNameKey()] = 
+
+    detailMap[CaSoftwareRegistry::componentNameKey()] =
         XQConversions::s60DescToQString(entry.Name());
-        
-    detailMap[CaSoftwareRegistry::componentVersionKey()] = 
+
+    detailMap[CaSoftwareRegistry::componentVersionKey()] =
         XQConversions::s60DescToQString(entry.Version());
-    
-    detailMap[CaSoftwareRegistry::componentVendorKey()] = 
+
+    detailMap[CaSoftwareRegistry::componentVendorKey()] =
         XQConversions::s60DescToQString(entry.Vendor());
-        
+
     QString drives;
     QString drv;
-    TChar drive;    
-    
+    TChar drive;
+
     const TInt driveListLen(entry.InstalledDrives().Length());
     for (TInt i( 0 ); i < driveListLen; ++i) {
         if (entry.InstalledDrives()[i] != '\0') {
-            
+
             if (!drives.isEmpty()) {
                 drives = drives.append(",");
-            }  
+            }
             drv = QString(QChar('A'+ i)).append(":");
             if(DriveInfo::GetDefaultDrive(
-                    DriveInfo::EDefaultPhoneMemory, drive ) == KErrNone 
-                    && QChar('A'+ i) == QChar(drive))
-                {
-                drives = drives.append(
-                        HbParameterLengthLimiter("txt_applib_dialog_1_device_memory").arg(
-                          QString(QChar('A'+ i))));
-                }
-            else if(DriveInfo::GetDefaultDrive(
-                    DriveInfo::EDefaultMassStorage, drive ) == KErrNone 
-                    && QChar('A'+ i) == QChar(drive))
-                {
-                drives = drives.append(
-                        HbParameterLengthLimiter("txt_applib_dialog_1_mass_storage").arg(
-                          QString(QChar('A'+ i))));
-                }
-            else if(DriveInfo::GetDefaultDrive(
-                    DriveInfo::EDefaultRemovableMassStorage, drive ) == KErrNone 
-                    && QChar('A'+ i) == QChar(drive))
-                {
+                    DriveInfo::EDefaultPhoneMemory, drive ) == KErrNone
+                    && QChar('A'+ i) == QChar(drive)) {
+                drives = drives.append(HbParameterLengthLimiter(
+                        "txt_applib_dialog_1_device_memory").arg(
+                                QString(QChar('A'+ i))));
+            } else if(DriveInfo::GetDefaultDrive(
+                    DriveInfo::EDefaultMassStorage, drive ) == KErrNone
+                    && QChar('A'+ i) == QChar(drive)) {
+                drives = drives.append(HbParameterLengthLimiter(
+                        "txt_applib_dialog_1_mass_storage").arg(
+                                QString(QChar('A'+ i))));
+                } else if(DriveInfo::GetDefaultDrive(
+                    DriveInfo::EDefaultRemovableMassStorage, drive ) == KErrNone
+                    && QChar('A'+ i) == QChar(drive)) {
                 RFs fs;
-                RFSScopedPointer fSPointer(&fs);
+                CleanupClosePushL(fs);
                 if (fs.Connect() == KErrNone) {
                     TInt driveNumber;
                     TVolumeInfo tv;
                     DriveInfo::GetDefaultDrive(
-                            DriveInfo::EDefaultRemovableMassStorage, driveNumber );
-                    qt_symbian_throwIfError(fs.Volume(tv, driveNumber));
-                    if(tv.iName.Length()) { 
-                        drives = drives.append(
-                                HbParameterLengthLimiter("txt_applib_dialog_1_2").arg(
-                                   QString(QChar('A'+ i))).arg(
-                                           XQConversions::s60DescToQString(tv.iName)));                       
-                    }
-                    else {
-                        drives = drives.append(
-                            HbParameterLengthLimiter("txt_applib_dialog_1_memory_card").arg(
-                              QString(QChar('A'+ i))));           
+                            DriveInfo::EDefaultRemovableMassStorage,
+                            driveNumber );
+                    User::LeaveIfError(fs.Volume(tv, driveNumber));
+                    if(tv.iName.Length()) {
+                        drives = drives.append(HbParameterLengthLimiter(
+                                "txt_applib_dialog_1_2").arg(
+                                        QString(QChar('A'+ i))).arg(
+                                                XQConversions::s60DescToQString(
+                                                        tv.iName)));
+                    } else {
+                        drives = drives.append(HbParameterLengthLimiter(
+                                "txt_applib_dialog_1_memory_card").arg(
+                                        QString(QChar('A'+ i))));
                     }
                 }
+                CleanupStack::PopAndDestroy(&fs);
             } else {
-                drives = drives.append(QChar('A'+ i)).append(":");   
+                drives = drives.append(QChar('A'+ i)).append(":");
             }
         }
     }
-    
     detailMap[CaSoftwareRegistry::componentDriveInfoKey()] = drives;
-    
 
     static const TInt64 KKilo = 1024;
     static const TInt64 KMega = KKilo * KKilo;
     if(entry.ComponentSize() >= KMega) {
-        detailMap[CaSoftwareRegistry::componentSizeKey()] = 
-            HbParameterLengthLimiter("txt_applib_dialog_l1_mb").arg(
-                    static_cast<double>(entry.ComponentSize() / KMega));
+        detailMap[CaSoftwareRegistry::componentSizeKey()]
+                  = HbParameterLengthLimiter("txt_applib_dialog_l1_mb").arg(
+                          static_cast<double>(entry.ComponentSize() / KMega));
+    } else {
+        detailMap[CaSoftwareRegistry::componentSizeKey()]
+                  = HbParameterLengthLimiter("txt_applib_dialog_l1_kb").arg(
+                          static_cast<double>(entry.ComponentSize() / KKilo));
     }
-    else {
-        detailMap[CaSoftwareRegistry::componentSizeKey()] = 
-            HbParameterLengthLimiter("txt_applib_dialog_l1_kb").arg(
-                    static_cast<double>(entry.ComponentSize() / KKilo));
-    }
-
-    
-    detailMap[CaSoftwareRegistry::componentTypeKey()] = 
+    detailMap[CaSoftwareRegistry::componentTypeKey()] =
         XQConversions::s60DescToQString(entry.SoftwareType());
 
     return detailMap;
 }
+
+/*!
+ \param entry Software registry entry providing details.
+ \return Map with details for the component represented by \entry.
+ */
+QList<CaSoftwareRegistryPrivate::DetailMap>
+        CaSoftwareRegistryPrivate::retrieveLogEntries() const
+{
+    QList<CaSoftwareRegistryPrivate::DetailMap> logMap;
+    TRAP_IGNORE(logMap = retrieveLogEntriesL());
+    return logMap;
+}
+/*!
+ Creating uninstall notifier
+ \return CaUninstallNotifier instance
+ */
+CaUninstallNotifier *CaSoftwareRegistryPrivate::createUninstallNotifier() const
+{
+    return CaUninstallNotifier::notifier();
+}
+
+/*!
+ \param entry Software registry entry providing installation log.
+ \return List of Maps with installation log.
+ */
+QList<CaSoftwareRegistryPrivate::DetailMap>
+        CaSoftwareRegistryPrivate::retrieveLogEntriesL() const
+{
+    QList<CaSoftwareRegistryPrivate::DetailMap> logList;
+
+    RSoftwareComponentRegistry scr;
+    CleanupClosePushL(scr);
+    User::LeaveIfError(scr.Connect());
+
+    RPointerArray<CScrLogEntry> logEntries;
+    CleanupResetAndDestroyPushL(logEntries);
+    scr.RetrieveLogEntriesL(logEntries);
+
+    // 50 log items or less - ui spec
+    TInt lastLog(0);
+    if (logEntries.Count() > maxLogsCount) {
+        lastLog = logEntries.Count() - maxLogsCount;
+    }
+    // iteration through most recent log to the last
+    for (TInt i = logEntries.Count() - 1; i >= lastLog; i--) {
+        CScrLogEntry* entry = logEntries[i];
+        DetailMap logMap;
+        logMap[CaSoftwareRegistry::componentNameKey()]
+               = XQConversions::s60DescToQString(entry->ComponentName());
+        logMap[CaSoftwareRegistry::componentVersionKey()]
+               = XQConversions::s60DescToQString(entry->ComponentVersion());
+        logMap[CaSoftwareRegistry::componentTimeKey()]
+               = operationTime(entry->OperationTime());
+        logMap[CaSoftwareRegistry::componentOperationTypeKey()]
+               = operationTypeL(entry->OperationType());
+        logList.append(logMap);
+    }
+    CleanupStack::PopAndDestroy(&logEntries);
+    CleanupStack::PopAndDestroy(&scr);
+
+    return logList;
+}
+
+/*!
+ \param operation type.
+ \return string representing operation type.
+ */
+QString CaSoftwareRegistryPrivate::operationTypeL(int operationType) const
+{
+    QString opType;
+    switch (operationType) {
+        case EScrCompInstall:
+            opType = CaSoftwareRegistry::componentInstallValue();
+            break;
+        case EScrCompUnInstall:
+            opType = CaSoftwareRegistry::componentUninstallValue();
+            break;
+        case EScrCompUpgrade:
+            opType = CaSoftwareRegistry::componentUpgradeValue();
+            break;
+        case EScrCompHidden:
+            opType = CaSoftwareRegistry::componentHiddenValue();
+            break;
+        default:
+            User::Leave(KErrNotSupported);
+            break;
+    }
+    return opType;
+}
+
+/*!
+ \param operation type.
+ \return string representing operation type.
+ */
+QString CaSoftwareRegistryPrivate::operationTime(TTime time) const
+{
+    TDateTime dt = time.DateTime();
+    QDate date(dt.Year(), dt.Month() + 1, dt.Day() + 1);
+    HbExtendedLocale hbLoc;
+    return hbLoc.format(date, r_qtn_date_usual_with_zero);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/src/cauninstallnotifier_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: canotifier.cpp
+ *
+ */
+
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
+#include "caprogresscanner.h"
+#include "cauninstallobserver.h"
+#include "casoftwareregistry.h"
+
+/*!
+ Constructor.
+ \param notifierFilter descrbies entries to observe.
+ */
+CaUninstallNotifierPrivate::CaUninstallNotifierPrivate() :
+    mUninstallObserver(NULL), mProgressScanner(NULL),
+    mCaSoftwareRegistry(CaSoftwareRegistry::create()),
+    m_q(NULL)
+{
+    mUninstallObserver = new CaUninstallObserver();
+    TRAP_IGNORE(mProgressScanner = CCaProgresScanner::NewL(mUninstallObserver));
+}
+
+/*!
+ Destructor.
+ */
+CaUninstallNotifierPrivate::~CaUninstallNotifierPrivate()
+{
+    delete mProgressScanner;
+    delete mUninstallObserver;
+}
+
+void CaUninstallNotifierPrivate::makeConnect()
+{
+    connect(mUninstallObserver, SIGNAL(signalprogressChange(int, int)), 
+            m_q, SIGNAL(progressChange(int, int)));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/s60/src/cauninstallobserver.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include <QDebug>
+#include "cauninstallobserver.h"
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaUninstallObserver::CaUninstallObserver(QObject *parent) :
+    QObject(parent)
+{
+}
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaUninstallObserver::~CaUninstallObserver()
+{
+}
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+void CaUninstallObserver::progressChange(TInt componentId,
+                              TInt valueOfProgress) const
+{
+    qDebug() << "CaClientProxy::groupContentChanged groupId:" << componentId;
+
+    emit signalprogressChange(int(componentId), int(valueOfProgress));
+}
+
--- a/contentstorage/casoftwareregistry/src/casoftwareregistry.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casoftwareregistry/src/casoftwareregistry.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -18,7 +18,7 @@
 #include <QString>
 #include <QStringList>
 
-
+#include "cauninstallnotifier.h"
 #include "casoftwareregistry.h"
 #include "casoftwareregistry_p.h"
 
@@ -42,12 +42,12 @@
  Subsequent calls to CaSoftwareRegistry::create() may return pointers to different
  instances. It is a case when between the calls instance counter of the created
  object dropped to 0 and it was deleted.
- 
+
  */
 
 /*! \typedef typedef QHash<QString, QString> DetailMap;
  * Defines map type for component details.
- * 
+ *
  */
 
 /*!
@@ -57,7 +57,7 @@
 
 
 // Initialization of a static member variable.
-QWeakPointer<CaSoftwareRegistry> CaSoftwareRegistry::m_instance = 
+QWeakPointer<CaSoftwareRegistry> CaSoftwareRegistry::m_instance =
     QWeakPointer<CaSoftwareRegistry>();
 
 
@@ -149,7 +149,7 @@
  \endcode
  \param componentId Component id of the entry details are requested for.
  \return Map of the component details if component id was greater than 0 or
- empty map otherwise. 
+ empty map otherwise.
 
  */
 CaSoftwareRegistry::DetailMap CaSoftwareRegistry::entryDetails(
@@ -159,6 +159,25 @@
 }
 
 /*!
+ The method provides installation details from USIF.
+ \return QList of DetailMap.
+ */
+QList<CaSoftwareRegistry::DetailMap>
+        CaSoftwareRegistry::retrieveLogEntries() const
+{
+    return m_d->retrieveLogEntries();
+}
+
+/*!
+ Creates uninstall notifier.
+ \retval pointer to created CaUninstallNotifier instance.
+ */
+CaUninstallNotifier *CaSoftwareRegistry::createUninstallNotifier() const
+{
+    return m_d->createUninstallNotifier();
+}
+
+/*!
  * \return Component name key in CaSoftwareRegistry::DetailMap.
  */
 QString CaSoftwareRegistry::componentNameKey()
@@ -195,6 +214,15 @@
 }
 
 /*!
+ * \return Component protection domainkey in CaSoftwareRegistry::DetailMap.
+ */
+QString CaSoftwareRegistry::componentProtectionDomainKey()
+{
+    static const QString key("protectiondomain");
+    return key;
+}
+
+/*!
  * \return Component size info key in CaSoftwareRegistry::DetailMap.
  */
 QString CaSoftwareRegistry::componentSizeKey()
@@ -212,3 +240,72 @@
     return key;
 }
 
+/*!
+ * \return Component description key in CaSoftwareRegistry::DetailMap.
+ */
+QString CaSoftwareRegistry::componentDescriptionKey()
+{
+    static const QString key("description");
+    return key;
+}
+
+/*!
+ * \return Component instalation/uninstallation
+ * time key in CaSoftwareRegistry::DetailMap.
+ */
+QString CaSoftwareRegistry::componentTimeKey()
+{
+    static const QString key("time");
+    return key;
+}
+
+/*!
+ * \return Component instalation/uninstallation/upgrade/hidden
+ * operation type key in CaSoftwareRegistry::DetailMap.
+ */
+QString CaSoftwareRegistry::componentOperationTypeKey()
+{
+    static const QString key("operationType");
+    return key;
+}
+
+/*!
+ * \return Component instalation
+ * operation value in CaSoftwareRegistry::DetailMap.
+ */
+QString CaSoftwareRegistry::componentInstallValue()
+{
+    static const QString value("install");
+    return value;
+}
+
+/*!
+ * \return Component uninstallation
+ * operation value in CaSoftwareRegistry::DetailMap.
+ */
+QString CaSoftwareRegistry::componentUninstallValue()
+{
+    static const QString value("uninstall");
+    return value;
+}
+
+/*!
+ * \return Component upgrade
+ * operation value in CaSoftwareRegistry::DetailMap.
+ */
+QString CaSoftwareRegistry::componentUpgradeValue()
+{
+    static const QString value("upgrade");
+    return value;
+}
+
+/*!
+ * \return Component hidden
+ * operation value in CaSoftwareRegistry::DetailMap.
+ */
+QString CaSoftwareRegistry::componentHiddenValue()
+{
+    static const QString value("hidden");
+    return value;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/src/cauninstallnotifier.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: canotifier.cpp
+ *
+ */
+
+
+#include <QCoreApplication>
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
+
+QSharedPointer<CaUninstallNotifier> CaUninstallNotifier::mInstance(0);
+
+/*!
+ Constructor.
+ \param entryPrivate pointer to private implementation.
+ */
+CaUninstallNotifier::CaUninstallNotifier(CaUninstallNotifierPrivate *const notifierPrivate) :
+    QObject(0), m_d(notifierPrivate)
+{
+    m_d->m_q = this;
+    m_d->makeConnect();
+}
+
+/*!
+ Destructor.
+ */
+CaUninstallNotifier::~CaUninstallNotifier()
+{
+    delete m_d;
+}
+
+CaUninstallNotifier* CaUninstallNotifier::notifier()
+{
+    if (!mInstance.data()) {
+        mInstance = QSharedPointer<CaUninstallNotifier>(
+                new CaUninstallNotifier(new CaUninstallNotifierPrivate()));
+        mInstance->setParent(QCoreApplication::instance());
+    }
+    return mInstance.data();
+}
+
+
--- a/contentstorage/casoftwareregistry/stub/inc/casoftwareregistry_p.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casoftwareregistry/stub/inc/casoftwareregistry_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -23,25 +23,28 @@
 
 class QStringList;
 class CaSoftwareRegistry;
+class CaUninstallNotifier;
 
 class CaSoftwareRegistryPrivate
 {
 public:
     typedef QHash<QString, QString> DetailMap;
-    
+
     explicit CaSoftwareRegistryPrivate(
         CaSoftwareRegistry *softwareRegistryPublic);
     ~CaSoftwareRegistryPrivate();
 
-    bool getApplicationsUids(int componentId,
-        QStringList &applicationsUids);
-
     bool getUninstallDetails(int componentId,
         QString &componentName,
         QStringList &applicationsUids,
         QString &confirmationMessage);
 
+    bool getApplicationsUids(int componentId,
+        QStringList &appUids);
     DetailMap entryDetails(int componentId) const;
+
+    QList<DetailMap> retrieveLogEntries() const;
+    CaUninstallNotifier *createUninstallNotifier() const;
 private:
 
     CaSoftwareRegistry *const m_q;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/stub/inc/cauninstallnotifier_p.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: canotifier.h
+ *
+ */
+
+#ifndef CAUNINSTALLNOTIFIER_P_H
+#define CAUNINSTALLNOTIFIER_P_H
+
+#include <QObject>
+#include <QSharedPointer>
+class CaUninstallObserver;
+class CaUninstallNotifier;
+class CaSoftwareRegistry;
+
+class CaUninstallNotifierPrivate: public QObject
+{
+Q_OBJECT
+
+public:
+
+    explicit CaUninstallNotifierPrivate();
+
+    virtual ~CaUninstallNotifierPrivate();
+    
+    void makeConnect();
+
+private:
+    CaUninstallObserver* mUninstallObserver;
+    QSharedPointer<CaSoftwareRegistry> mCaSoftwareRegistry;
+    
+    const CaUninstallNotifier *m_q;
+    friend class CaUninstallNotifier;
+
+};
+
+
+#endif // CAUNINSTALLNOTIFIER_P_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/stub/inc/cauninstallobserver.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ *  Description : Content Arsenal client session
+ *
+ */
+
+#ifndef CAUINSTALLOBSERVER_H_
+#define CAUINSTALLOBSERVER_H_
+
+#include <QObject>
+
+
+class CaUninstallObserver: public QObject
+{
+    Q_OBJECT
+public:
+    /**
+     * Constructor.
+     * @param parent pointer to parent. Defaults to NULL.
+     */
+    CaUninstallObserver(QObject *parent = 0);
+
+    /**
+     * Destructor.
+     */
+    ~CaUninstallObserver();
+    
+};
+
+
+#endif /* CAUINSTALLOBSERVER_H_ */
--- a/contentstorage/casoftwareregistry/stub/src/casoftwareregistry_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casoftwareregistry/stub/src/casoftwareregistry_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -18,7 +18,8 @@
 #include <QMetaType>
 #include <QStringList>
 
-
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
 #include "casoftwareregistry.h"
 #include "casoftwareregistry_p.h"
 
@@ -88,20 +89,42 @@
     int componentId) const
 {
     CaSoftwareRegistry::DetailMap detailMap;
-    
+
     if (componentId >=1) {
-        detailMap[CaSoftwareRegistry::componentNameKey()] = "no data";
-            
-        detailMap[CaSoftwareRegistry::componentVersionKey()] = "no data";
-        
-        detailMap[CaSoftwareRegistry::componentVendorKey()] = "no data";
-                
-        detailMap[CaSoftwareRegistry::componentDriveInfoKey()] = "no data";
-        
-        detailMap[CaSoftwareRegistry::componentSizeKey()] = "no data";
-        
-        detailMap[CaSoftwareRegistry::componentTypeKey()] = "no data";
+        detailMap[CaSoftwareRegistry::componentNameKey()]       = "no data";
+        detailMap[CaSoftwareRegistry::componentVersionKey()]    = "no data";
+        detailMap[CaSoftwareRegistry::componentVendorKey()]     = "no data";
+		detailMap[CaSoftwareRegistry::componentProtectionDomainKey()] = "no data";
+        detailMap[CaSoftwareRegistry::componentDriveInfoKey()]  = "no data";
+        detailMap[CaSoftwareRegistry::componentSizeKey()]       = "no data";
+        detailMap[CaSoftwareRegistry::componentTypeKey()]       = "no data";
+        detailMap[CaSoftwareRegistry::componentDescriptionKey()] = "no data";
     }
-    return detailMap;    
+    return detailMap;
 }
 
+/*!
+ \param entry Software registry entry providing details.
+ \return Map with details for the component represented by \entry.
+ */
+QList<CaSoftwareRegistryPrivate::DetailMap>
+        CaSoftwareRegistryPrivate::retrieveLogEntries() const
+{
+    QList<CaSoftwareRegistryPrivate::DetailMap> logList;
+    DetailMap logMap;
+    logMap[CaSoftwareRegistry::componentNameKey()]          = "no data";
+    logMap[CaSoftwareRegistry::componentVersionKey()]       = "no data";
+    logMap[CaSoftwareRegistry::componentTimeKey()]          = "no data";
+    logMap[CaSoftwareRegistry::componentOperationTypeKey()] = "no data";
+    logList.append(logMap);
+    return logList;
+}
+
+/*!
+ Creating uninstall notifier
+ \return CaUninstallNotifier instance
+ */
+CaUninstallNotifier *CaSoftwareRegistryPrivate::createUninstallNotifier() const
+{
+    return CaUninstallNotifier::notifier();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/stub/src/cauninstallnotifier_p.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: canotifier.cpp
+ *
+ */
+
+#include "cauninstallnotifier.h"
+#include "cauninstallnotifier_p.h"
+#include "cauninstallobserver.h"
+#include "casoftwareregistry.h"
+
+/*!
+ Constructor.
+ \param notifierFilter descrbies entries to observe.
+ */
+CaUninstallNotifierPrivate::CaUninstallNotifierPrivate() :
+    mUninstallObserver(NULL),
+    mCaSoftwareRegistry(CaSoftwareRegistry::create()),
+    m_q(NULL)
+{
+    mUninstallObserver = new CaUninstallObserver();
+}
+
+/*!
+ Destructor.
+ */
+CaUninstallNotifierPrivate::~CaUninstallNotifierPrivate()
+{
+    delete mUninstallObserver;
+}
+
+void CaUninstallNotifierPrivate::makeConnect()
+{
+    connect(mUninstallObserver, SIGNAL(signalprogressChange(int, int)), 
+            m_q, SIGNAL(progressChange(int, int)));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/casoftwareregistry/stub/src/cauninstallobserver.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include <QDebug>
+#include "cauninstallobserver.h"
+
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaUninstallObserver::CaUninstallObserver(QObject *parent) :
+    QObject(parent)
+{
+}
+//----------------------------------------------------------------------------
+//
+//----------------------------------------------------------------------------
+CaUninstallObserver::~CaUninstallObserver()
+{
+}
+
--- a/contentstorage/casrv/caappscanner/inc/caappscannerhandler.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/caappscanner/inc/caappscannerhandler.h	Wed Aug 18 10:05:49 2010 +0300
@@ -59,9 +59,11 @@
     /**
      * Symbien 2nd phase constructor.
      * @param aCaStorageProxy storage.
+     * @param aSoftwareRegistry software component registry.
      * @param aUtils storage utils.
      */
     void ConstructL( CCaStorageProxy& aCaStorageProxy,
+            Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
             CCaSrvEngUtils& aUtils );
 
 private:
--- a/contentstorage/casrv/caappscanner/inc/casrvappscanner.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/caappscanner/inc/casrvappscanner.h	Wed Aug 18 10:05:49 2010 +0300
@@ -30,10 +30,7 @@
 class CCaInnerEntry;
 class CCaStorageProxy;
 class CCaSrvEngUtils;
-namespace Swi
-    {
-    class RSisRegistryEntry;
-    }
+
 
 /**
  * Application scanner.
@@ -70,9 +67,11 @@
     /**
      * Two-phased constructor.
      * @param aCaStorageProxy storage.
+     * @param aSoftwareRegistry software component registry.
      * @param aUtils storage utils.
      */
     static CCaSrvAppScanner* NewL( CCaStorageProxy& aCaStorageProxy,
+            Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
             CCaSrvEngUtils& aUtils );
 
 private:
@@ -81,9 +80,11 @@
     /**
      * Constructor.
      * @param aCaStorageProxy storage.
+     * @param aSoftwareRegistry software component registry.
      * @param aUtils storage utils.
      */
     CCaSrvAppScanner( CCaStorageProxy& aCaStorageProxy,
+            Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
             CCaSrvEngUtils& aUtils );
 
     /**
@@ -161,9 +162,10 @@
     /**
      * Updates application's removable and visible flags.
      * @param aItem menu item.
+     * @param aMmcId MMC ID of currently inserted MMC, or 0.
      * @return ETrue if flags were updated.
      */
-    TBool HandleRemovableVisibleFlagsUpdateL( CCaInnerEntry* aItem );
+    TBool HandleRemovableFlagAndMmcAttrUpdateL( CCaInnerEntry* aItem, TUint aMmcId );
 
     /**
      * Removes application unninstall flag.
@@ -177,7 +179,7 @@
      * @param aItem menu item.
      * @return ETrue if flags were updated.
      */
-    TBool HandleMissingVisibleFlagsUpdate( CCaInnerEntry* aItem );
+    TBool HandleMissingFlagsUpdate( CCaInnerEntry* aItem );
 
     /**
      * Updates visible flag.
@@ -199,14 +201,8 @@
      * @param aMmcId MMC ID of currently inserted MMC, or 0.
      * @return ETrue if mmc attribute was updated.
      */
-    TBool HandleMmcAttrUpdateL( CCaInnerEntry* aItem, TUint aMmcId );
-
-    /**
-     * Check if application is in rom.
-     * Add new menu item referring to this application.
-     * @return ETrue if app is in rom.
-     */
-    TBool IsInRomL( TInt aUid );
+    TBool HandleMmcAttrUpdateL( const Usif::CComponentEntry* aEntry, 
+            CCaInnerEntry* aItem, TUint aMmcId );
 
     /**
      * Get applications from AppArc.
@@ -262,6 +258,55 @@
     TInt AddAppEntryL( TUint aUid, TUint aCurrentMmcId );
 
     /**
+     * Set CWRT ettributes to entry.
+     * @param aEntry CCaInnerEntry with application.
+     * @return ETrue if app info was updatedd
+     */
+    TBool SetCWRTAppL( CCaInnerEntry* aEntry );
+
+    /**
+     * Set Java attributes to entry.
+     * @param aEntry CCaInnerEntry with application.
+     * @return ETrue if app info was updatedd
+     */
+    TBool SetJavaAppL( CCaInnerEntry* aEntry );
+
+    /**
+     * Set information from TApaAppInfo to entry.
+     * @param aEntry CCaInnerEntry with application.
+     * @param info application informations from AppArc.
+     * @return ETrue if app info was updatedd
+     */
+    TBool SetAppCaptionL( CCaInnerEntry* aEntry, TApaAppInfo* info );
+
+    /**
+     * Gets component id from entry.
+     * @param aEntry CCaInnerEntry with application.
+     * @return component id
+     */
+    TInt GetComponentIdFromEntryL( CCaInnerEntry* aEntry );
+
+    /**
+     * Sets new attribute value.
+     * @param aEntry CCaInnerEntry with application.
+     * @param aKey attribute name.
+     * @param aValue attribute value.
+     * @return ETrue if attribute was updated or added
+     */
+    TBool AddAttributeL(
+            CCaInnerEntry* aEntry,
+            const TDesC& aKey,
+            const TDesC& aValue );
+    
+    /**
+     * Removes attribute from entry.
+     * @param aEntry CCaInnerEntry with application.
+     * @param aKey attribute name.
+     * @return ETrue if attribute was removed
+     */
+    TBool RemoveAttributeL( CCaInnerEntry* aEntry, const TDesC& aKey );
+
+    /**
      * Set information from TApaAppInfo to entry.
      * @param aEntry CCaInnerEntry with application.
      * @return ETrue if app info was updatedd
@@ -284,10 +329,10 @@
     void SetMissingFlagL( CCaInnerEntry* aEntry );
 
     /**
-     * Clear "visible" flag (and also "missing" and "used").
+     * Clear all flags.
      * @param aEntry entry.
      */
-    void ClearVisibleFlagL( CCaInnerEntry* aEntry );
+    void ClearAllFlagsL( CCaInnerEntry* aEntry );
 
     /**
      * Check currently inserted MMC card, update and save MMC history.
@@ -300,40 +345,17 @@
      * @return Current MMC id or 0.
      */
     TUint CurrentMmcId() const;
-
+    
     /**
-     * Check if file is on a given default drive type.
-     * @param aFileName File name.
+     * Check if drive letter is on a given default drive type.
+     * @param aDriveLetter drive letter .
      * @param aDefaultDrive default drive type
      * @return ETrue if aFileName is on a given default drive type.
      */
-    TBool IsFileInDrive( const TDesC& aFileName,
-            const DriveInfo::TDefaultDrives& aDefaultDrive ) const;
-
-    /**
-     * Check if application is installed on a given drive type.
-     * @param aUid app uid.
-     * @param aDefaultDrive default drive type.
-     * @return ETrue if app is installed on a given drive type.
-     */
-    TBool IsAppInDriveL( const TUid aUid,
+    TBool IsCharInDrive( const TChar& aDriveLetter,
             const DriveInfo::TDefaultDrives& aDefaultDrive ) const;
 
     /**
-     * Check if application is installed on MMC.
-     * @param aUid app uid.
-     * @return ETrue if app is installed on MMC.
-     */
-    TBool IsInMmcL( const TUid aUid ) const;
-
-    /**
-     * Check if application is installed on mass storage.
-     * @param aUid app uid.
-     * @return ETrue if app is installed on mass storage.
-     */
-    TBool IsInMassStorageL( const TUid aUid ) const;
-
-    /**
      * Check if drive's status is EDriveInUse.
      * @param aDefaultDrive default drive type.
      * @return ETrue if drive is in use.
@@ -381,7 +403,7 @@
      * @param aEntry entry being updated with component id attribute.
      * @return ETrue when component id attribute of the entry has been added or changed.
      */
-    TBool UpdateComponentIdL( CCaInnerEntry& aEntry ) const;
+    TBool UpdateComponentIdL( CCaInnerEntry& aEntry );
 
 private:
     // data
@@ -389,9 +411,9 @@
     RApaLsSession iApaLsSession; ///< AppArc session. Own.
     CCaSrvMmcHistory* iMmcHistory; ///< MMC history. Own.
     RFs iFs; ///< File Server Session. Own.
-    Usif::RSoftwareComponentRegistry iSoftwareRegistry;
-
+    
     CCaStorageProxy& iCaStorageProxy; ///< Not own
+    Usif::RSoftwareComponentRegistry& iSoftwareRegistry; ///< Not own
     CCaSrvEngUtils& iSrvEngUtils; ///< Not own
 
     TInt iCollectionDownloadId;
--- a/contentstorage/casrv/caappscanner/src/caappscannerhandler.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/caappscanner/src/caappscannerhandler.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -24,7 +24,8 @@
     CCaAppScannerHandler* self = new (ELeave) CCaAppScannerHandler(
             aPluginParams);
     CleanupStack::PushL(self);
-    self->ConstructL(*aPluginParams->storageProxy, *aPluginParams->engUtils);
+    self->ConstructL(*aPluginParams->storageProxy,
+	    *aPluginParams->softwareRegistry, *aPluginParams->engUtils);
     CleanupStack::Pop();
     return self;
     }
@@ -39,9 +40,11 @@
     }
 
 void CCaAppScannerHandler::ConstructL(CCaStorageProxy& aCaStorageProxy,
+        Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
         CCaSrvEngUtils& aUtils)
     {
-    iScanner = CCaSrvAppScanner::NewL(aCaStorageProxy, aUtils);
+    iScanner = CCaSrvAppScanner::NewL(aCaStorageProxy, aSoftwareRegistry,
+	    aUtils);
     }
 
 //  End of File
--- a/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/caappscanner/src/casrvappscanner.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -34,6 +34,8 @@
 
 using namespace Usif;
 
+
+
 // ==================== LOCAL FUNCTIONS ====================
 
 /**
@@ -69,10 +71,11 @@
 // ---------------------------------------------------------
 //
 CCaSrvAppScanner* CCaSrvAppScanner::NewL( CCaStorageProxy& aCaStorageProxy,
+        Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
         CCaSrvEngUtils& aUtils )
     {
     CCaSrvAppScanner* scanner = new ( ELeave ) CCaSrvAppScanner(
-            aCaStorageProxy, aUtils );
+            aCaStorageProxy, aSoftwareRegistry, aUtils );
     CleanupStack::PushL( scanner );
     scanner->ConstructL();
     CleanupStack::Pop( scanner );
@@ -86,7 +89,6 @@
 CCaSrvAppScanner::~CCaSrvAppScanner()
     {
     Cancel();
-    iSoftwareRegistry.Close();
     iApaLsSession.Close();
     delete iMmcHistory;
     iFs.Close();
@@ -97,9 +99,11 @@
 // ---------------------------------------------------------
 //
 CCaSrvAppScanner::CCaSrvAppScanner( CCaStorageProxy& aCaStorageProxy,
+        Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
         CCaSrvEngUtils& aUtils ) :
     CActive( CActive::EPriorityStandard ),
-    iCaStorageProxy( aCaStorageProxy ), iSrvEngUtils( aUtils )
+    iCaStorageProxy( aCaStorageProxy ),
+    iSoftwareRegistry(aSoftwareRegistry), iSrvEngUtils( aUtils )
     {
     CActiveScheduler::Add( this );
     }
@@ -126,7 +130,6 @@
     iMmcHistory->LoadL( iFs, KCaMmcHistoryFname() );
 
     User::LeaveIfError( iApaLsSession.Connect() );
-    User::LeaveIfError( iSoftwareRegistry.Connect() );
     iApaLsSession.SetNotify( EFalse, iStatus );
     iCollectionDownloadId = 0;
     iAllCollectionId = 0;
@@ -164,15 +167,14 @@
 				{
                 id = AddAppEntryL(
                         updatedAppsInfo[i].iAppUid.iUid, UpdateMmcHistoryL() );
+                AddEntryToDownloadedCollectionL( id );
 				}
 			else
 			    {
                 ASSERT( resultArray.Count() == 1 );
                 id = resultArray[0]->GetId();
                 UpdateAppEntryL( resultArray[0], UpdateMmcHistoryL(), ETrue );
-                AddEntryToPredefinedCollectionL( resultArray[0], ETrue );
-			    }
-            AddEntryToDownloadedCollectionL( id );
+                }
             MakeNotEmptyCollectionsVisibleL();
 			}
 		else if( action == TApaAppUpdateInfo::EAppNotPresent )
@@ -255,25 +257,40 @@
 // ---------------------------------------------------------
 //
 void CCaSrvAppScanner::UpdateAppEntryL(
-        CCaInnerEntry* aEntry, TUint aMmcId, TBool aAlwaysUpdate  )
+        CCaInnerEntry* aEntry, TUint aMmcId, TBool aAlwaysUpdate )
     {
-    TBool toUpdate = HandleMmcAttrUpdateL( aEntry, aMmcId );
-    TBool missingVisibleFlagChanged =
-        HandleMissingVisibleFlagsUpdate( aEntry );
-    toUpdate = missingVisibleFlagChanged || toUpdate;
-    toUpdate = HandleRemovableVisibleFlagsUpdateL( aEntry ) || toUpdate;
+    TBool missingFlagChanged = HandleMissingFlagsUpdate( aEntry );
+    TBool visibleFlagChanged = HandleVisibleFlagUpdate( aEntry );
+
+
+    // To handle case with mmc card. When mmc attritube is updated then
+    // used flag should be change. When aplication is update but
+    // it is not appear then this flag should be change too.
+    if( aAlwaysUpdate && !missingFlagChanged )
+        {
+        HandleUsedFlagUpdate( aEntry );
+        }
+    TBool toUpdate = missingFlagChanged || visibleFlagChanged;
     toUpdate = SetApaAppInfoL( aEntry ) || toUpdate;
+    toUpdate = HandleRemovableFlagAndMmcAttrUpdateL( aEntry, aMmcId ) || toUpdate;
     toUpdate = RemoveUninstallFlagL( aEntry ) || toUpdate;
 
     if( toUpdate || aAlwaysUpdate )
         {
         //update app in storage
-        HandleUsedFlagUpdate( aEntry );
         TItemAppearance itemAppearanceChange = EItemAppearanceNotChanged;
-        if( missingVisibleFlagChanged )
+        if( missingFlagChanged || visibleFlagChanged )
             {
             itemAppearanceChange = EItemAppeared;
             }
+        if( !missingFlagChanged )
+            {
+            AddEntryToPredefinedCollectionL( aEntry, ETrue );
+            if ( aEntry->GetFlags() & ERemovable )
+                {
+                AddEntryToDownloadedCollectionL( aEntry->GetId() );
+                }
+            }
         iCaStorageProxy.AddL( aEntry, EFalse, itemAppearanceChange );
         }
     }
@@ -283,42 +300,63 @@
 // ---------------------------------------------------------
 //
 TBool CCaSrvAppScanner::HandleMmcAttrUpdateL(
+        const Usif::CComponentEntry* aEntry,
         CCaInnerEntry* aItem, TUint aMmcId )
     {
-    TBool toUpdate( ETrue );
-    if( IsInMmcL( TUid::Uid( aItem->GetUid() ) ) )
+    TBool toChange( EFalse );
+    if( aEntry && aEntry->IsRemovable() )
         {
-        //app is instaled on mmc - KCaAttrMmcId attribute update
-        RBuf uidString;
-        uidString.CleanupClosePushL();
-        uidString.CreateL(KUidChars);
-        uidString.Format( KHexFormat, aMmcId );
-        aItem->AddAttributeL( KCaAttrMmcId, uidString );
-        CleanupStack::PopAndDestroy( &uidString );
-        }
-    else if ( IsInMassStorageL( TUid::Uid( aItem->GetUid() ) ) )
-        {
-        //its app installed on mass storage, we need to leave it
-        //in case of connecting usb in mass storage mode
-        aItem->AddAttributeL( KCaAttrMmcId, KCaMassStorage );
+        TChar currentDriveLetter;
+        if ( aEntry->SoftwareType().Compare(KCaAttrAppTypeValueNative()) != 0 )
+            {
+            TDriveList driveList = aEntry->InstalledDrives();
+            for ( TInt driveNr=EDriveY; driveNr >= EDriveA; driveNr-- )
+                {
+                if ( driveList[driveNr] )
+                    {
+                    User::LeaveIfError( iFs.DriveToChar( driveNr,
+                            currentDriveLetter ) );
+                    }
+                }
+            }
+        else
+            {
+            TApaAppInfo* appInfo = new ( ELeave ) TApaAppInfo();
+            if( !iApaLsSession.GetAppInfo( *appInfo,
+                    TUid::Uid( aItem->GetUid() ) ) )
+                {
+                currentDriveLetter = appInfo->iFullName[0];
+                }
+            }
+
+        if( IsCharInDrive( currentDriveLetter,
+                DriveInfo::EDefaultRemovableMassStorage ) )
+            {
+            //app is instaled on mmc - KCaAttrMmcId attribute update
+            RBuf uidString;
+            uidString.CleanupClosePushL();
+            uidString.CreateL( KUidChars );
+            uidString.Format( KHexFormat, aMmcId );
+            toChange = AddAttributeL( aItem, KCaAttrMmcId, uidString );
+            CleanupStack::PopAndDestroy( &uidString );
+            }
+        else if ( IsCharInDrive( currentDriveLetter, DriveInfo::EDefaultMassStorage ) )
+            {
+            //its app installed on mass storage, we need to leave it
+            //in case of connecting usb in mass storage mode
+            toChange = AddAttributeL( aItem, KCaAttrMmcId, KCaMassStorage );
+            }
+        else
+            {
+            toChange = RemoveAttributeL( aItem, KCaAttrMmcId );
+            }
         }
     else
         {
-        RBuf attrVal;
-        attrVal.CleanupClosePushL();
-        attrVal.CreateL( KCaMaxAttrValueLen );
-        if( aItem->FindAttribute( KCaAttrMmcId, attrVal ) )
-            {
-            aItem->RemoveAttributeL( KCaAttrMmcId );
-            }
-        else
-            {
-            toUpdate = EFalse;
-            }
-        CleanupStack::PopAndDestroy( &attrVal );
+        toChange = RemoveAttributeL( aItem, KCaAttrMmcId );
         //its installed on c: drive - remove attribute
         }
-    return toUpdate;
+    return toChange;
     }
 
 // ---------------------------------------------------------
@@ -359,11 +397,23 @@
 //
 // ---------------------------------------------------------
 //
-TBool CCaSrvAppScanner::HandleRemovableVisibleFlagsUpdateL(
-        CCaInnerEntry* aItem )
+TBool CCaSrvAppScanner::HandleRemovableFlagAndMmcAttrUpdateL(
+        CCaInnerEntry* aItem, TUint aMmcId )
     {
     TBool toChange( EFalse );
-    if( ( aItem->GetFlags() & EVisible ) && IsInRomL( aItem->GetUid() ) )
+    TComponentId compId = GetComponentIdFromEntryL( aItem );
+
+    TBool isRemovable( EFalse );
+    if( compId )
+        {
+        CComponentEntry* entry = CComponentEntry::NewLC();
+        iSoftwareRegistry.GetComponentL( compId , *entry );
+        isRemovable = entry->IsRemovable();
+        toChange = HandleMmcAttrUpdateL( entry, aItem, aMmcId );
+        CleanupStack::PopAndDestroy( entry );
+        }
+
+    if( ( aItem->GetFlags() & EVisible ) && !isRemovable )
         {
         if( ( aItem->GetFlags() & ERemovable ) != 0 )
             {
@@ -373,7 +423,7 @@
         }
     else
         {
-        if( ( aItem->GetFlags() & ERemovable ) == 0 )
+        if( ( aItem->GetFlags() & ERemovable ) == 0 && isRemovable )
             {
             aItem->SetFlags( aItem->GetFlags() | ERemovable );
             toChange = ETrue;
@@ -401,15 +451,14 @@
 //
 // ---------------------------------------------------------
 //
-TBool CCaSrvAppScanner::HandleMissingVisibleFlagsUpdate(
+TBool CCaSrvAppScanner::HandleMissingFlagsUpdate(
         CCaInnerEntry* aItem )
     {
     TBool ret( EFalse );
-    if( aItem->GetFlags() & EMissing ||
-        !( aItem->GetFlags() & EVisible ) )
+    if( aItem->GetFlags() & EMissing )
         {
-        //application found so we unset "missing" and set "visible" flags
-        aItem->SetFlags( aItem->GetFlags() & ~EMissing | EVisible );
+        //application found so we unset "missing" flag
+        aItem->SetFlags( aItem->GetFlags() & ~EMissing );
         ret = ETrue;
         }
     return ret;
@@ -789,8 +838,7 @@
     appEntry->SetRole( EItemEntryRole );
 
     SetApaAppInfoL( appEntry );
-    HandleRemovableVisibleFlagsUpdateL( appEntry );
-    HandleMmcAttrUpdateL( appEntry, aCurrentMmcId );
+    HandleRemovableFlagAndMmcAttrUpdateL( appEntry, aCurrentMmcId );
 
     iCaStorageProxy.AddL( appEntry );
     id = appEntry->GetId();
@@ -812,26 +860,8 @@
     CleanupStack::PushL(info);
     if( KErrNone == iSrvEngUtils.GetAppInfo( *aEntry, *info ) )
         {
-        RBuf attrVal;
-        attrVal.CleanupClosePushL();
-        attrVal.CreateL( KCaMaxAttrValueLen );
-        aEntry->FindAttribute( KCaAttrShortName, attrVal );
-        if( attrVal.Compare( info->iShortCaption ) != KErrNone
-                || aEntry->GetText().Compare( info->iCaption )
-                        != KErrNone )
-            {
-            aEntry->SetTextL( info->iCaption );
-            aEntry->AddAttributeL( KCaAttrShortName, info->iShortCaption );
-            changed = ETrue;
-            }
-
-
-        if ( UpdateComponentIdL( *aEntry ) )
-            {
-            changed = ETrue;
-            }
-
-        CleanupStack::PopAndDestroy( &attrVal );
+        changed = SetAppCaptionL( aEntry, info ) || changed;
+        changed = UpdateComponentIdL( *aEntry ) || changed;
 
         // check if its java app and add attr for entries
         TUid appTypeUid;
@@ -839,55 +869,11 @@
             {
             if( appTypeUid == KMidletApplicationTypeUid )
                 {
-                aEntry->AddAttributeL(
-                        KCaAttrAppType,
-                        KCaAttrAppTypeValueJava );
-
-                TComponentId compId =
-                        iSoftwareRegistry.GetComponentIdForAppL( info->iUid );
-                CPropertyEntry* propertyEntry =
-                    iSoftwareRegistry.GetComponentPropertyL( compId, KCaScrPropertyAppSettings );
-                CleanupStack::PushL( propertyEntry );
-                if ( propertyEntry &&
-                        propertyEntry->PropertyType() == CPropertyEntry::ELocalizedProperty )
-                    {
-                    aEntry->AddAttributeL(
-                            KCaAttrAppSettingsPlugin,
-                            static_cast<CLocalizablePropertyEntry*>(propertyEntry)->StrValue() );
-                    }
-                CleanupStack::PopAndDestroy( propertyEntry );
+                changed = SetJavaAppL( aEntry ) || changed;
                 }
-            else if ( appTypeUid == KCWRTApplicationTypeUid )
+            else if( appTypeUid == KCWRTApplicationTypeUid )
                 {
-                aEntry->AddAttributeL(
-                        KCaAttrAppType,
-                        KCaAttrAppTypeValueCWRT );
-                TComponentId compId =
-                        iSoftwareRegistry.GetComponentIdForAppL( info->iUid );
-                CPropertyEntry* isMiniview =
-                                        iSoftwareRegistry.GetComponentPropertyL( compId,
-                                                KCaScrPropertyIsMiniviewSupported );
-                CleanupStack::PushL( isMiniview );
-                // check first if we support mini view
-                if (isMiniview && isMiniview->PropertyType() == CPropertyEntry::EIntProperty &&
-                        static_cast<CIntPropertyEntry*>(isMiniview)->IntValue())
-                    {
-                    CPropertyEntry* appId =
-                        iSoftwareRegistry.GetComponentPropertyL( compId, KCaScrPropertyAppId );
-                    CleanupStack::PushL( appId );
-                    if ( appId &&
-                         appId->PropertyType() == CPropertyEntry::ELocalizedProperty )
-                        {
-                        aEntry->AddAttributeL(
-                                            KCaAttrAppWidgetUri,
-                                            KCaAttrAppWidgetUriCWRTValue );
-                        aEntry->AddAttributeL(
-                                            KCaAttrAppWidgetParamWebAppId,
-                                            static_cast<CLocalizablePropertyEntry*>(appId)->StrValue() );
-                        }
-                    CleanupStack::PopAndDestroy( appId );
-                    }
-                CleanupStack::PopAndDestroy( isMiniview );
+                changed = SetCWRTAppL( aEntry ) || changed;
                 }
             }
         }
@@ -895,6 +881,129 @@
     return changed;
     }
 
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CCaSrvAppScanner::SetAppCaptionL(
+        CCaInnerEntry* aEntry, TApaAppInfo* info )
+    {
+    TBool changed(EFalse);
+    if( aEntry->GetText().Compare( info->iCaption ) != KErrNone )
+        {
+        aEntry->SetTextL( info->iCaption );
+        changed = ETrue;
+        }
+    changed = AddAttributeL( aEntry, KCaAttrShortName, info->iShortCaption )
+            || changed;
+
+    return changed;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CCaSrvAppScanner::SetJavaAppL( CCaInnerEntry* aEntry )
+    {
+    TBool changed = AddAttributeL(
+            aEntry, KCaAttrAppType, KCaAttrAppTypeValueJava );
+    TComponentId compId = GetComponentIdFromEntryL( aEntry );
+    CPropertyEntry* propertyEntry = iSoftwareRegistry.GetComponentPropertyL(
+            compId, KCaScrPropertyAppSettings );
+    CleanupStack::PushL( propertyEntry );
+
+    if( propertyEntry
+            && propertyEntry->PropertyType()
+                    == CPropertyEntry::ELocalizedProperty )
+        {
+        changed = AddAttributeL( aEntry, KCaAttrAppSettingsPlugin,
+                static_cast<CLocalizablePropertyEntry*>(
+                        propertyEntry)->StrValue() ) || changed;
+        }
+    CleanupStack::PopAndDestroy( propertyEntry );
+    return changed;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+TBool CCaSrvAppScanner::SetCWRTAppL( CCaInnerEntry* aEntry )
+    {
+    TBool changed = AddAttributeL( aEntry, KCaAttrAppType, KCaAttrAppTypeValueCWRT );
+    TComponentId compId = GetComponentIdFromEntryL( aEntry );
+
+    CPropertyEntry* isMiniview = iSoftwareRegistry.GetComponentPropertyL(
+            compId, KCaScrPropertyIsMiniviewSupported );
+    CleanupStack::PushL( isMiniview );
+
+    // check first if we support mini view
+    if( isMiniview && isMiniview->PropertyType() == CPropertyEntry::EIntProperty
+            && static_cast<CIntPropertyEntry*>( isMiniview)->IntValue() )
+        {
+        CPropertyEntry* appId = iSoftwareRegistry.GetComponentPropertyL(
+                compId, KCaScrPropertyAppId );
+        CleanupStack::PushL( appId );
+
+        if ( appId
+                && appId->PropertyType() == CPropertyEntry::ELocalizedProperty )
+            {
+            changed = AddAttributeL(
+                    aEntry, KCaAttrAppWidgetUri, KCaAttrAppWidgetUriCWRTValue )
+                        || changed;
+            changed = AddAttributeL( aEntry, KCaAttrAppWidgetParamWebAppId,
+                    static_cast<CLocalizablePropertyEntry*>(
+                            appId)->StrValue() ) || changed;
+            }
+        CleanupStack::PopAndDestroy( appId );
+        }
+    CleanupStack::PopAndDestroy( isMiniview );
+    return changed;
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+TBool CCaSrvAppScanner::AddAttributeL( CCaInnerEntry* aEntry, const TDesC& aKey,
+        const TDesC& aValue )
+    {
+    TBool changed(EFalse);
+    RBuf attrValue;
+    attrValue.CleanupClosePushL();
+    attrValue.CreateL( KCaMaxAttrValueLen );
+
+    TBool found = aEntry->FindAttribute( aKey, attrValue );
+    if( !( found && attrValue.Compare( aValue ) == KErrNone ) )
+        {
+        aEntry->AddAttributeL( aKey, aValue );
+        changed = ETrue;
+        }
+    CleanupStack::PopAndDestroy( &attrValue );
+    return changed;
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+TBool CCaSrvAppScanner::RemoveAttributeL( CCaInnerEntry* aEntry,
+        const TDesC& aKey )
+    {
+    TBool toChange( EFalse );
+    RBuf attrVal;
+    attrVal.CleanupClosePushL();
+    attrVal.CreateL( KCaMaxAttrValueLen );
+    if( aEntry->FindAttribute( KCaAttrMmcId, attrVal ) )
+        {
+        aEntry->RemoveAttributeL( aKey );
+        toChange = ETrue;
+        }
+    CleanupStack::PopAndDestroy( &attrVal );
+    return toChange;
+    }
+
 // ---------------------------------------------------------
 //
 // ---------------------------------------------------------
@@ -924,12 +1033,12 @@
             else
                 {
                 aCaEntries[i]->RemoveAttributeL( KCaAttrMmcId() );
-                ClearVisibleFlagL( aCaEntries[i] );
+                ClearAllFlagsL( aCaEntries[i] );
                 }
             }
         else
             {
-            ClearVisibleFlagL( aCaEntries[i] );
+            ClearAllFlagsL( aCaEntries[i] );
             }
         CleanupStack::PopAndDestroy( &attrVal );
         }
@@ -952,16 +1061,11 @@
 //
 // ---------------------------------------------------------
 //
-void CCaSrvAppScanner::ClearVisibleFlagL( CCaInnerEntry* aEntry )
+void CCaSrvAppScanner::ClearAllFlagsL( CCaInnerEntry* aEntry )
     {
     if( aEntry->GetFlags() & EVisible )
         {
-        aEntry->SetFlags(
-                aEntry->GetFlags() &
-                ~EUninstall &
-                ~EVisible &
-                ~EMissing &
-                ~EUsed );
+        aEntry->SetFlags( 0 );
         iCaStorageProxy.AddL( aEntry, EFalse, EItemDisappeared );
         }
     }
@@ -1008,23 +1112,19 @@
 //
 // ---------------------------------------------------------
 //
-TBool CCaSrvAppScanner::IsFileInDrive(
-    const TDesC& aFileName,
-    const DriveInfo::TDefaultDrives& aDefaultDrive ) const
+TBool CCaSrvAppScanner::IsCharInDrive( const TChar& aDriveLetter,
+        const DriveInfo::TDefaultDrives& aDefaultDrive ) const
     {
     TBool retVal( EFalse );
-    if ( aFileName.Length()>0 )
+    TInt mmcDrive;
+    TInt err = DriveInfo::GetDefaultDrive( aDefaultDrive, mmcDrive );
+    if( !err )
         {
-        TInt mmcDrive;
-        TInt err = DriveInfo::GetDefaultDrive( aDefaultDrive, mmcDrive );
-        if( !err )
+        TInt fileDrive;
+        err = RFs::CharToDrive( aDriveLetter, fileDrive );
+        if( !err && fileDrive == mmcDrive )
             {
-            TInt fileDrive;
-            err = RFs::CharToDrive( aFileName[0], fileDrive );
-            if( !err && fileDrive == mmcDrive )
-                {
-                retVal = ETrue;
-                }
+            retVal = ETrue;
             }
         }
     return retVal;
@@ -1034,52 +1134,6 @@
 //
 // ---------------------------------------------------------
 //
-TBool CCaSrvAppScanner::IsAppInDriveL(
-        const TUid aUid,
-        const DriveInfo::TDefaultDrives& aDefaultDrive ) const
-    {
-    TBool ret( EFalse );
-    TApaAppInfo* appInfo = new ( ELeave ) TApaAppInfo();
-    TInt err = iApaLsSession.GetAppInfo( *appInfo, aUid );
-    if( !err && IsFileInDrive( appInfo->iFullName, aDefaultDrive ) )
-        {
-        ret = ETrue;
-        }
-    delete appInfo;
-    return ret;
-    }
-
-// ---------------------------------------------------------
-//
-// ---------------------------------------------------------
-//
-TBool CCaSrvAppScanner::IsInMmcL( const TUid aUid ) const
-    {
-    return IsAppInDriveL( aUid, DriveInfo::EDefaultRemovableMassStorage );
-    }
-
-// ---------------------------------------------------------
-//
-// ---------------------------------------------------------
-//
-TBool CCaSrvAppScanner::IsInMassStorageL( const TUid aUid ) const
-    {
-    return IsAppInDriveL( aUid, DriveInfo::EDefaultMassStorage );
-    }
-
-// ---------------------------------------------------------
-//
-// ---------------------------------------------------------
-//
-TBool CCaSrvAppScanner::IsInRomL( TInt aUid )
-    {
-    return IsAppInDriveL( TUid::Uid( aUid ), DriveInfo::EDefaultRom );
-    }
-
-// ---------------------------------------------------------
-//
-// ---------------------------------------------------------
-//
 TBool CCaSrvAppScanner::IsDriveInUse(
         const DriveInfo::TDefaultDrives& aDefaultDrive )
     {
@@ -1158,17 +1212,38 @@
 
 // ---------------------------------------------------------
 //
-// ---------------------------------------------------------//
-TBool CCaSrvAppScanner::UpdateComponentIdL( CCaInnerEntry& aEntry ) const
+// ---------------------------------------------------------
+//
+TInt CCaSrvAppScanner::GetComponentIdFromEntryL( CCaInnerEntry* aEntry )
+    {
+    TInt id(0);
+    RBuf componentId;
+    componentId.CleanupClosePushL();
+    componentId.CreateL( KCaMaxAttrValueLen );
+
+    TBool found = aEntry->FindAttribute( KCaComponentId, componentId );
+    if( found )
+        {
+        TLex parser;
+        parser.Assign( componentId );
+        parser.Val( id );
+        }
+    CleanupStack::PopAndDestroy( &componentId );
+
+    return id;
+    }
+
+// ---------------------------------------------------------
+//
+// ---------------------------------------------------------
+//
+TBool CCaSrvAppScanner::UpdateComponentIdL( CCaInnerEntry& aEntry )
     {
     TBool updated( EFalse );
+    TComponentId componentId( 0 );
 
-    TUid uid;
-    TInt err(KErrNone);
-    TComponentId componentId( 0 );
-    TRAP(err, componentId =
-            iSoftwareRegistry.GetComponentIdForAppL(
-            uid.Uid( aEntry.GetUid() ) ) )
+    TRAPD(err, componentId = iSoftwareRegistry.GetComponentIdForAppL(
+            TUid::Uid( aEntry.GetUid() ) ) )
 
     if ( componentId > 0 && err == KErrNone )
         {
@@ -1177,24 +1252,9 @@
         newComponentId.CreateL( sizeof(TComponentId) + 1 );
         newComponentId.AppendNum( componentId );
 
-        RBuf oldComponentId;
-        oldComponentId.CleanupClosePushL();
-        oldComponentId.CreateL( KCaMaxAttrValueLen );
-
-        const TBool componentIdAttributeFound =
-            aEntry.FindAttribute( KCaComponentId, oldComponentId );
+        // 'add' or 'update' the component id attribute value
+        updated = AddAttributeL( &aEntry, KCaComponentId, newComponentId );
 
-        if ( !componentIdAttributeFound
-            || oldComponentId.Compare( newComponentId ) != 0 )
-            {
-            // 'add' or 'update' the component id attribute value
-            aEntry.AddAttributeL( KCaComponentId,
-                newComponentId );
-
-            updated = ETrue;
-            }
-
-        CleanupStack::PopAndDestroy( &oldComponentId );
         CleanupStack::PopAndDestroy( &newComponentId );
         }
     return updated;
--- a/contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/calocalizerscanner/inc/calocalizerscannerproxy.h	Wed Aug 18 10:05:49 2010 +0300
@@ -93,6 +93,10 @@
     const TDesC& GetEntryDescription(
             const RPointerArray<CCaInnerEntry>& aEntries, TInt aId );
 
+    const TPtrC GetAttributeName(
+            const RPointerArray<CCaInnerEntry>& aEntries,
+            TInt aId,
+            const TDesC& aAttrName );
 private:
 	
     /*
--- a/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/calocalizerscanner/src/calocalizerscannerproxy.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -19,7 +19,6 @@
 #include <f32file.h>
 #include <qtranslator.h>
 #include <calocalizationentry.h>
-#include <QLocale>
 #include <hbtextresolversymbian.h>
 
 //#include "cainternaltypes.h"
@@ -138,12 +137,19 @@
         localizedName = GetLocalizedNameLC( locals[i] );
         
         if( locals[i]->GetAttributeName().Compare( KColumnEnText) == 0
-                && !localizedName->Compare(
-                    GetEntryText( entries, locals[i]->GetRowId() ) ) == 0 
+                && localizedName->Compare(
+                    GetEntryText( entries, locals[i]->GetRowId() ) ) != 0 
                 ||
             locals[i]->GetAttributeName().Compare( KColumnEnDescription) == 0
-                && !localizedName->Compare(
-                    GetEntryDescription( entries, locals[i]->GetRowId() ) ) == 0 )
+                && localizedName->Compare(
+                    GetEntryDescription( entries, locals[i]->GetRowId() ) ) != 0
+                ||
+            ( locals[i]->GetAttributeName().Compare( KShortName ) == 0
+                || locals[i]->GetAttributeName().Compare( KTitleName ) == 0 )
+                && localizedName->Compare(
+                    GetAttributeName( entries,
+                        locals[i]->GetRowId(),
+                        locals[i]->GetAttributeName() ) ) != 0 )
             // translations different than text
             {
             locals[i]->SetLocalizedStringL( *localizedName );
@@ -247,3 +253,26 @@
         }
     return KNullDesC();
     }
+
+// ---------------------------------------------------------------------------
+//  
+// ---------------------------------------------------------------------------
+//
+const TPtrC CCaLocalizerScannerProxy::GetAttributeName(
+        const RPointerArray<CCaInnerEntry>& aEntries,
+        TInt aId,
+        const TDesC& aAttrName )
+    {
+    TBool notFound( ETrue );
+    TPtrC attrValue;
+    TInt entriesCount = aEntries.Count();
+    for( TInt i=0; i < entriesCount && notFound; i++ )
+        {
+        if( aEntries[i]->GetId() == aId &&
+            aEntries[i]->GetAttributes().Find(aAttrName, attrValue) )
+            {
+            notFound = EFalse;
+            }
+        }
+    return attrValue;
+    }
--- a/contentstorage/casrv/casrvmgr/bwins/casrvmanageru.def	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/casrvmgr/bwins/casrvmanageru.def	Wed Aug 18 10:05:49 2010 +0300
@@ -1,4 +1,4 @@
 EXPORTS
-	?NewL@CCaSrvManager@@SAPAV1@AAVCCaStorageProxy@@PAVCCaSrvEngUtils@@@Z @ 1 NONAME ; class CCaSrvManager * CCaSrvManager::NewL(class CCaStorageProxy &, class CCaSrvEngUtils *)
-	?LoadOperationErrorCodeL@CCaSrvManager@@QAEHXZ @ 2 NONAME ; int CCaSrvManager::LoadOperationErrorCodeL(void)
+	?LoadOperationErrorCodeL@CCaSrvManager@@QAEHXZ @ 1 NONAME ; int CCaSrvManager::LoadOperationErrorCodeL(void)
+	?NewL@CCaSrvManager@@SAPAV1@AAVCCaStorageProxy@@PAVRSoftwareComponentRegistry@Usif@@PAVCCaSrvEngUtils@@@Z @ 2 NONAME ; class CCaSrvManager * CCaSrvManager::NewL(class CCaStorageProxy &, class Usif::RSoftwareComponentRegistry *, class CCaSrvEngUtils *)
 
--- a/contentstorage/casrv/casrvmgr/eabi/casrvmanageru.def	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/casrvmgr/eabi/casrvmanageru.def	Wed Aug 18 10:05:49 2010 +0300
@@ -1,4 +1,4 @@
 EXPORTS
-	_ZN13CCaSrvManager4NewLER15CCaStorageProxyP14CCaSrvEngUtils @ 1 NONAME
-	_ZN13CCaSrvManager23LoadOperationErrorCodeLEv @ 2 NONAME
+	_ZN13CCaSrvManager23LoadOperationErrorCodeLEv @ 1 NONAME
+	_ZN13CCaSrvManager4NewLER15CCaStorageProxyPN4Usif26RSoftwareComponentRegistryEP14CCaSrvEngUtils @ 2 NONAME
 
--- a/contentstorage/casrv/casrvmgr/inc/casrvmanager.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/casrvmgr/inc/casrvmanager.h	Wed Aug 18 10:05:49 2010 +0300
@@ -24,7 +24,11 @@
 #include <e32hashtab.h>
 #include "casrvplugin.h"
 
+
 class CCaSrvEngUtils;
+namespace Usif{
+    class RSoftwareComponentRegistry;
+}
 
 /**
  *
@@ -48,6 +52,7 @@
      * @param aUtils storage utils.
      */
     IMPORT_C static CCaSrvManager* NewL( CCaStorageProxy& aCaStorageProxy,
+            Usif::RSoftwareComponentRegistry* aSoftwareRegistry,
             CCaSrvEngUtils* aUtils = NULL );
 
     /**
@@ -57,6 +62,7 @@
      * @param aUtils storage utils.
      */
     static CCaSrvManager* NewLC( CCaStorageProxy& aCaStorageProxy,
+            Usif::RSoftwareComponentRegistry* aSoftwareRegistry,
             CCaSrvEngUtils* aUtils = NULL );
 
     /**
@@ -79,6 +85,7 @@
      * @param aUtils storage utils.
      */
     void ConstructL( CCaStorageProxy& aCaStorageProxy,
+            Usif::RSoftwareComponentRegistry* aSoftwareRegistry,
             CCaSrvEngUtils* aUtils = NULL );
 
     /**
--- a/contentstorage/casrv/casrvmgr/inc/casrvplugin.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/casrvmgr/inc/casrvplugin.h	Wed Aug 18 10:05:49 2010 +0300
@@ -24,11 +24,15 @@
 
 class CCaStorageProxy;
 class CCaSrvEngUtils;
+namespace Usif{
+    class RSoftwareComponentRegistry;
+}
 
 struct TPluginParams
     {
     CCaStorageProxy* storageProxy;
     CCaSrvEngUtils* engUtils;
+    Usif::RSoftwareComponentRegistry* softwareRegistry;
     };
 
 /**
--- a/contentstorage/casrv/casrvmgr/src/casrvmanager.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/casrvmgr/src/casrvmanager.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -50,11 +50,12 @@
 // ---------------------------------------------------------------------------
 //
 CCaSrvManager* CCaSrvManager::NewLC( CCaStorageProxy& aCaStorageProxy,
+        Usif::RSoftwareComponentRegistry* aSoftwareRegistry,
         CCaSrvEngUtils* aUtils )
     {
     CCaSrvManager* self = new ( ELeave ) CCaSrvManager();
     CleanupStack::PushL( self );
-    self->ConstructL( aCaStorageProxy, aUtils );
+    self->ConstructL( aCaStorageProxy, aSoftwareRegistry, aUtils);
     return self;
     }
 
@@ -62,10 +63,12 @@
 //
 // ---------------------------------------------------------------------------
 //
-EXPORT_C CCaSrvManager* CCaSrvManager::NewL(
-        CCaStorageProxy& aCaStorageProxy, CCaSrvEngUtils* aUtils )
+EXPORT_C CCaSrvManager* CCaSrvManager::NewL( CCaStorageProxy& aCaStorageProxy,
+        Usif::RSoftwareComponentRegistry* aSoftwareRegistry,
+        CCaSrvEngUtils* aUtils )
     {
-    CCaSrvManager* self = CCaSrvManager::NewLC( aCaStorageProxy, aUtils );
+    CCaSrvManager* self = CCaSrvManager::NewLC( aCaStorageProxy,
+	        aSoftwareRegistry, aUtils );
     CleanupStack::Pop(); // self;
     return self;
     }
@@ -75,12 +78,13 @@
 // ---------------------------------------------------------------------------
 //
 void CCaSrvManager::ConstructL( CCaStorageProxy& aCaStorageProxy,
+        Usif::RSoftwareComponentRegistry* aSoftwareRegistry,
         CCaSrvEngUtils* aUtils )
     {
     iPluginParams = new TPluginParams();
     iPluginParams->storageProxy = &aCaStorageProxy;
     iPluginParams->engUtils = aUtils;
-
+    iPluginParams->softwareRegistry = aSoftwareRegistry;
     LoadPluginsL();
     }
 
--- a/contentstorage/casrv/causifscanner/inc/causifscanner.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/causifscanner/inc/causifscanner.h	Wed Aug 18 10:05:49 2010 +0300
@@ -52,7 +52,7 @@
 
     /**
      * Two-phased constructor.
-     * @param aPLuginParam plugin param consist of storage, storage utils.
+     * @param aPLuginParam plugin param consist of storage, storage utils and scr.
      * @retval New object.
      */
     static CCaUsifScanner* NewL( TPluginParams* aPluginParams );
@@ -85,8 +85,10 @@
     /**
      * Constructor
      * @param aStorageProxy Storage handler.
+     * @param aSoftwareRegistry software component registry.
      */
-    CCaUsifScanner( CCaStorageProxy& aStorageProxy );
+    CCaUsifScanner( CCaStorageProxy& aStorageProxy,
+	        RSoftwareComponentRegistry& aSoftwareRegistry );
 
     /**
      * Second phased constructor.
@@ -184,9 +186,9 @@
     CCaMmcWatcher* iMmcWatcher;
 
     /**
-     * Software component registry. Own.
+     * Software component registry. Not own.
      */
-    RSoftwareComponentRegistry iSoftwareRegistry;
+    RSoftwareComponentRegistry& iSoftwareRegistry;
 
     };
 
--- a/contentstorage/casrv/causifscanner/src/causifscanner.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/causifscanner/src/causifscanner.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -35,7 +35,7 @@
 CCaUsifScanner* CCaUsifScanner::NewL( TPluginParams* aPluginParams )
     {
     CCaUsifScanner* self = new ( ELeave ) CCaUsifScanner(
-            *aPluginParams->storageProxy );
+            *aPluginParams->storageProxy, *aPluginParams->softwareRegistry );
     CleanupStack::PushL( self );
     self->ConstructL();
     CleanupStack::Pop( self );
@@ -46,8 +46,9 @@
 //
 // ---------------------------------------------------------------------------
 //
-CCaUsifScanner::CCaUsifScanner( CCaStorageProxy& aStorageProxy ) :
-    iStorageProxy( aStorageProxy )
+CCaUsifScanner::CCaUsifScanner( CCaStorageProxy& aStorageProxy,
+    RSoftwareComponentRegistry& aSoftwareRegistry ) :
+        iStorageProxy( aStorageProxy ), iSoftwareRegistry(aSoftwareRegistry)
     {
     }
 
@@ -69,8 +70,6 @@
     User::LeaveIfError( iFs.Connect() );
     iMmcWatcher = CCaMmcWatcher::NewL( iFs, this );
 
-    User::LeaveIfError( iSoftwareRegistry.Connect() );
-
     UpdateUsifListL();
     }
 
@@ -80,7 +79,6 @@
 //
 CCaUsifScanner::~CCaUsifScanner()
     {
-    iSoftwareRegistry.Close();
     delete iMmcWatcher;
     iFs.Close();
     delete iJavaInstallNotifier;
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetdescription.h	Wed Aug 18 10:05:49 2010 +0300
@@ -48,6 +48,12 @@
     virtual ~CCaWidgetDescription();
 
     /**
+     * @return new heap allocated object being a copy of the object.
+     * Ownership is passed to the caller.
+     */
+    CCaWidgetDescription *CloneL();
+    
+    /**
      * Static method to compare two CCaWidgetDescription objects
      * used in Find() method
      * @param aFirst first item to compare
@@ -55,7 +61,7 @@
      * @return ETrue if widget uri value is the same in both objects,
      * otherwise returns EFalse
      */
-    static TBool Compare( const CCaWidgetDescription& aFirst,
+    static TBool CompareUri( const CCaWidgetDescription& aFirst,
             const CCaWidgetDescription& aSecond );
 
     /**
--- a/contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/cawidgetstoragehandler.h	Wed Aug 18 10:05:49 2010 +0300
@@ -49,8 +49,10 @@
      * Two-phased constructor.
      */
     static CCaWidgetStorageHandler* NewL( CCaStorageProxy* aStorage,
+            Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
             RFs& aFs );
     static CCaWidgetStorageHandler* NewLC( CCaStorageProxy* aStorage,
+            Usif::RSoftwareComponentRegistry& aSoftwareRegistry,
             RFs& aFs );
 
     /**
@@ -124,7 +126,8 @@
     /**
      * C++ default constructor.
      */
-    CCaWidgetStorageHandler( CCaStorageProxy* aStorage, RFs& aFs );
+    CCaWidgetStorageHandler( CCaStorageProxy* aStorage,
+            Usif::RSoftwareComponentRegistry& aSoftwareRegistry, RFs& aFs );
 
     /**
      * By default Symbian 2nd phase constructor is private.
@@ -139,11 +142,12 @@
 
     /**
      * Adds or updates component id attribute in entry based on SCR provided data
+     * and removable flag - get info from src.
      * @param aPackageUid uid of the package which the widget represented by aEntry
-     * is delivered with
+     * is delivered with.
      * @param aEntry widget entry being updated with component id attribute.
      */
-    void UpdateComponentIdL( const TDesC& aManifestFilePathName,
+    void UpdateCompIdAndRemovableFlagL( const TDesC& aManifestFilePathName,
             CCaInnerEntry& aEntry ) const;
 
 private:
@@ -160,16 +164,19 @@
     RFs iFs;
 
     /*
-     * Widgets. Own.
+     * DB cache for widgets. Own.
      */
-    RWidgetArray iWidgets;
+    RWidgetArray iWidgetDBCache;
 
     /**
      * Pointer to a parser object. Own
      */
     CCaWidgetScannerParser* iParser;
 
-    Usif::RSoftwareComponentRegistry iSoftwareRegistry;
+    /*
+     * Software Component Registry. Not own
+     */
+    Usif::RSoftwareComponentRegistry& iSoftwareRegistry;
     };
 
 #endif      // C_WIDGETSTORAGEHANDLER_H
--- a/contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/inc/widgetscannerutils.h	Wed Aug 18 10:05:49 2010 +0300
@@ -35,15 +35,6 @@
 public:
 
     /**
-     * Checks if file is present on a drive
-     * @param aFileName file name
-     * @param aDriveLetter drive letter
-     * @return ETrue if file is present, EFalse if not
-     */
-    static TBool IsFileOnDrive( const TDesC& aFileName,
-            const DriveInfo::TDefaultDrives& aDefaultDrive );
-
-    /**
      * Returns current MMC id.
      * @param aFs file server session reference.
      * @param aMmcId mmc id reference.
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetdescription.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -161,7 +161,34 @@
 //
 // ----------------------------------------------------------------------------
 //
-TBool CCaWidgetDescription::Compare(
+CCaWidgetDescription *CCaWidgetDescription::CloneL()
+    {   
+    CCaWidgetDescription* clone = CCaWidgetDescription::NewL();
+    
+    clone->SetPathL( GetPath() );
+    clone->SetMmcIdL( GetMmcId() );
+    clone->SetStringidTitleL( GetStringIdTitle() );
+    clone->SetLibraryL( GetLibrary() );
+    clone->SetDescriptionL( GetDescription() );
+    clone->SetStringIdDescriptionL( GetStringIdDescription() );
+    clone->SetUriL( GetUri() );
+    clone->SetIconUriL( GetIconUri() );
+    clone->SetPreviewImageNameL( GetPreviewImageName() );
+    clone->SetTitleL( GetTitle() );
+    clone->SetTranslationFileNameL( GetTranslationFileName() );
+    clone->SetLibraryL( GetLibrary() );
+    clone->SetModificationTimeL( GetModificationTime() );
+    clone->SetServiceXmlL( GetServiceXml() );
+    clone->SetManifestFilePathNameL( GetManifestFilePathName() );
+    
+    return clone;
+    }
+
+// ----------------------------------------------------------------------------
+//
+// ----------------------------------------------------------------------------
+//
+TBool CCaWidgetDescription::CompareUri(
         const CCaWidgetDescription& aFirst,const CCaWidgetDescription& aSecond)
     {
     TBool result = EFalse;
@@ -541,12 +568,6 @@
     if ( iLibrary != KNullDesC )
         {
         entry->AddAttributeL(KAttrWidgetLibrary, iLibrary);
-        entry->SetFlags(entry->GetFlags() | ERemovable);
-        if (WidgetScannerUtils::IsFileOnDrive( iLibrary,
-                DriveInfo::EDefaultRom ) )
-            {
-            entry->SetFlags( entry->GetFlags() & ~ERemovable );
-            }
         }
     if ( iPath != KNullDesC )
         {
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerparser.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -154,12 +154,12 @@
         {
         if ( ( *fileList )[i].iName.Find( KManifest ) != KErrNotFound )
             {
-            RBuf fullFilePath;
-            CleanupClosePushL( fullFilePath );
-            fullFilePath.CreateL( manifestDirectoryPath->Length()
+            RBuf manifestFilePathName;
+            CleanupClosePushL( manifestFilePathName );
+            manifestFilePathName.CreateL( manifestDirectoryPath->Length()
                     + ( *fileList )[i].iName.Length() );
-            fullFilePath.Append( *manifestDirectoryPath );
-            fullFilePath.Append( ( *fileList )[i].iName );
+            manifestFilePathName.Append( *manifestDirectoryPath );
+            manifestFilePathName.Append( ( *fileList )[i].iName );
           
             TPtrC packageUidPtr = manifestDirectoryPath->Mid(
                     manifestDirectoryPath->Length() - KPackageUidPosition,
@@ -168,37 +168,46 @@
             TLex lexer( packageUidPtr );
             User::LeaveIfError( lexer.Val( packageUid, EHex ) );
 
-            CCaWidgetDescription* compareWidget = NULL;
+            CCaWidgetDescription* currentWidget = NULL;
             for ( TInt j = 0; j < iFetchedWidgets.Count(); j++ )
                 {
                 if ( iFetchedWidgets[j]->GetPackageUidL() ==  packageUid )
                     {
-                    compareWidget = iFetchedWidgets[j];
-                    compareWidget->SetValid( ETrue ); //do not remove from db
+                    currentWidget = iFetchedWidgets[j];
+                    currentWidget->SetValid( ETrue ); //do not remove from db
                     break; // once found we dont iterate anymore
                     }
                 }
 
-            if ( compareWidget )
+            if ( currentWidget )
                 {
                 TTime modificationTime = ( *fileList )[i].iModified;
                 TInt64 modificationIntTime = modificationTime.Int64();
-                TLex lex( compareWidget->GetModificationTime() );
+                TLex lex( currentWidget->GetModificationTime() );
                 TInt64 uintTimeDB( 0 );
                 User::LeaveIfError( lex.Val( uintTimeDB ) );
 
                 if ( uintTimeDB != modificationIntTime )
                     {
-                    TRAP_IGNORE( ParseManifestFileL( fullFilePath,
+                    TRAP_IGNORE( ParseManifestFileL( manifestFilePathName,
                                     aDirectoryName, aDrive ) );
                     }
+                else if ( currentWidget->IsMissing() ) 
+                    {
+                    // manifest of missing widget found
+                    CCaWidgetDescription* clone = currentWidget->CloneL();
+                    CleanupStack::PushL( clone );
+                    clone->SetManifestFilePathNameL( manifestFilePathName );
+                    iWidgets.AppendL( clone );
+                    CleanupStack::Pop( clone );
+                    }
                 }
             else
                 {
-                TRAP_IGNORE( ParseManifestFileL( fullFilePath, aDirectoryName,
+                TRAP_IGNORE( ParseManifestFileL( manifestFilePathName, aDirectoryName,
                                 aDrive ) );
                 }
-            CleanupStack::PopAndDestroy( &fullFilePath );
+            CleanupStack::PopAndDestroy( &manifestFilePathName );
             }
         }
     CleanupStack::PopAndDestroy( fileList );
@@ -304,7 +313,7 @@
         SetModificationTimeL( aFilePath, widgetDescriptor );
 
         TInt index = iWidgets.Find( widgetDescriptor,
-                CCaWidgetDescription::Compare );
+                CCaWidgetDescription::CompareUri );
         if ( index != KErrNotFound )
             {
             delete iWidgets[index];
@@ -340,7 +349,7 @@
 
     SetModificationTimeL( aFilePath, widget );
 
-    TInt index = iWidgets.Find( widget, CCaWidgetDescription::Compare );
+    TInt index = iWidgets.Find( widget, CCaWidgetDescription::CompareUri );
     if ( index != KErrNotFound )
         {
         delete iWidgets[index];
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetscannerplugin.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -68,7 +68,8 @@
     iInstallNotifier = CCaWidgetScannerInstallNotifier::NewL( this,
             KUidSystemCategory, KSAUidSoftwareInstallKeyValue );
     iStorageHandler = CCaWidgetStorageHandler::NewL(
-            aPluginParams->storageProxy, iFs );
+            aPluginParams->storageProxy,
+			*aPluginParams->softwareRegistry, iFs );
     SynchronizeL();
     }
 
--- a/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/cawidgetstoragehandler.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -40,7 +40,8 @@
 // -----------------------------------------------------------------------------
 //
 CCaWidgetStorageHandler::CCaWidgetStorageHandler( CCaStorageProxy* aStorage,
-        RFs& aFs )
+        Usif::RSoftwareComponentRegistry& aSoftwareRegistry, RFs& aFs ) :
+            iSoftwareRegistry(aSoftwareRegistry)
     {
     iStorage = aStorage;
     iFs = aFs;
@@ -52,7 +53,6 @@
 //
 void CCaWidgetStorageHandler::ConstructL()
     {
-    User::LeaveIfError( iSoftwareRegistry.Connect() );
     iParser = CCaWidgetScannerParser::NewL( iFs );
     }
 
@@ -61,9 +61,10 @@
 // -----------------------------------------------------------------------------
 //
 CCaWidgetStorageHandler* CCaWidgetStorageHandler::NewL(
-        CCaStorageProxy* aStorage, RFs& aFs )
+        CCaStorageProxy* aStorage,
+        Usif::RSoftwareComponentRegistry& aSoftwareRegistry, RFs& aFs )
     {
-    CCaWidgetStorageHandler* self = NewLC( aStorage, aFs );
+    CCaWidgetStorageHandler* self = NewLC( aStorage, aSoftwareRegistry, aFs );
     CleanupStack::Pop( self );
     return self;
     }
@@ -73,10 +74,11 @@
 // -----------------------------------------------------------------------------
 //
 CCaWidgetStorageHandler* CCaWidgetStorageHandler::NewLC(
-        CCaStorageProxy* aStorage, RFs& aFs )
+        CCaStorageProxy* aStorage,
+        Usif::RSoftwareComponentRegistry& aSoftwareRegistry, RFs& aFs )
     {
     CCaWidgetStorageHandler* self = new ( ELeave ) CCaWidgetStorageHandler(
-            aStorage, aFs );
+            aStorage, aSoftwareRegistry, aFs );
     CleanupStack::PushL( self );
     self->ConstructL();
     return self;
@@ -89,8 +91,7 @@
 CCaWidgetStorageHandler::~CCaWidgetStorageHandler()
     {
     delete iParser;
-    iSoftwareRegistry.Close();
-    iWidgets.ResetAndDestroy();
+    iWidgetDBCache.ResetAndDestroy();
     }
 
 // ----------------------------------------------------------------------------
@@ -100,7 +101,7 @@
 void CCaWidgetStorageHandler::SynchronizeL()
     {
     FetchWidgetsL();
-    AddWidgetsL( iParser->WidgetsScanL( iWidgets ) );
+    AddWidgetsL( iParser->WidgetsScanL( iWidgetDBCache ) );
     RemoveWidgetsL();
     }
 
@@ -111,7 +112,7 @@
 void CCaWidgetStorageHandler::AddL( const CCaWidgetDescription* aWidget )
     {
     CCaInnerEntry* entry = aWidget->GetEntryLC();
-    UpdateComponentIdL( aWidget->GetManifestFilePathName(), *entry );
+    UpdateCompIdAndRemovableFlagL( aWidget->GetManifestFilePathName(), *entry );
     iStorage->AddL( entry );
 
     SetLocalizationsL( aWidget, entry->GetId() );
@@ -131,7 +132,7 @@
         TUint aEntryId )
     {
     CCaInnerEntry* entry = aWidget->GetEntryLC();
-    UpdateComponentIdL( aWidget->GetManifestFilePathName(), *entry );
+    UpdateCompIdAndRemovableFlagL( aWidget->GetManifestFilePathName(), *entry );
     entry->SetId( aEntryId );
     if ( !aWidget->IsMissing() && aWidget->IsUsed() )
         {
@@ -147,7 +148,7 @@
 
     SetLocalizationsL( aWidget, entry->GetId() );
 
-    if ( !aWidget->IsMissing() )
+    if ( !aWidget->IsMissing() && ( entry->GetFlags() & ERemovable ) )
         {
         AddWidgetToDownloadCollectionL( entry );
         }
@@ -160,25 +161,40 @@
 //
 void CCaWidgetStorageHandler::AddWidgetsL( const RWidgetArray& aWidgets )
     {
-    for ( TInt i = 0; i < aWidgets.Count(); i++ )
+    const TInt newWidgetsCount = aWidgets.Count();
+    
+    for ( TInt i = 0; i < newWidgetsCount; ++i )
         {
-        aWidgets[i]->LocalizeTextsL();
-        TInt index = iWidgets.Find( aWidgets[i], CCaWidgetDescription::Compare );
-        if ( index != KErrNotFound )
+        CCaWidgetDescription *const newWidget = aWidgets[i];
+        
+        newWidget->LocalizeTextsL();
+        
+        const TInt dbCacheIndex = 
+            iWidgetDBCache.Find( 
+                newWidget, CCaWidgetDescription::CompareUri );
+        
+        if ( dbCacheIndex != KErrNotFound )
             {
-            iWidgets[index]->SetValid( ETrue );
-            if ( !iWidgets[index]->Compare( *aWidgets[i] )
-                    || iWidgets[index]->IsMissing() )
+            CCaWidgetDescription *const cachedWidget = 
+                iWidgetDBCache[dbCacheIndex];
+            
+            cachedWidget->SetValid( ETrue );
+            
+            const TBool cachedDifferentThanNew = 
+                !cachedWidget->Compare( *newWidget );
+            
+            if ( cachedDifferentThanNew || cachedWidget->IsMissing() )
                 {
-                aWidgets[i]->SetFlag( EMissing, iWidgets[index]->IsMissing() );
-                aWidgets[i]->SetFlag( EUsed, iWidgets[index]->IsUsed() );
-                aWidgets[i]->SetFlag( EVisible, iWidgets[index]->IsVisible() );
-                UpdateL( aWidgets[i], iWidgets[index]->GetEntryId() );
+                newWidget->SetFlag( EMissing, cachedWidget->IsMissing() );
+                newWidget->SetFlag( EUsed,  cachedWidget->IsUsed() );
+                newWidget->SetFlag( EVisible, cachedWidget->IsVisible() );
+                
+                UpdateL( newWidget, cachedWidget->GetEntryId() );
                 }
             }
         else
             {
-            AddL( aWidgets[i] );
+            AddL( newWidget );
             }
         }
     HbTextResolverSymbian::Init( _L(""), KLocalizationFilepathZ );
@@ -190,34 +206,36 @@
 //
 void CCaWidgetStorageHandler::RemoveWidgetsL()
     {
-    for ( TInt i = 0; i < iWidgets.Count(); i++ )
+    const TInt cacheCount = iWidgetDBCache.Count();
+    for ( TInt i = 0; i < cacheCount; ++i)
         {
-        if ( !iWidgets[i]->IsValid() )
+        CCaWidgetDescription *const cachedWidget = iWidgetDBCache[i];
+        if ( !cachedWidget->IsValid() )
             {
-            if ( iWidgets[i]->GetMmcId() != KNullDesC )
+            if ( cachedWidget->GetMmcId() != KNullDesC )
                 {
                 RBuf currentMmcId;
                 currentMmcId.CreateL( KMassStorageIdLength );
                 currentMmcId.CleanupClosePushL();
                 WidgetScannerUtils::CurrentMmcId( iFs, currentMmcId );
-                if( iWidgets[i]->GetMmcId() == currentMmcId ||
-                        ( iWidgets[i]->GetMmcId() == KCaMassStorage() &&
+                if( cachedWidget->GetMmcId() == currentMmcId ||
+                        ( cachedWidget->GetMmcId() == KCaMassStorage() &&
                         MassStorageNotInUse() ) )
                     {
                     //item was uninstalled so we remove its mmc id
-                    iWidgets[i]->RemoveMmcId();
-                    ClearVisibleFlagL( iWidgets[i] );
+                    cachedWidget->RemoveMmcId();
+                    ClearVisibleFlagL( cachedWidget );
                     }
                 else
                     {
-                    SetMissingFlagL( iWidgets[i] );
+                    SetMissingFlagL( cachedWidget );
                     }
                 CleanupStack::PopAndDestroy( &currentMmcId );
                 }
             else
                 {
                 //item was uninstalled so we remove its mmc id
-                ClearVisibleFlagL( iWidgets[i] );
+                ClearVisibleFlagL( cachedWidget );
                 }
             }
         }
@@ -276,11 +294,11 @@
     CleanupResetAndDestroyPushL( entries );
     iStorage->GetEntriesL( query, entries );
 
-    iWidgets.ResetAndDestroy();
+    iWidgetDBCache.ResetAndDestroy();
     for ( TInt i = 0; i < entries.Count(); i++ )
         {
         CCaWidgetDescription* widget = CCaWidgetDescription::NewLC( entries[i] );
-        iWidgets.AppendL( widget ); //iWidgets takes ownership
+        iWidgetDBCache.AppendL( widget ); //iWidgets takes ownership
         CleanupStack::Pop( widget );
         }
     CleanupStack::PopAndDestroy( &entries );
@@ -399,7 +417,7 @@
 // ----------------------------------------------------------------------------
 //
 
-void CCaWidgetStorageHandler::UpdateComponentIdL(
+void CCaWidgetStorageHandler::UpdateCompIdAndRemovableFlagL(
         const TDesC& aManifestFilePathName, CCaInnerEntry& aEntry ) const
     {
     RArray<TComponentId> componentIds;
@@ -411,7 +429,7 @@
 
     CleanupStack::PopAndDestroy( fileNameFilter );
 
-    if ( componentIds.Count() == 1 )
+    if( componentIds.Count() == 1 )
         {
         RBuf newComponentId;
         newComponentId.CleanupClosePushL();
@@ -425,13 +443,19 @@
         const TBool componentIdAttributeFound = aEntry.FindAttribute(
                 KCaComponentId, oldComponentId );
 
-        if ( !componentIdAttributeFound || oldComponentId.Compare(
+        if( !componentIdAttributeFound || oldComponentId.Compare(
                 newComponentId ) != 0 )
             {
             // 'add' or 'update' the component id attribute value
             aEntry.AddAttributeL( KCaComponentId, newComponentId );
             }
-
+        CComponentEntry* entry = CComponentEntry::NewLC();
+        iSoftwareRegistry.GetComponentL( componentIds[0] , *entry );
+        if( entry->IsRemovable() )
+            {
+            aEntry.SetFlags( aEntry.GetFlags() | ERemovable );
+            }
+        CleanupStack::PopAndDestroy( entry );
         CleanupStack::PopAndDestroy( &oldComponentId );
         CleanupStack::PopAndDestroy( &newComponentId );
         }
--- a/contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/casrv/cawidgetscanner/src/widgetscannerutils.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -24,31 +24,6 @@
 //
 // -----------------------------------------------------------------------------
 //
-TBool WidgetScannerUtils::IsFileOnDrive( const TDesC& aFileName,
-        const DriveInfo::TDefaultDrives& aDefaultDrive )
-    {
-    TBool result = EFalse;
-    if ( aFileName.Length() )
-        {
-        TInt drive;
-        TInt err = DriveInfo::GetDefaultDrive( aDefaultDrive, drive );
-        if ( !err )
-            {
-            TInt fileDrive;
-            err = RFs::CharToDrive( aFileName[0], fileDrive );
-            if ( !err && fileDrive == drive )
-                {
-                result = ETrue;
-                }
-            }
-        }
-    return result;
-    }
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
 void WidgetScannerUtils::CurrentMmcId( const RFs& aFs, TDes& aMmcId )
     {
     TInt mmcDrive;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/castorage/conf/CI_castoragedb.confml	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<confml:configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.s60.com/xml/confml/2" xmlns:confml="http://www.s60.com/xml/confml/2" xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Content storage database settings">
+	<confml:feature ref="CaStorageDbSetting" name="Application Library model">	
+		<setting ref="OperatorCollections"	name="Operator Collections" maxOccurs="1" minOccurs="0" type="sequence" mapKey="Name" mapValue="Name">
+			<setting ref="Name" name="Collection Name" type="string" required="true">
+				<desc>Name of the Operator Collection.</desc>
+				<xs:maxLength value="32"/>
+			</setting>
+			<confml:setting ref="ShortName" name="Collection Short Name" type="string">
+				<confml:desc>Collection short name. Optional. Name used in Homescreen when shortcut to collection is created.</confml:desc>
+			</confml:setting>
+			<confml:setting ref="TitleName" name="Collection Title Name" type="string">
+				<confml:desc>Collection title name. Optional. Name displayed when user enter to collection (heading).</confml:desc>
+			</confml:setting>	
+			<setting name="Collection Group Name" ref="GroupName" type="string">
+				<desc>Group name. Not localized name. Identify collection where application with predefined group name should be added after installation.</desc>
+			</setting>
+			<setting ref="Locked" name="Lock Operator Collection and content" type="boolean">
+				<desc>Lock operator collection and content - user can not delete operator collection, prevent renaming collection and even content. Not possible by user to add new content to defined collection</desc>
+			</setting>
+			<setting ref="Icon" name="Collection Icon" type="file" >
+				<desc>Icon.</desc>
+				<property name="type" value="image/svg" unit="mime"/>
+				<localPath></localPath>
+				<targetPath readOnly="true"/>
+			</setting>
+			<setting ref="IconSkinId" name="Icon Theme ID" type="string">
+				<desc>Icon Theme id. </desc>
+			</setting>
+		</setting>
+		<setting ref="OperatorURLs"	 name="Operator URLs"  minOccurs="0" type="sequence" mapKey="OperatorURLTitle" mapValue="OperatorURLTitle">
+			<setting ref="OperatorURLTitle" name="Operator URL Title" type="string">
+				<desc>Title of the Operator URL</desc>
+			</setting>	 
+			<setting ref="OperatorURLShortTitle" name="Operator URL Short Title" type="string" required="true">
+				<desc>Short Title of the Operator URL. Optional. Displayed when shortcut to Url is added to Homescreen</desc>
+			</setting>	 			
+			<setting ref="OperatorURL" name="Operator URL" type="string" required="true">
+				<desc>URL</desc>
+				<xs:pattern value="(http(|s)://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&amp;=]*)?|)"/>
+			</setting>
+			<setting ref="OperatorURLIcon" name="Operator URL Icon" type="file">
+				<desc>Icon for the Operator URL.</desc>
+				<property name="type" value="image/svg" unit="mime"/>
+				<localPath></localPath>
+				<targetPath readOnly="true"/>
+			</setting>
+			<setting ref="IconSkinId" name="Icon Theme ID" type="string">
+				<desc>Icon Theme id. </desc>
+			</setting>
+		</setting>	
+		<setting ref="OperatorCollectionItems"	name="Operator Collection content"  minOccurs="0" type="sequence" >
+			<setting ref="Type" name="Item type" type="selection">
+				<desc>Type of collection item.</desc>
+				<option name="Application" value="1"/>
+				<option name="Homescreen widget" value="2"/>
+				<option name="URL" value="3"/>
+			</setting>
+			<setting ref="Application" name="Application" type="string" relevant="Type='1'" required="true">
+				<desc>Application item for Operator collection.</desc>
+				<xs:pattern value="^[-+]?[0-9]{10}"/>
+				<!-- option map="DFSFeatures/Application"/>
+				<option map="CIA_PreinstalledContent/PreInstalledJavaRom"/>
+				<option map="CIA_PreinstalledContent/PreInstalledSymbianROM"/>
+				<option map="CIA_PreinstalledContent/PreInstalledSymbianUDA"/>
+				<option map="CIA_PreinstalledContent/PreInstalledJavaUDA"/-->
+			</setting>
+			<setting ref="HomescreenWidget" name="Homescreen widget" type="string" relevant="Type='2'" required="true">
+				<desc>Homescreen widget item for Operator collection</desc>
+				<!-- option map="HomescreenWidgets/Widgets"/>
+				<option map="CIA_PreinstalledWidgetUDA/PreInstalledWidgetUDA" /-->
+			</setting>
+			<setting ref="OperatorURL" name="Operator URL" type="selection" relevant="Type='3'" required="true">		
+				<option map="CaStorageDbSetting/OperatorURLs"/>
+			</setting>
+		</setting>
+		
+    <confml:setting ref="Collections" mapKey="Name" mapValue="Name" name="Collections" type="sequence">
+        <setting ref="LocalizeNames" name="Use localized collections names" type="boolean">
+            <desc>Enable localization support for collection names</desc>
+        </setting>	
+        <confml:setting ref="TranslationFile" name="Translation file" type="string" relevant="LocalizeNames and LocalizeNames='true'" >
+            <confml:desc>Name of translation file used for fetching localized names</confml:desc>				
+        </confml:setting>
+        <setting ref="Name" name="Collection Name" type="string" required="true">
+            <desc>Name of collection.</desc>				
+        </setting>
+        <confml:setting ref="ShortName" name="Collection Short Name" type="string">
+            <confml:desc>Collection short name. Optional. Name used in Homescreen when shortcut to collection is created.</confml:desc>
+        </confml:setting>
+        <confml:setting ref="TitleName" name="Collection Title Name" type="string">
+            <confml:desc>Collection title name. Optional. Name displayed when user enter to collection (heading).</confml:desc>
+        </confml:setting>			
+        <setting ref="GroupName" name="Collection Group Name" type="string">
+            <desc>Group name. Not localized name. Identify collection where application with predefined group name should be added after installation.</desc>
+        </setting>
+        <setting ref="Locked" name="Lock Operator Collection and content" type="boolean">
+            <desc>Lock operator collection and content - user can not delete operator collection, prevent renaming collection and even content. Not possible by user to add new content to defined collection</desc>
+        </setting>
+        <setting ref="Icon" name="Collection Icon" type="file" >
+            <desc>Icon.</desc>
+            <property name="type" value="image/svg" unit="mime"/>
+            <localPath></localPath>
+            <targetPath readOnly="true"/>
+        </setting>
+        <setting ref="IconSkinId" name="Icon Theme ID" type="string">
+            <desc>Icon Theme id. </desc>
+        </setting>				
+    </confml:setting>	
+		
+		<setting ref="URLs"	 name="URLs"  minOccurs="0" type="sequence" mapKey="URLTitle" mapValue="URLTitle">
+			<setting ref="URLTitle" name="URL Title" type="string" required="true">
+				<desc>Title of the Operator URL</desc>
+			</setting>	 
+			<setting ref="URLShortTitle" name="URL Short Title" type="string" >
+				<desc>Short Title of the Operator URL. Optional. Displayed when shortcut to Url is added to Homescreen</desc>
+			</setting>	 			
+			<setting ref="URL" name="URL" type="string" required="true">
+				<desc>URL</desc>
+				<xs:pattern value="(http(|s)://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&amp;=]*)?|)"/>
+			</setting>
+			<setting ref="URLIcon" name="URL Icon" type="file">
+				<desc>Icon for the Operator URL.</desc>
+				<property name="type" value="image/svg" unit="mime"/>
+				<localPath></localPath>
+				<targetPath readOnly="true"/>
+			</setting>
+			<setting ref="IconSkinId" name="Icon Theme ID" type="string">
+				<desc>Icon Theme id. </desc>
+			</setting>
+		</setting>	
+			
+		<confml:setting ref="Items"	 name="Collections content" type="sequence" >
+			<setting ref="Type" name="Item type" type="selection">
+				<desc>Type of collection item.</desc>
+				<option name="Application" value="1"/>
+				<option name="Homescreen widget" value="2"/>
+				<option name="URL" value="3"/>
+			</setting>
+			<setting ref="Application" name="Application" type="string" relevant="Type='1'" required="true">
+				<desc>Application item for Operator collection.</desc>
+				<xs:pattern value="^[-+]?[0-9]{10}"/>
+				<!-- option map="DFSFeatures/Application"/>
+				<option map="CIA_PreinstalledContent/PreInstalledJavaRom"/>
+				<option map="CIA_PreinstalledContent/PreInstalledSymbianROM"/>
+				<option map="CIA_PreinstalledContent/PreInstalledSymbianUDA"/>
+				<option map="CIA_PreinstalledContent/PreInstalledJavaUDA"/-->
+			</setting>
+			<setting ref="HomescreenWidget" name="Homescreen widget" type="string" relevant="Type='2'" required="true">
+				<desc>Homescreen widget item for Operator collection</desc>
+				<!-- option map="HomescreenWidgets/Widgets"/>
+				<option map="CIA_PreinstalledWidgetUDA/PreInstalledWidgetUDA" /-->
+			</setting>
+			<setting ref="URL" name="URL" type="selection" relevant="Type='3'" required="true">
+				<option map="CaStorageDbSetting/URLs"/>
+			</setting>
+			<confml:setting ref="ColName" name="Place in collection" type="selection" required="true">
+				<confml:desc>Collection where entry will be added.</confml:desc>
+				<confml:option map="CaStorageDbSetting/Collections"/>
+			</confml:setting>
+			<setting ref="Comments" name="Item comments" type="string">
+				<desc>Intended only for informative purpose for customization.</desc>
+			</setting>
+		</confml:setting>
+	</confml:feature>
+</confml:configuration>
\ No newline at end of file
--- a/contentstorage/castorage/conf/castoragedb.confml	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/conf/castoragedb.confml	Wed Aug 18 10:05:49 2010 +0300
@@ -1,77 +1,56 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<confml:configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:confml="http://www.s60.com/xml/confml/2" xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Content storage database settings">
-  <confml:feature ref="CaStorageDbSetting" name="Application Library model">
-    <confml:setting ref="Collections" mapKey="Name" mapValue="Name" name="Collections" type="sequence">
-      <confml:setting ref="Name" name="Name" type="string">
-        <confml:desc>Collection name. It is only identifier. Localized name should be used too.</confml:desc>
-      </confml:setting>
-      <confml:setting ref="GroupName" name="Collection Group Name" type="string">
-        <confml:desc>Group name. Identify collection where application with predefined group name should be added after installation. Should be the same as not localized name.</confml:desc>
-      </confml:setting>
-      <confml:setting ref="Flags" name="Lock collection and content" type="selection">
-      	<confml:desc>Lock operator collection and content - user can not delete operator collection, prevent renaming collection and even content. Not possible by user to add new content to locked collection</confml:desc>
-      	<confml:option name="locked" value='0'/>
-      	<confml:option name="unlocked" value='4'/>
-      </confml:setting>
-      <confml:setting ref="LocName" name="Localzied Name" type="string">
-        <confml:desc>Localized Collection name. Localized names are taken from contentstorage_*.ts file( for example contentstorage_en_GB.ts ). If text hasn't been found in ts file this one wouldn't be translated. Leave empty field if collection name sholdn't be localized.</confml:desc>
-      </confml:setting>
-      <confml:setting ref="IconFileName" name="Icon filename" type="string">
-        <confml:desc>Collection Icon filename. Optional.</confml:desc>
-      </confml:setting>
-      <confml:setting ref="IconSkinId" name="Icon skin id" type="string">
-        <confml:desc>Collection Icon skin id. Optional.</confml:desc>
-      </confml:setting>
-    </confml:setting>
-    <confml:setting ref="Items"  name="Items" type="sequence" >
-      <confml:setting ref="Type" name="Entry type" type="selection">
-      	<confml:desc>Type of entry. Must.</confml:desc>
-      	<confml:option name="application" value="application"/>
-      	<confml:option name="url" value="url"/>
-      	<confml:option name="hs widget" value="widget"/>
-      </confml:setting>
-      <confml:setting ref="Name" name="Entry name" type="string">
-        <confml:desc>Name. In case of applications and homescreen widgets this is only information field( Names are taken from system ).</confml:desc>
-      </confml:setting>
-      <confml:setting ref="DestinationUid" name="Uid" type="string" relevant="Type=&quot;application&quot;">
-        <confml:desc>Application uid. Uid of application in decimal format. Must for application type.</confml:desc>
-        <xs:pattern value="^[-+]?[0-9]{9}"/>
-      </confml:setting>
-      <confml:setting ref="DestinationUrl" name="Url" type="string" relevant="Type=&quot;url&quot;">
-        <confml:desc>Url. Must for url type.</confml:desc>
-        <xs:pattern value="(http(|s)://([\w-]+\.)+[\w-]+(:[0-9]{1,5})?(/[\w- ./?%&amp;=]*)?|)"/>
-      </confml:setting>
-      <confml:setting ref="DestinationWidgetUri" name="Homescreen widget Uri" type="string" relevant="Type=&quot;widget&quot;">
-        <confml:desc>HS Widget Uri. Must for hs widget type.</confml:desc>
-      </confml:setting>
-      <confml:setting ref="IconFileName" name="Icon filename" type="string">
-        <confml:desc>Icon filename. Optional.</confml:desc>
-      </confml:setting>
-      <confml:setting ref="IconSkinId" name="Icon skin Id" type="string">
-        <confml:desc>Icon skin id. Optional.</confml:desc>
-      </confml:setting>
-      <confml:setting ref="Col_Name" name="In collection " type="selection">
-        <confml:desc>Collection where entry will be added.</confml:desc>
-        <confml:option map="CaStorageDbSetting/Collections"/>
-      </confml:setting>
-    </confml:setting>
-  </confml:feature>
-   <confml:data>
-    <confml:CaStorageDbSetting>
-      <confml:Collections extensionPolicy="replace"><confml:Name>Favorites</confml:Name><confml:GroupName>Favorites</confml:GroupName><confml:Flags>4</confml:Flags><confml:LocName></confml:LocName><confml:IconFileName>qtg_large_applications_user</confml:IconFileName></confml:Collections>
-      <confml:Items extensionPolicy="append"><confml:Type>application</confml:Type><confml:Name>calendar</confml:Name><confml:DestinationUid>268458241</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Camera</confml:Name><confml:DestinationUid>270501242</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Contacts</confml:Name><confml:DestinationUid>537014009</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Email</confml:Name><confml:DestinationUid>537023930</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>FM Radio</confml:Name><confml:DestinationUid>270530934</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Internet</confml:Name><confml:DestinationUid>222222222</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Maps</confml:Name><confml:DestinationUid>222222222</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Messaging</confml:Name><confml:DestinationUid>537001593</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Music</confml:Name><confml:DestinationUid>270564450</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Photos (camera)</confml:Name><confml:DestinationUid>536913858</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Settings</confml:Name><confml:DestinationUid>268458220</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-      <confml:Items><confml:Type>application</confml:Type><confml:Name>Videos (video camera)</confml:Name><confml:DestinationUid>222222222</confml:DestinationUid><confml:IconFileName></confml:IconFileName><confml:Col_Name map="CaStorageDbSetting/Collections[@key='Favorites']"></confml:Col_Name></confml:Items>
-    </confml:CaStorageDbSetting>
-  </confml:data>
+<confml:configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.s60.com/xml/confml/2" xmlns:confml="http://www.s60.com/xml/confml/2" xsi:schemaLocation="http://www.s60.com/xml/confml/2 http://www.s60.com/xml/confml/1#//confml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Content storage database settings">
+    <confml:data>
+        <confml:CaStorageDbSetting>
+     
+            <Collections template="true">
+                <LocalizeNames>false</LocalizeNames>
+                <TranslationFile>contentstorage</TranslationFile>
+                <Icon><localPath>dummy</localPath></Icon>
+            </Collections>
+
+            <OperatorCollections template="true">
+                <Icon><localPath>dummy</localPath></Icon>
+            </OperatorCollections>
+            
+            <URLs template="true">
+                <URLIcon><localPath>dummy</localPath></URLIcon>
+            </URLs>
+            
+            <OperatorURLs template="true">
+                 <OperatorURLIcon><localPath>dummy</localPath></OperatorURLIcon>
+            </OperatorURLs>
+            
+            <Collections extensionPolicy="append"><LocalizeNames>true</LocalizeNames><TranslationFile>contentstorage</TranslationFile><Name>txt_applib_dblist_essentials</Name>
+                <ShortName/><TitleName>txt_applib_subtitle_essentials</TitleName><GroupName>Favorites</GroupName><Locked>true</Locked>
+                <Icon><localPath>dummy</localPath></Icon><IconSkinId/>
+            </Collections>
+            
+            <confml:Items extensionPolicy="append"><confml:Type>1</confml:Type><confml:Application>268458241</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>Calendar</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>270501242</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>Camera</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>537014009</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>Contacts</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>537023930</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>Email</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>270530934</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>FM Radio</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>222242222</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments></Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>222332222</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments></Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>537001593</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>Messaging</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>270564450</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>Music</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>536913858</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>Photos</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>268458220</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments>Settings</Comments></confml:Items>
+            <confml:Items><confml:Type>1</confml:Type><confml:Application>222111222</confml:Application><ColName map="CaStorageDbSetting/Collections[@key='txt_applib_dblist_essentials']"></ColName>
+                <Comments></Comments></confml:Items>
+        </confml:CaStorageDbSetting>
+    </confml:data>
 
 </confml:configuration>
\ No newline at end of file
--- a/contentstorage/castorage/conf/castoragedb.implml	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/conf/castoragedb.implml	Wed Aug 18 10:05:49 2010 +0300
@@ -40,5 +40,21 @@
         </command>
     </commandml>
 
+    <content xmlns="http://www.s60.com/xml/content/2">
+        <output dir="content/private/20022F35/customsvg" flatten="true" >
+        <input>
+            <include files="${CaStorageDbSetting.Collections.Icon.localPath}"/>
+        </input>
+        <input>
+            <include files="${CaStorageDbSetting.URLs.URLIcon.localPath}"/>
+        </input>
+        <input>
+            <include files="${CaStorageDbSetting.OperatorCollections.Icon.localPath}"/>
+        </input>
+        <input>
+            <include files="${CaStorageDbSetting.OperatorURLs.OperatorURLIcon.localPath}"/>
+        </input>
+        </output>
+    </content>
 
 </container>
\ No newline at end of file
--- a/contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/conf/castoragedb_templates/castoragedb_variant.sql	Wed Aug 18 10:05:49 2010 +0300
@@ -1,33 +1,98 @@
 SELECT "------------------------------------" AS " ";
 SELECT "castoragedb_variant - BEGIN" AS " ";
 
+{% for col in range(feat_tree.CaStorageDbSetting.OperatorCollections._value|length) -%}
+    {%- set Name = feat_tree.CaStorageDbSetting.OperatorCollections.Name._value[col] or '' -%}
+    {%- set ShortName = feat_tree.CaStorageDbSetting.OperatorCollections.ShortName._value[col] or '' -%}
+    {%- set TitleName = feat_tree.CaStorageDbSetting.OperatorCollections.TitleName._value[col] or '' -%}
+    {%- set GroupName = feat_tree.CaStorageDbSetting.OperatorCollections.GroupName._value[col] or '' -%}
+    {%- set Locked = feat_tree.CaStorageDbSetting.OperatorCollections.Locked._value[col] or false -%}
+    {%- set IconFileName = ( feat_tree.CaStorageDbSetting.OperatorCollections.Icon.localPath._value[col] or '' ) -%}
+    {%- set IconSkinId = feat_tree.CaStorageDbSetting.OperatorCollections.IconSkinId._value[col] or '' -%}
+    {% if IconSkinId == "" and IconFileName != "" and IconFileName != "dummy" -%}
+        {% set IconFileName = "z:\\private\\20022F35\\customsvg\\" + IconFileName %}
+    {% endif %}
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if TitleName -%},  COL_TITLE_NAME{%- endif %} {% if ShortName -%}, COL_SHORT_NAME{%- endif %}, ICON_FILENAME, ICON_SKIN_ID) 
+VALUES ( '{{Name}}', '{{GroupName}}', {% if Locked -%} 12 {% else %} 8 {%- endif %} {% if TitleName -%}, "{{TitleName}}"{%- endif %} {% if ShortName -%}, "{{ShortName}}"{%- endif %}, "{{IconFileName}}", "{{IconSkinId}}");
+{% endfor %}
+
+{% for i in range(feat_tree.CaStorageDbSetting.OperatorURLs._value|length) -%}
+    {% set URLTitle = feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURLTitle._value[i] %}
+    {%- set URLShortTitle = feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURLShortTitle._value[i] or '' -%}
+    {%- set URL = feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURL._value[i] or '' -%}
+    {%- set URLIcon = feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURLIcon.localPath._value[i] or '' -%}
+    {%- set IconSkinId = feat_tree.CaStorageDbSetting.OperatorURLs.IconSkinId._value[i] or '' -%}
+    {% if IconSkinId == "" and URLIcon != "" and URLIcon != "dummy" -%}
+        {% set URLIcon = "z:\\private\\20022F35\\customsvg\\" + URLIcon %}
+    {% endif %}
+    INSERT INTO URL ( URL_TITLE {% if URLShortTitle -%}, URL_SHORT_TITLE{%- endif %}, URL_DEST, ICON_FILENAME, ICON_SKIN_ID )
+    VALUES ('{{URLTitle}}' {% if URLShortTitle -%}, "{{URLShortTitle}}"{%- endif %}, "{{URL}}", "{{URLIcon}}", "{{IconSkinId}}" );
+{% endfor %}
+
+{% for index in range(feat_tree.CaStorageDbSetting.OperatorCollectionItems._value|length) -%}
+    {% set Collection = feat_tree.CaStorageDbSetting.OperatorCollections.Name._value[0] %}
+    {%- set Type = feat_tree.CaStorageDbSetting.OperatorCollectionItems.Type._value[index] or '' -%}
+    {%- set Application = feat_tree.CaStorageDbSetting.OperatorCollectionItems.Application._value[index] or '' -%}
+    {%- set OperatorURLTitle = feat_tree.CaStorageDbSetting.OperatorCollectionItems.OperatorURL._value[index] or '' -%}
+    {%- set HomescreenWidget = feat_tree.CaStorageDbSetting.OperatorCollectionItems.HomescreenWidget._value[index] or '' -%}
+{% if Type == "1" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
+  VALUES ("application", '', {{Application}},  '{{Collection}}' );{%- endif %}
+{% if Type == "3" -%}
+  {% for i in range(feat_tree.CaStorageDbSetting.OperatorURLs._value|length) if OperatorURLTitle == feat_tree.CaStorageDbSetting.OperatorURLs.OperatorURLTitle._value[i] -%}
+    INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, COLLECTION_NAME)
+    VALUES ( "url", '{{OperatorURLTitle}}',  '{{Collection}}' );
+  {% endfor %}
+{%- endif %}
+{% if Type == "2" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, URI, COLLECTION_NAME ) 
+  VALUES ("widget", '', '', '', "{{HomescreenWidget}}", '{{Collection}}' ); {%- endif %}
+{% endfor %}
+
 {% for col in range(feat_tree.CaStorageDbSetting.Collections._value|length) -%}
     {%- set Name = feat_tree.CaStorageDbSetting.Collections.Name._value[col] or '' -%}
+    {% set LocalizeNames = feat_tree.CaStorageDbSetting.Collections.LocalizeNames._value[col] or false -%}
+    {%- set ShortName = feat_tree.CaStorageDbSetting.Collections.ShortName._value[col] or '' -%}
+    {%- set TitleName = feat_tree.CaStorageDbSetting.Collections.TitleName._value[col] or '' -%}
     {%- set GroupName = feat_tree.CaStorageDbSetting.Collections.GroupName._value[col] or '' -%}
-    {%- set Flags = feat_tree.CaStorageDbSetting.Collections.Flags._value[col] or '' -%}
-    {%- set LocName = feat_tree.CaStorageDbSetting.Collections.LocName._value[col] or ''-%}
-    {%- set IconFileName = feat_tree.CaStorageDbSetting.Collections.IconFileName._value[col] or '' -%}
+    {%- set Locked = feat_tree.CaStorageDbSetting.Collections.Locked._value[col] or false -%}
+    {%- set TranslationFile = feat_tree.CaStorageDbSetting.Collections.TranslationFile._value[col]|string|reverse|replace('_','',1)|reverse+'_' or ''-%}
+    {%- set IconFileName = feat_tree.CaStorageDbSetting.Collections.Icon.localPath._value[col] or '' -%}
     {%- set IconSkinId = feat_tree.CaStorageDbSetting.Collections.IconSkinId._value[col] or '' -%}
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if LocName -%}, COL_LOCNAME{%- endif %}{% if IconFileName -%}, ICON_FILENAME{%- endif %}{% if IconSkinId -%}, ICON_SKIN_ID{%- endif %}) 
-VALUES ( '{{Name}}', '{{GroupName}}', {{Flags}} {% if LocName -%},  "{{LocName}}"{%- endif %}{% if IconFileName -%}, "{{IconFileName}}"{%- endif %}{% if IconSkinId -%}, "{{IconSkinId}}"{%- endif %});
+    {% if IconSkinId == "" and IconFileName != "" and IconFileName != "dummy" -%}
+        {% set IconFileName = "z:\\private\\20022F35\\customsvg\\" + IconFileName %}
+    {% endif %}
+INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, FLAGS {% if TitleName -%},  COL_TITLE_NAME{%- endif %}{% if LocalizeNames -%},  TRANSLATION_FILE{%- endif %}{% if ShortName -%}, COL_SHORT_NAME{%- endif %}, ICON_FILENAME, ICON_SKIN_ID) 
+VALUES ( '{{Name}}', '{{GroupName}}', {% if Locked -%} 12 {% else %} 8 {%- endif %} {% if TitleName -%}, "{{TitleName}}"{%- endif %}{% if LocalizeNames -%}, "{{TranslationFile}}"{%- endif %}{% if ShortName -%}, "{{ShortName}}"{%- endif %}, "{{IconFileName}}", "{{IconSkinId}}");
+{% endfor %}
 
+{% for i in range(feat_tree.CaStorageDbSetting.URLs._value|length) -%}
+    {% set URLTitle = feat_tree.CaStorageDbSetting.URLs.URLTitle._value[i] %}
+    {%- set URLShortTitle = feat_tree.CaStorageDbSetting.URLs.URLShortTitle._value[i] or '' -%}
+    {%- set URL = feat_tree.CaStorageDbSetting.URLs.URL._value[i] or '' -%}
+    {%- set URLIcon = feat_tree.CaStorageDbSetting.URLs.URLIcon.localPath._value[i] or '' -%}
+    {%- set IconSkinId = feat_tree.CaStorageDbSetting.URLs.IconSkinId._value[i] or '' -%}
+    {% if IconSkinId == "" and URLIcon != "" and URLIcon != "dummy" -%}
+        {% set URLIcon = "z:\\private\\20022F35\\customsvg\\" + URLIcon %}
+    {% endif %}
+    INSERT INTO URL ( URL_TITLE {% if URLShortTitle -%}, URL_SHORT_TITLE{%- endif %}, URL_DEST, ICON_FILENAME, ICON_SKIN_ID ) 
+    VALUES ( '{{URLTitle}}' {% if URLShortTitle -%}, "{{URLShortTitle}}"{%- endif %}, "{{URL}}", "{{URLIcon}}", "{{IconSkinId}}" );
 {% endfor %}
 
 {% for index in range(feat_tree.CaStorageDbSetting.Items._value|length) -%}
     {%- set Type = feat_tree.CaStorageDbSetting.Items.Type._value[index] or '' -%}
-    {%- set Name = feat_tree.CaStorageDbSetting.Items.Name._value[index] or '' -%}
-    {%- set IconFileName = feat_tree.CaStorageDbSetting.Items.IconFileName._value[index] or '' -%}
-    {%- set IconSkinId = feat_tree.CaStorageDbSetting.Items.IconSkinId._value[index] or '' -%}
-    {%- set DestinationUid = feat_tree.CaStorageDbSetting.Items.DestinationUid._value[index] or '' -%}
-    {%- set DestinationUrl = feat_tree.CaStorageDbSetting.Items.DestinationUrl._value[index] or '' -%}
-    {%- set DestinationWidgetUri = feat_tree.CaStorageDbSetting.Items.DestinationWidgetUri._value[index] or '' -%}
-    {%- set Collection = feat_tree.CaStorageDbSetting.Items.Col_Name._value[index] or '' -%}
-{% if Type == "application" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("{{Type}}", '{{Name}}', {{DestinationUid}},  '{{Collection}}' );{%- endif %}
-{% if Type == "url" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, ICON_FILENAME, ICON_SKIN_ID, COLLECTION_NAME) 
-  VALUES ("{{Type}}", '{{Name}}', "{{DestinationUrl}}", "{{IconFileName}}", "{{IconSkinId}}",  '{{Collection}}' ); {%- endif %}
-{% if Type == "widget" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, URI, COLLECTION_NAME ) 
-  VALUES ("{{Type}}", '{{Name}}', "{{IconFileName}}", "{{IconSkinId}}", "{{DestinationWidgetUri}}", '{{Collection}}' ); {%- endif %}
+    {%- set Application = feat_tree.CaStorageDbSetting.Items.Application._value[index] or '' -%}
+    {%- set URLTitle = feat_tree.CaStorageDbSetting.Items.URL._value[index] or '' -%}
+    {%- set HomescreenWidget = feat_tree.CaStorageDbSetting.Items.HomescreenWidget._value[index] or '' -%}
+    {%- set Collection = feat_tree.CaStorageDbSetting.Items.ColName._value[index] or '' -%}
+{% if Type == "1" -%} INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
+  VALUES ("application", '', {{Application}},  '{{Collection}}' );{%- endif %}
+{% if Type == "3" -%}
+  {% for i in range(feat_tree.CaStorageDbSetting.URLs._value|length) if URLTitle == feat_tree.CaStorageDbSetting.URLs.URLTitle._value[i] -%}
+    INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, COLLECTION_NAME)
+    VALUES ( "url", '{{URLTitle}}',  '{{Collection}}' );
+  {% endfor %}
+{%- endif %}
+{% if Type == "2" -%} INSERT INTO WIDGET_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ICON_FILENAME, ICON_SKIN_ID, URI, COLLECTION_NAME ) 
+  VALUES ("widget", '{{HomescreenWidget}}', '', '', "{{HomescreenWidget}}", '{{Collection}}' ); {%- endif %}
 {% endfor %}
 
 SELECT "castoragedb_variant - END" AS " ";
Binary file contentstorage/castorage/data/castorage.db has changed
--- a/contentstorage/castorage/data/castoragedb_create.sql	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/data/castoragedb_create.sql	Wed Aug 18 10:05:49 2010 +0300
@@ -99,6 +99,9 @@
   AS SELECT 
     "" AS "COLLECTION_NAME",
     "" AS "COL_LOCNAME",
+    "" AS "TRANSLATION_FILE",
+    "" AS "COL_SHORT_NAME",
+    "" AS "COL_TITLE_NAME",
     "" AS "COL_APP_GROUP_NAME", 
     "" AS "ICON_FILENAME",
     "" AS "ICON_SKIN_ID",
@@ -112,24 +115,33 @@
   VALUES ( new.ICON_FILENAME, new.ICON_SKIN_ID);
   -- DELETE IF ICON IS NULL OR IF IT IS DUPLICATE
   DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND 
-      ( (IC_FILENAME IS NULL AND IC_SKIN_ID IS NULL) OR 
-        (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND ICON_ID <> last_insert_rowid()) IS NOT NULL OR 
-        (SELECT ICON_ID FROM CA_ICON WHERE IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
+      ( (IC_FILENAME = "" AND IC_SKIN_ID ="") OR 
+        (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
   -- INSERT ENTRY
     INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_FLAGS, EN_ICON_ID ) 
-    VALUES ( new.COLLECTION_NAME , 2, "collection",  new.FLAGS, (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME OR IC_SKIN_ID = new.ICON_SKIN_ID ));
+    VALUES ( new.COLLECTION_NAME , 2, "collection",  new.FLAGS, (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID ));
     -- LOCALIZATION 
     INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID ) 
-    VALUES ( 'CA_ENTRY', 'EN_TEXT', new.COL_LOCNAME, ( SELECT DB_VALUE FROM CA_DB_PROPERTIES WHERE DB_PROPERTY = "QMfile" ), ( SELECT last_insert_rowid() ) );
-    DELETE FROM CA_LOCALIZATION_TEXT WHERE LT_STRING_ID IS NULL AND LOC_TEXT_ID = last_insert_rowid() ;
+    VALUES ( 'CA_ENTRY', 'EN_TEXT', new.COLLECTION_NAME, new.TRANSLATION_FILE, ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
+    DELETE FROM CA_LOCALIZATION_TEXT WHERE LT_QMFILENAME IS NULL AND LOC_TEXT_ID = last_insert_rowid() ;
+    INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID ) 
+    VALUES ( 'CA_ATTRIBUTE', 'short_name', new.COL_SHORT_NAME, new.TRANSLATION_FILE, ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
+    DELETE FROM CA_LOCALIZATION_TEXT WHERE ( LT_QMFILENAME IS NULL OR LT_STRING_ID IS NULL ) AND LOC_TEXT_ID = last_insert_rowid();
+    INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID ) 
+    VALUES ( 'CA_ATTRIBUTE', 'title_name', new.COL_TITLE_NAME, new.TRANSLATION_FILE, ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
+    DELETE FROM CA_LOCALIZATION_TEXT WHERE ( LT_QMFILENAME IS NULL OR LT_STRING_ID IS NULL ) AND LOC_TEXT_ID = last_insert_rowid();
     -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
   INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) 
   VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections") , 
           (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME), 
           (SELECT IFNULL(MAX(GE_POSITION)+1, 1) FROM CA_GROUP_ENTRY WHERE GE_GROUP_ID = (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections")) );
-    -- ADD ATTRIBUTE
+    -- ADD ATTRIBUTES
     INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
     VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME AND (EN_TYPE_NAME = "collection::downloaded" OR EN_TYPE_NAME = "collection") ), "appgroup_name", new.COL_APP_GROUP_NAME );
+    INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
+    VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME AND (EN_TYPE_NAME = "collection::downloaded" OR EN_TYPE_NAME = "collection") ), "short_name", new.COL_SHORT_NAME );
+    INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )
+    VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME AND (EN_TYPE_NAME = "collection::downloaded" OR EN_TYPE_NAME = "collection") ), "title_name", new.COL_TITLE_NAME );
 END;
 
 -- CREATE VIEW ITEM_TO_COLLECTION
@@ -140,6 +152,7 @@
   AS SELECT 
     "" AS "ITEM_TYPE",
     "" AS "ITEM_NAME",
+    "" AS "ITEM_SHORTNAME",
     "" AS "ICON_FILENAME",
     "" AS "ICON_SKIN_ID",
     "" AS "ITEM_DEST",    
@@ -161,18 +174,6 @@
 SELECT "  CREATE TRIGGER item_to_collection_insert_url" AS " ";
 CREATE TRIGGER item_to_collection_insert_url INSTEAD OF INSERT ON ITEM_TO_COLLECTION WHEN new.ITEM_TYPE="url"
 BEGIN
-  -- INSERT ICON
-  INSERT OR IGNORE INTO CA_ICON (IC_FILENAME, IC_SKIN_ID) 
-  VALUES ( new.ICON_FILENAME, new.ICON_SKIN_ID);
-  DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND 
-      ( (IC_FILENAME IS NULL AND IC_SKIN_ID IS NULL) OR 
-        (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND ICON_ID <> last_insert_rowid()) IS NOT NULL OR 
-        (SELECT ICON_ID FROM CA_ICON WHERE IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);  
-  -- INSERT ENTRY
-  INSERT OR IGNORE INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID ) 
-  VALUES ( new.ITEM_NAME, 1, "url", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME OR IC_SKIN_ID = new.ICON_SKIN_ID ));
-  INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )  
-  VALUES ( ( SELECT last_insert_rowid() ) ,"url",new.ITEM_DEST);
   -- RELATION TO MAIN COLLECTION (ADD TO GROUP: )
   INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) 
   VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.COLLECTION_NAME) , 
@@ -203,12 +204,11 @@
   INSERT OR IGNORE INTO CA_ICON (IC_FILENAME, IC_SKIN_ID) 
   VALUES ( new.ICON_FILENAME, new.ICON_SKIN_ID);
   DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND 
-      ( (IC_FILENAME IS NULL AND IC_SKIN_ID IS NULL) OR 
-        (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND ICON_ID <> last_insert_rowid()) IS NOT NULL OR 
-        (SELECT ICON_ID FROM CA_ICON WHERE IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
+      ( (IC_FILENAME = "" AND IC_SKIN_ID = "") OR 
+        (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);
   -- INSERT ENTRY
   INSERT OR IGNORE INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID ) 
-  VALUES ( new.ITEM_NAME, 1, "widget", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME OR IC_SKIN_ID = new.ICON_SKIN_ID ));
+  VALUES ( new.ITEM_NAME, 1, "widget", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID ));
   -- INSERT ATTRIBUTES
   INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )  
   VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.ITEM_NAME ) ,"packageuid",new.PACKAGE_UID);
@@ -225,6 +225,39 @@
 
 
 
+-- CREATE VIEW URL
+SELECT "------------------------------------" AS " ";
+SELECT "CREATE VIEW URL" AS " ";
+DROP VIEW IF EXISTS URL;
+CREATE VIEW URL 
+  AS SELECT 
+    "" AS "URL_TITLE",
+    "" AS "URL_SHORT_TITLE",
+    "" AS "ICON_FILENAME",
+    "" AS "ICON_SKIN_ID",
+    "" AS "URL_DEST";
+
+SELECT "  CREATE TRIGGER insert_url" AS " ";
+CREATE TRIGGER insert_url INSTEAD OF INSERT ON URL
+BEGIN
+  -- INSERT ICON
+  INSERT OR IGNORE INTO CA_ICON (IC_FILENAME, IC_SKIN_ID) 
+  VALUES ( new.ICON_FILENAME, new.ICON_SKIN_ID);
+  DELETE FROM CA_ICON WHERE ICON_ID = last_insert_rowid() AND 
+      ( (IC_FILENAME = "" AND IC_SKIN_ID = "") OR 
+        (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME  AND IC_SKIN_ID = new.ICON_SKIN_ID AND ICON_ID <> last_insert_rowid()) IS NOT NULL);  
+  -- INSERT ENTRY
+  INSERT OR IGNORE INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID ) 
+  VALUES ( new.URL_TITLE, 1, "url", (SELECT ICON_ID FROM CA_ICON WHERE IC_FILENAME = new.ICON_FILENAME AND IC_SKIN_ID = new.ICON_SKIN_ID ) );
+  -- ADD ATTRIBUTES
+  INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )  
+  VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.URL_TITLE ), "url", new.URL_DEST );
+  INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )  
+  VALUES ( ( SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TEXT = new.URL_TITLE ) ,"short_name", new.URL_SHORT_TITLE );
+END;
+
+
+
 -- insert neccessary items
 SELECT "INSERT menucollections ENTRY" AS " ";
 INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID, EN_UID ) 
@@ -235,23 +268,31 @@
 
 SELECT "------------------------------------" AS " ";
 SELECT "INSERT Downloaded collection ENTRY" AS " ";
-INSERT INTO CA_ICON (IC_FILENAME) 
-VALUES ( "qtg_large_applications_download");
+INSERT INTO CA_ICON (IC_FILENAME, IC_SKIN_ID) 
+VALUES ( "qtg_large_applications_download", "" );
 
 INSERT INTO CA_ENTRY (EN_TEXT, EN_ROLE, EN_TYPE_NAME, EN_ICON_ID,  EN_FLAGS ) 
-VALUES ( 'Downloaded', 2, "collection::downloaded", last_insert_rowid() , 8 );
+VALUES ( 'txt_applib_dblist_downloads', 2, "collection::downloaded", ( SELECT MAX(ICON_ID) FROM CA_ICON ) , 8 );
+
+INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )  
+VALUES ( ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ), "appgroup_name", "Downloaded" );
 
 INSERT OR IGNORE INTO CA_ATTRIBUTE (AT_ENTRY_ID, AT_NAME, AT_VALUE )  
-VALUES ( last_insert_rowid(), "appgroup_name", " Downloaded" );
+VALUES ( ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ), "title_name", "txt_applib_subtitle_downloads" );
 
 INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID ) 
-VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_downloaded",( SELECT DB_VALUE FROM CA_DB_PROPERTIES WHERE DB_PROPERTY = "QMfile" ), ( SELECT last_insert_rowid() ) );
+VALUES ( 'CA_ENTRY', 'EN_TEXT', "txt_applib_dblist_downloads",( SELECT DB_VALUE FROM CA_DB_PROPERTIES WHERE DB_PROPERTY = "QMfile" ), ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
+
+INSERT INTO CA_LOCALIZATION_TEXT ( LT_TABLE_NAME, LT_ATTRIBUTE_NAME, LT_STRING_ID, LT_QMFILENAME, LT_ROW_ID ) 
+VALUES ( 'CA_ATTRIBUTE', 'title_name', "txt_applib_subtitle_downloads",( SELECT DB_VALUE FROM CA_DB_PROPERTIES WHERE DB_PROPERTY = "QMfile" ), ( SELECT MAX(ENTRY_ID) FROM CA_ENTRY ) );
 
 INSERT INTO CA_GROUP_ENTRY (GE_GROUP_ID, GE_ENTRY_ID, GE_POSITION) 
 VALUES ( (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "menucollections") , 
           (SELECT ENTRY_ID FROM CA_ENTRY WHERE EN_TYPE_NAME = "collection::downloaded"), 
           1 ); 
 
+          
+          
 SELECT "------------------------------------" AS " ";
 SELECT "castoragedb_create - END" AS " ";
 SELECT "------------------------------------" AS " ";
--- a/contentstorage/castorage/data/castoragedb_variant.sql	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-SELECT "------------------------------------" AS " ";
-SELECT "castoragedb_variant - BEGIN" AS " ";
-
-
--- insert additional items
-
-INSERT INTO COLLECTION (COLLECTION_NAME, COL_APP_GROUP_NAME, ICON_FILENAME, FLAGS) VALUES ( 'Favorites', 'Favorites', "qtg_large_applications_user", 4 );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'calendar', 268458241,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Camera', 270501242,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Contacts', 537014009,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Email', 537023930,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'FM Radio', 270530934,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Internet', 222222222,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Maps', 222222222,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Messaging', 537001593,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Music', 270564450,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Photos (camera)', 536913858,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Settings', 268458220,  'Favorites' );
-  INSERT INTO ITEM_TO_COLLECTION (ITEM_TYPE, ITEM_NAME, ITEM_DEST, COLLECTION_NAME) 
-  VALUES ("application", 'Videos (video camera)', 222222222,  'Favorites' );
-
-
-SELECT "castoragedb_variant - END" AS " ";
-SELECT "------------------------------------" AS " ";
-
Binary file contentstorage/castorage/data/stub/castorage.db has changed
--- a/contentstorage/castorage/inc/caconsts.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/inc/caconsts.h	Wed Aug 18 10:05:49 2010 +0300
@@ -19,6 +19,7 @@
 #define CACONSTS_H_
 
 _LIT( KDbName, "castorage.db" );
+_LIT( KDbNameBackup, "castorage.backup" );
 _LIT( KCDrive, "c:" );
 _LIT( KZDrive, "z:" );
 _LIT( KDoubleSlash, "\\" );
--- a/contentstorage/castorage/inc/casqlcommands.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/inc/casqlcommands.h	Wed Aug 18 10:05:49 2010 +0300
@@ -74,6 +74,10 @@
 EN_TEXT = :LT_STRING WHERE ENTRY_ID = :LT_ROW_ID"); // WHERE ENTRY_ID must be changed if an attribute
 _LIT( KSQLLocalizeDescriptionEntry, "UPDATE CA_ENTRY SET \
 EN_DESCRIPTION = :LT_STRING WHERE ENTRY_ID = :LT_ROW_ID"); // WHERE ENTRY_ID must be changed if an attribute
+_LIT( KSQLLocalizeShortNameAttribute, "UPDATE CA_ATTRIBUTE SET \
+AT_VALUE = :LT_STRING WHERE AT_ENTRY_ID = :LT_ROW_ID AND AT_NAME = \"short_name\""); 
+_LIT( KSQLLocalizeTitleNameAttribute, "UPDATE CA_ATTRIBUTE SET \
+AT_VALUE = :LT_STRING WHERE AT_ENTRY_ID = :LT_ROW_ID AND AT_NAME = \"title_name\""); 
 
 _LIT( KSQLUpdatePositionInGroup, "UPDATE CA_GROUP_ENTRY SET \
 GE_POSITION = :GE_POSITION WHERE \
@@ -346,6 +350,9 @@
 _LIT( KColumnEnUid, "EN_UID" );
 _LIT( KColumnEnFlags, "EN_FLAGS" );
 
+_LIT( KShortName, "short_name");
+_LIT( KTitleName, "title_name");
+
 _LIT( KColumnGroupEntryId, "GROUP_ENTRY_ID" );
 _LIT( KColumnGEIdGroup, "GE_GROUP_ID" );
 _LIT( KColumnGEPosition, "GE_POSITION" );
--- a/contentstorage/castorage/inc/casqlitestorage.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/inc/casqlitestorage.h	Wed Aug 18 10:05:49 2010 +0300
@@ -66,6 +66,18 @@
      * Loads data base from rom.
      */
     void LoadDataBaseFromRomL();
+    
+    //from CCpStorage
+    /**
+     * Saves a copy of database to private.
+     */
+    void SaveDatabaseL();
+
+    //from CCpStorage
+    /**
+     * Restores a copy of database from backup to private.
+     */
+    void RestoreDatabaseL();
 
     /**
      * Localizes one entry attribute.
@@ -161,8 +173,9 @@
     /**
      * Add ifno launch to db.
      * @param aEntryId.
+     * @param aRemovable.
      */
-    void TouchL( const TInt aEntryId );
+    void TouchL( const TInt aEntryId, TBool aRemovable );
 
     /**
      * Get database property from db.
@@ -224,7 +237,7 @@
     void ExecuteOrganizeL( const RArray<TInt>& aEntryIds,
             TCaOperationParams aParams );
 
-    void ExecuteTouchL( const TInt aEntryId );
+    void ExecuteTouchL( const TInt aEntryId, TBool aRemovable );
 
     void ExecuteDbPropertyL( const TDesC& aProperty, TDes& aPropertyValue );
 
@@ -270,6 +283,11 @@
      * Private path on C-drive.
      */
     TFileName iPrivatePathCDrive;
+    
+    /**
+     * Private path on C-drive for backup db.
+     */
+    TFileName iPrivatePathCDriveDbBackup;
 
     /**
      * RFs session.
--- a/contentstorage/castorage/inc/casqlquerycreator.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/inc/casqlquerycreator.h	Wed Aug 18 10:05:49 2010 +0300
@@ -107,11 +107,13 @@
      *
      * @param aSqlQuery The list of result queries needed for the touch 
      * operation.
-     * @param aSqlDb The handle to the database needed for the created 
+     * @param aSqlDb The handle to the database needed for the created. 
+     * @param aRemovable to create query to change used flag only for 
+     * removable entries.
      * queries' member (RSqlStatement iStatement).
      */
     static void CreateTouchQueryL( RPointerArray<CCaSqlQuery>& aSqlQuery,
-            RSqlDatabase& aSqlDb );
+            RSqlDatabase& aSqlDb, TBool aRemovable );
 
     /**
      * Creates an sql query to organize data within a group.
--- a/contentstorage/castorage/inc/castorage.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/inc/castorage.h	Wed Aug 18 10:05:49 2010 +0300
@@ -113,8 +113,9 @@
      * Stores touch data information in storage.
      *
      * @param aEntryId The entry id for which touch data should be stored.
+     * @param aRemovable if entry is removable then flag is set if necessary.
      */
-    virtual void TouchL( const TInt aEntryId ) = 0;
+    virtual void TouchL( const TInt aEntryId, TBool aRemovable ) = 0;
 
     /**
      * Get database property from db.
@@ -148,6 +149,17 @@
     virtual void CustomSortL( const RArray<TInt>& aEntryIds,
             const TInt aGroupId ) = 0;
 
+    
+    /**
+    * Saves a copy of database to private.
+    */
+    virtual void RestoreDatabaseL() = 0;
+        
+    /**
+     * Saves a copy of database to private.
+     */
+    virtual void SaveDatabaseL() = 0;
+    
     /**
      * Loads data base from rom.
      */
--- a/contentstorage/castorage/src/casqlitestorage.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/src/casqlitestorage.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -53,6 +53,9 @@
     User::LeaveIfError( CreatePrivateDirPath( iPrivatePathCDrive, KCDrive,
             KNullDesC ) );
     
+    User::LeaveIfError( CreatePrivateDirPath( iPrivatePathCDriveDbBackup, KCDrive,
+    		KDbNameBackup ) );
+    
 
     if( iSqlDb.Open( iPrivatePathCDriveDb, &KSqlDbConfig ) )
         {
@@ -108,6 +111,40 @@
     }
 
 // ---------------------------------------------------------------------------
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CCaSqLiteStorage::SaveDatabaseL()
+    {
+    if( ( BaflUtils::FileExists( iRfs, iPrivatePathCDriveDb ) ) )
+        {
+        iSqlDb.Close();
+        User::LeaveIfError( BaflUtils::CopyFile( iRfs,
+                iPrivatePathCDriveDb, iPrivatePathCDriveDbBackup ) );
+        User::LeaveIfError( iSqlDb.Open( iPrivatePathCDriveDb,
+                &KSqlDbConfig ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+//
+// ---------------------------------------------------------------------------
+//
+void CCaSqLiteStorage::RestoreDatabaseL()
+    {
+    if( ( BaflUtils::FileExists( iRfs, iPrivatePathCDriveDbBackup ) ) )
+        {
+        iSqlDb.Close();
+        User::LeaveIfError( BaflUtils::CopyFile( iRfs,
+        		iPrivatePathCDriveDbBackup, iPrivatePathCDriveDb ) );
+        User::LeaveIfError( iSqlDb.Open( iPrivatePathCDriveDb,
+                &KSqlDbConfig ) );
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // CCASqLiteStorage::NewL()
 //
 // ---------------------------------------------------------------------------
@@ -214,7 +251,7 @@
 void CCaSqLiteStorage::LocalizeEntryL( CCaLocalizationEntry& aLocalization )
     {
     CCaSqlQuery* sqlLocalizeEntryQuery = CCaSqlQuery::NewLC( iSqlDb );
-    if( aLocalization.GetAttributeName().Compare( KColumnEnText ) == 0 )
+    if ( aLocalization.GetAttributeName().Compare( KColumnEnText ) == 0 )
         {
         CaSqlQueryCreator::CreateLocalizationTableQueryL( sqlLocalizeEntryQuery,
             KSQLLocalizeTextEntry );
@@ -225,6 +262,16 @@
         CaSqlQueryCreator::CreateLocalizationTableQueryL( sqlLocalizeEntryQuery,
             KSQLLocalizeDescriptionEntry );
         }
+    else if ( aLocalization.GetAttributeName().Compare( KShortName ) == 0 )
+        {
+        CaSqlQueryCreator::CreateLocalizationTableQueryL( sqlLocalizeEntryQuery,
+            KSQLLocalizeShortNameAttribute );
+        }
+    else if ( aLocalization.GetAttributeName().Compare( KTitleName ) == 0 )
+        {
+        CaSqlQueryCreator::CreateLocalizationTableQueryL( sqlLocalizeEntryQuery,
+            KSQLLocalizeTitleNameAttribute );
+        }
     sqlLocalizeEntryQuery->PrepareL();
     sqlLocalizeEntryQuery->BindValuesForLocalizeL( aLocalization );
     sqlLocalizeEntryQuery->ExecuteL( );
@@ -410,10 +457,10 @@
 //
 // ---------------------------------------------------------------------------
 //
-void CCaSqLiteStorage::TouchL( const TInt aEntryId )
+void CCaSqLiteStorage::TouchL( const TInt aEntryId, TBool aRemovable )
     {
     ExecuteStatementL( KSqlStatementBegin );
-    TRAPD( err, ExecuteTouchL( aEntryId ) );
+    TRAPD( err, ExecuteTouchL( aEntryId, aRemovable ) );
     if( err )
         {
         ExecuteStatementL( KSqlStatementRollback );
@@ -483,14 +530,43 @@
 void CCaSqLiteStorage::CustomSortL( const RArray<TInt>& aEntryIds,
         const TInt aGroupId )
     {
+    RArray<TInt> entryIds;
+    CleanupClosePushL( entryIds );
+    for( TInt j=0; j<aEntryIds.Count(); j++ )
+        {
+        entryIds.AppendL(aEntryIds[j]);
+        }
+    
+    RArray<TInt> oldIds;
+    CleanupClosePushL( oldIds );
+    CCaInnerQuery* innerQuery = CCaInnerQuery::NewLC();
+    innerQuery->SetParentId( aGroupId );
+    
+    GetEntriesIdsL( innerQuery, oldIds );
+    
+    if( oldIds.Count() != entryIds.Count() )
+        {
+        for( TInt i=0; i<oldIds.Count(); i++ )
+            {
+            TInt oldId = oldIds[i];
+            if( entryIds.Find( oldId ) == KErrNotFound )
+                {
+                // instert apps with visible set on false on old positions
+                entryIds.InsertL( oldId, i );
+                }
+            }
+        }
+    
+    const RArray<TInt> constEntryIds( entryIds );
+    
     RPointerArray<CCaSqlQuery> sqlQueries;
-    CleanupResetAndDestroyPushL( sqlQueries );
+    CleanupResetAndDestroyPushL( sqlQueries ); 
 
     CaSqlQueryCreator::CreateCustomSortQueryL(
-            aEntryIds, sqlQueries, iSqlDb );
+            constEntryIds, sqlQueries, iSqlDb );
 
     ExecuteStatementL( KSqlStatementBegin );
-    TRAPD( err, ExecuteCustomSortL( aEntryIds, aGroupId, sqlQueries ) );
+    TRAPD( err, ExecuteCustomSortL( constEntryIds, aGroupId, sqlQueries ) );
     if( err )
         {
         ExecuteStatementL( KSqlStatementRollback );
@@ -499,6 +575,9 @@
     ExecuteStatementL( KSqlStatementCommit );
 
     CleanupStack::PopAndDestroy( &sqlQueries );
+    CleanupStack::PopAndDestroy( innerQuery );
+    CleanupStack::PopAndDestroy( &oldIds );
+    CleanupStack::PopAndDestroy( &entryIds );
     }
 
 // ---------------------------------------------------------------------------
@@ -748,12 +827,12 @@
 //
 // ---------------------------------------------------------------------------
 //
-void CCaSqLiteStorage::ExecuteTouchL( const TInt aEntryId )
+void CCaSqLiteStorage::ExecuteTouchL( const TInt aEntryId, TBool aRemovable )
     {
     RPointerArray<CCaSqlQuery> sqlQuery;
     CleanupResetAndDestroyPushL( sqlQuery );
 
-    CaSqlQueryCreator::CreateTouchQueryL( sqlQuery, iSqlDb );
+    CaSqlQueryCreator::CreateTouchQueryL( sqlQuery, iSqlDb, aRemovable );
 
     TTime time;
     time.UniversalTime();
--- a/contentstorage/castorage/src/casqlquerycreator.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/castorage/src/casqlquerycreator.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -555,7 +555,8 @@
 // ---------------------------------------------------------------------------
 //
 void CaSqlQueryCreator::CreateTouchQueryL(
-        RPointerArray<CCaSqlQuery>& aSqlQuery, RSqlDatabase& aSqlDb )
+        RPointerArray<CCaSqlQuery>& aSqlQuery, RSqlDatabase& aSqlDb, 
+        TBool aRemovable )
     {
     DEBUG(("_CA_:CASqlQueryCreator::CreateTouchQueryL"));
 
@@ -563,11 +564,13 @@
     query->SetQueryL( KSQLInsertToLaunch );
     aSqlQuery.Append( query );
     CleanupStack::Pop( query );
-
-    query = CCaSqlQuery::NewLC( aSqlDb );
-    query->SetQueryL( KSQLUpdateEntryUsedFlag );
-    aSqlQuery.Append( query );
-    CleanupStack::Pop( query );
+    if( aRemovable )
+        {
+        query = CCaSqlQuery::NewLC( aSqlDb );
+        query->SetQueryL( KSQLUpdateEntryUsedFlag );
+        aSqlQuery.Append( query );
+        CleanupStack::Pop( query );
+        }
     }
 
 // ---------------------------------------------------------------------------
--- a/contentstorage/cautils/inc/caentryattribute.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/cautils/inc/caentryattribute.h	Wed Aug 18 10:05:49 2010 +0300
@@ -129,7 +129,7 @@
      * @param aAttr Attribute value.
      * @return TBool ,ETrue if attribute was found
      */
-    IMPORT_C TBool Find( const TDesC& aName, TDes& aAttrVal );
+    IMPORT_C TBool Find( const TDesC& aName, TDes& aAttrVal ) const;
 
     /**
      * Find attribute by name.
@@ -138,7 +138,7 @@
      * @param aAttr Attribute value.
      * @return TBool, ETrue if attribute was found
      */
-    IMPORT_C TBool Find( const TDesC& aName, TPtrC& aAttrVal );
+    IMPORT_C TBool Find( const TDesC& aName, TPtrC& aAttrVal ) const;
 
     /*
      * Check if attribute exists
@@ -146,7 +146,7 @@
      * @param aName Name
      * @return ETrue if attribute exists
      */
-    IMPORT_C TBool Exist( const TDesC& aName );
+    IMPORT_C TBool Exist( const TDesC& aName ) const;
 
     /**
      * Remove attribute
--- a/contentstorage/cautils/src/caentryattribute.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/cautils/src/caentryattribute.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -116,7 +116,7 @@
 // RMenuSrvAttrArray::Find
 // ---------------------------------------------------------
 //
-EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TDes& aAttrVal )
+EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TDes& aAttrVal ) const
     {
     for( TInt i = 0; i < Count(); i++ )
         {
@@ -133,7 +133,7 @@
 // RMenuSrvAttrArray::Find
 // ---------------------------------------------------------
 //
-EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TPtrC& aAttrVal )
+EXPORT_C TBool RCaEntryAttrArray::Find( const TDesC& aName, TPtrC& aAttrVal ) const
     {
     for( TInt i = 0; i < Count(); i++ )
         {
@@ -150,7 +150,7 @@
 // RCaEntryAttrArray::Exist
 // ---------------------------------------------------------
 //
-EXPORT_C TBool RCaEntryAttrArray::Exist( const TDesC& aName )
+EXPORT_C TBool RCaEntryAttrArray::Exist( const TDesC& aName ) const
     {
     for( TInt i = 0; i < Count(); i++ )
         {
--- a/contentstorage/data/backup_registration.xml	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/data/backup_registration.xml	Wed Aug 18 10:05:49 2010 +0300
@@ -1,7 +1,7 @@
 <?xml version="1.0" standalone="yes"?>
 <backup_registration>
   <passive_backup>
-        <include_directory name = ""/>
-      </passive_backup>
+      <include_file name="castorage.backup"/>
+  </passive_backup>
   <restore requires_reboot = "yes"/>
-</backup_registration>
+</backup_registration>
\ No newline at end of file
--- a/contentstorage/eabi/camenuu.def	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/eabi/camenuu.def	Wed Aug 18 10:05:49 2010 +0300
@@ -25,4 +25,6 @@
 	_ZTV15CCaStorageProxy @ 24 NONAME
 	_ZN16CCaSrvMmcHistory4NewLEv @ 25 NONAME
 	_ZN15CCaStorageProxy16AddLocalizationLERK20CCaLocalizationEntry @ 26 NONAME
+	_ZN15CCaStorageProxy13SaveDatabaseLEv @ 27 NONAME
+	_ZN15CCaStorageProxy16RestoreDatabaseLEv @ 28 NONAME
 
--- a/contentstorage/eabi/cautilsu.def	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/eabi/cautilsu.def	Wed Aug 18 10:05:49 2010 +0300
@@ -16,89 +16,89 @@
 	_ZN13CCaInnerEntry8SetFlagsEj @ 15 NONAME
 	_ZN13CCaInnerEntry8SetTextLERK7TDesC16i @ 16 NONAME
 	_ZN13CCaInnerEntry9SetIconIdEi @ 17 NONAME
-	_ZN13CCaInnerQuery10SetFlagsOnEj @ 18 NONAME
-	_ZN13CCaInnerQuery11SetFlagsOffEj @ 19 NONAME
-	_ZN13CCaInnerQuery11SetParentIdEi @ 20 NONAME
-	_ZN13CCaInnerQuery12InternalizeLER11RReadStream @ 21 NONAME
-	_ZN13CCaInnerQuery13AddAttributeLERK7TDesC16S2_ @ 22 NONAME
-	_ZN13CCaInnerQuery17SetEntryTypeNamesEP16CDesC16ArrayFlat @ 23 NONAME
-	_ZN13CCaInnerQuery4NewLEv @ 24 NONAME
-	_ZN13CCaInnerQuery5NewLCEv @ 25 NONAME
-	_ZN13CCaInnerQuery6SetUidEj @ 26 NONAME
-	_ZN13CCaInnerQuery7SetIdsLERK6RArrayIiE @ 27 NONAME
-	_ZN13CCaInnerQuery7SetRoleEi @ 28 NONAME
-	_ZN13CCaInnerQuery7SetSortENS_14TSortAttributeE @ 29 NONAME
-	_ZN13CCaInnerQuery8SetCountEj @ 30 NONAME
-	_ZN15RCaEntriesArray12InternalizeLER11RReadStream @ 31 NONAME
-	_ZN17CCaEntryAttribute4NewLERK7TDesC16 @ 32 NONAME
-	_ZN17CCaEntryAttribute5NewLCERK7TDesC16 @ 33 NONAME
-	_ZN17CCaEntryAttribute9SetValueLERK7TDesC16 @ 34 NONAME
-	_ZN17RCaEntryAttrArray15RemoveAttributeERK7TDesC16 @ 35 NONAME
-	_ZN17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 36 NONAME
-	_ZN17RCaEntryAttrArray4FindERK7TDesC16R7TPtrC16 @ 37 NONAME
-	_ZN17RCaEntryAttrArray5ExistERK7TDesC16 @ 38 NONAME
-	_ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 39 NONAME
-	_ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 40 NONAME
-	_ZN20CCaLocalizationEntry14SetQmFilenameLERK7TDesC16 @ 41 NONAME
-	_ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 42 NONAME
-	_ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 43 NONAME
-	_ZN20CCaLocalizationEntry4NewLEv @ 44 NONAME
-	_ZN20CCaLocalizationEntry5NewLCEv @ 45 NONAME
-	_ZN20CCaLocalizationEntry8SetRowIdEj @ 46 NONAME
-	_ZN20CCaLocalizationEntry9SetTextIdEj @ 47 NONAME
-	_ZN22CCaInnerNotifierFilter11SetParentIdEi @ 48 NONAME
-	_ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 49 NONAME
-	_ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 50 NONAME
-	_ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 51 NONAME
-	_ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 52 NONAME
-	_ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 53 NONAME
-	_ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 54 NONAME
-	_ZN23CCaInnerIconDescription10SetSkinIdLERK7TDesC16 @ 55 NONAME
-	_ZN23CCaInnerIconDescription12SetFileNameLERK7TDesC16 @ 56 NONAME
-	_ZN23CCaInnerIconDescription17SetApplicationIdLERK7TDesC16 @ 57 NONAME
-	_ZN23CCaInnerIconDescription4NewLEv @ 58 NONAME
-	_ZN23CCaInnerIconDescription5NewLCEv @ 59 NONAME
-	_ZN23CCaInnerIconDescription5SetIdEi @ 60 NONAME
-	_ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 61 NONAME
-	_ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 62 NONAME
-	_ZNK11RCaIdsArray13MarshalDataLCEv @ 63 NONAME
-	_ZNK13CCaInnerEntry11isLocalizedENS_14TLocalizedTypeE @ 64 NONAME
-	_ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 65 NONAME
-	_ZNK13CCaInnerEntry13GetAttributesEv @ 66 NONAME
-	_ZNK13CCaInnerEntry14GetDescriptionEv @ 67 NONAME
-	_ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 68 NONAME
-	_ZNK13CCaInnerEntry4IconEv @ 69 NONAME
-	_ZNK13CCaInnerEntry5GetIdEv @ 70 NONAME
-	_ZNK13CCaInnerEntry6GetUidEv @ 71 NONAME
-	_ZNK13CCaInnerEntry7GetRoleEv @ 72 NONAME
-	_ZNK13CCaInnerEntry7GetTextEv @ 73 NONAME
-	_ZNK13CCaInnerEntry8GetFlagsEv @ 74 NONAME
-	_ZNK13CCaInnerEntry9GetIconIdEv @ 75 NONAME
-	_ZNK13CCaInnerQuery10GetFlagsOnEv @ 76 NONAME
-	_ZNK13CCaInnerQuery11GetFlagsOffEv @ 77 NONAME
-	_ZNK13CCaInnerQuery11GetParentIdEv @ 78 NONAME
-	_ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 79 NONAME
-	_ZNK13CCaInnerQuery13GetAttributesEv @ 80 NONAME
-	_ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 81 NONAME
-	_ZNK13CCaInnerQuery6GetIdsEv @ 82 NONAME
-	_ZNK13CCaInnerQuery6GetUidEv @ 83 NONAME
-	_ZNK13CCaInnerQuery7GetRoleEv @ 84 NONAME
-	_ZNK13CCaInnerQuery7GetSortEv @ 85 NONAME
-	_ZNK13CCaInnerQuery8GetCountEv @ 86 NONAME
-	_ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 87 NONAME
-	_ZNK20CCaLocalizationEntry11GetStringIdEv @ 88 NONAME
-	_ZNK20CCaLocalizationEntry12GetTableNameEv @ 89 NONAME
-	_ZNK20CCaLocalizationEntry13GetQmFilenameEv @ 90 NONAME
-	_ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 91 NONAME
-	_ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 92 NONAME
-	_ZNK20CCaLocalizationEntry8GetRowIdEv @ 93 NONAME
-	_ZNK20CCaLocalizationEntry9GetTextIdEv @ 94 NONAME
-	_ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 95 NONAME
-	_ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 96 NONAME
-	_ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 97 NONAME
-	_ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 98 NONAME
-	_ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 99 NONAME
-	_ZNK22CCaInnerNotifierFilter6GetIdsEv @ 100 NONAME
-	_ZN13CCaInnerQuery10SetChildIdEi @ 101 NONAME
-	_ZNK13CCaInnerQuery10GetChildIdEv @ 102 NONAME
+	_ZN13CCaInnerQuery10SetChildIdEi @ 18 NONAME
+	_ZN13CCaInnerQuery10SetFlagsOnEj @ 19 NONAME
+	_ZN13CCaInnerQuery11SetFlagsOffEj @ 20 NONAME
+	_ZN13CCaInnerQuery11SetParentIdEi @ 21 NONAME
+	_ZN13CCaInnerQuery12InternalizeLER11RReadStream @ 22 NONAME
+	_ZN13CCaInnerQuery13AddAttributeLERK7TDesC16S2_ @ 23 NONAME
+	_ZN13CCaInnerQuery17SetEntryTypeNamesEP16CDesC16ArrayFlat @ 24 NONAME
+	_ZN13CCaInnerQuery4NewLEv @ 25 NONAME
+	_ZN13CCaInnerQuery5NewLCEv @ 26 NONAME
+	_ZN13CCaInnerQuery6SetUidEj @ 27 NONAME
+	_ZN13CCaInnerQuery7SetIdsLERK6RArrayIiE @ 28 NONAME
+	_ZN13CCaInnerQuery7SetRoleEi @ 29 NONAME
+	_ZN13CCaInnerQuery7SetSortENS_14TSortAttributeE @ 30 NONAME
+	_ZN13CCaInnerQuery8SetCountEj @ 31 NONAME
+	_ZN15RCaEntriesArray12InternalizeLER11RReadStream @ 32 NONAME
+	_ZN17CCaEntryAttribute4NewLERK7TDesC16 @ 33 NONAME
+	_ZN17CCaEntryAttribute5NewLCERK7TDesC16 @ 34 NONAME
+	_ZN17CCaEntryAttribute9SetValueLERK7TDesC16 @ 35 NONAME
+	_ZN17RCaEntryAttrArray15RemoveAttributeERK7TDesC16 @ 36 NONAME
+	_ZN20CCaLocalizationEntry12SetStringIdLERK7TDesC16 @ 37 NONAME
+	_ZN20CCaLocalizationEntry13SetTableNameLERK7TDesC16 @ 38 NONAME
+	_ZN20CCaLocalizationEntry14SetQmFilenameLERK7TDesC16 @ 39 NONAME
+	_ZN20CCaLocalizationEntry17SetAttributeNameLERK7TDesC16 @ 40 NONAME
+	_ZN20CCaLocalizationEntry19SetLocalizedStringLERK7TDesC16 @ 41 NONAME
+	_ZN20CCaLocalizationEntry4NewLEv @ 42 NONAME
+	_ZN20CCaLocalizationEntry5NewLCEv @ 43 NONAME
+	_ZN20CCaLocalizationEntry8SetRowIdEj @ 44 NONAME
+	_ZN20CCaLocalizationEntry9SetTextIdEj @ 45 NONAME
+	_ZN22CCaInnerNotifierFilter11SetParentIdEi @ 46 NONAME
+	_ZN22CCaInnerNotifierFilter12InternalizeLER11RReadStream @ 47 NONAME
+	_ZN22CCaInnerNotifierFilter12SetEntryRoleE10TEntryRole @ 48 NONAME
+	_ZN22CCaInnerNotifierFilter12SetTypeNamesEP16CDesC16ArrayFlat @ 49 NONAME
+	_ZN22CCaInnerNotifierFilter4NewLENS_13TNotifierTypeE @ 50 NONAME
+	_ZN22CCaInnerNotifierFilter5NewLCENS_13TNotifierTypeE @ 51 NONAME
+	_ZN22CCaInnerNotifierFilter7SetIdsLERK6RArrayIiE @ 52 NONAME
+	_ZN23CCaInnerIconDescription10SetSkinIdLERK7TDesC16 @ 53 NONAME
+	_ZN23CCaInnerIconDescription12SetFileNameLERK7TDesC16 @ 54 NONAME
+	_ZN23CCaInnerIconDescription17SetApplicationIdLERK7TDesC16 @ 55 NONAME
+	_ZN23CCaInnerIconDescription4NewLEv @ 56 NONAME
+	_ZN23CCaInnerIconDescription5NewLCEv @ 57 NONAME
+	_ZN23CCaInnerIconDescription5SetIdEi @ 58 NONAME
+	_ZN9MenuUtils8GetTUintERK7TDesC16Rj @ 59 NONAME
+	_ZNK11RCaIdsArray12ExternalizeLER12RWriteStream @ 60 NONAME
+	_ZNK11RCaIdsArray13MarshalDataLCEv @ 61 NONAME
+	_ZNK13CCaInnerEntry11isLocalizedENS_14TLocalizedTypeE @ 62 NONAME
+	_ZNK13CCaInnerEntry12ExternalizeLER12RWriteStream @ 63 NONAME
+	_ZNK13CCaInnerEntry13GetAttributesEv @ 64 NONAME
+	_ZNK13CCaInnerEntry14GetDescriptionEv @ 65 NONAME
+	_ZNK13CCaInnerEntry16GetEntryTypeNameEv @ 66 NONAME
+	_ZNK13CCaInnerEntry4IconEv @ 67 NONAME
+	_ZNK13CCaInnerEntry5GetIdEv @ 68 NONAME
+	_ZNK13CCaInnerEntry6GetUidEv @ 69 NONAME
+	_ZNK13CCaInnerEntry7GetRoleEv @ 70 NONAME
+	_ZNK13CCaInnerEntry7GetTextEv @ 71 NONAME
+	_ZNK13CCaInnerEntry8GetFlagsEv @ 72 NONAME
+	_ZNK13CCaInnerEntry9GetIconIdEv @ 73 NONAME
+	_ZNK13CCaInnerQuery10GetChildIdEv @ 74 NONAME
+	_ZNK13CCaInnerQuery10GetFlagsOnEv @ 75 NONAME
+	_ZNK13CCaInnerQuery11GetFlagsOffEv @ 76 NONAME
+	_ZNK13CCaInnerQuery11GetParentIdEv @ 77 NONAME
+	_ZNK13CCaInnerQuery12ExternalizeLER12RWriteStream @ 78 NONAME
+	_ZNK13CCaInnerQuery13GetAttributesEv @ 79 NONAME
+	_ZNK13CCaInnerQuery17GetEntryTypeNamesEv @ 80 NONAME
+	_ZNK13CCaInnerQuery6GetIdsEv @ 81 NONAME
+	_ZNK13CCaInnerQuery6GetUidEv @ 82 NONAME
+	_ZNK13CCaInnerQuery7GetRoleEv @ 83 NONAME
+	_ZNK13CCaInnerQuery7GetSortEv @ 84 NONAME
+	_ZNK13CCaInnerQuery8GetCountEv @ 85 NONAME
+	_ZNK15RCaEntriesArray12ExternalizeLER12RWriteStream @ 86 NONAME
+	_ZNK17RCaEntryAttrArray4FindERK7TDesC16R6TDes16 @ 87 NONAME
+	_ZNK17RCaEntryAttrArray4FindERK7TDesC16R7TPtrC16 @ 88 NONAME
+	_ZNK17RCaEntryAttrArray5ExistERK7TDesC16 @ 89 NONAME
+	_ZNK20CCaLocalizationEntry11GetStringIdEv @ 90 NONAME
+	_ZNK20CCaLocalizationEntry12GetTableNameEv @ 91 NONAME
+	_ZNK20CCaLocalizationEntry13GetQmFilenameEv @ 92 NONAME
+	_ZNK20CCaLocalizationEntry16GetAttributeNameEv @ 93 NONAME
+	_ZNK20CCaLocalizationEntry18GetLocalizedStringEv @ 94 NONAME
+	_ZNK20CCaLocalizationEntry8GetRowIdEv @ 95 NONAME
+	_ZNK20CCaLocalizationEntry9GetTextIdEv @ 96 NONAME
+	_ZNK22CCaInnerNotifierFilter11GetParentIdEv @ 97 NONAME
+	_ZNK22CCaInnerNotifierFilter12ExternalizeLER12RWriteStream @ 98 NONAME
+	_ZNK22CCaInnerNotifierFilter12GetEntryRoleEv @ 99 NONAME
+	_ZNK22CCaInnerNotifierFilter12GetTypeNamesEv @ 100 NONAME
+	_ZNK22CCaInnerNotifierFilter15GetNotifierTypeEv @ 101 NONAME
+	_ZNK22CCaInnerNotifierFilter6GetIdsEv @ 102 NONAME
 
--- a/contentstorage/group/camenu.mmp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/group/camenu.mmp	Wed Aug 18 10:05:49 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description:
-*  Version     : %version: 19.1.9 % << Don't touch! Updated by Synergy at check-out.
+*  Version     : %version: 19.1.11 % << Don't touch! Updated by Synergy at check-out.
 *
 */
 
@@ -37,9 +37,9 @@
 SOURCE          cainstallstrategy.cpp
 SOURCE          cammcwatcher.cpp
 SOURCE          casrvengutils.cpp
-SOURCE			casrvnotifier.cpp
+SOURCE	        casrvnotifier.cpp
 SOURCE          castorageproxy.cpp
-SOURCE          caprogressnotifier.cpp
+SOURCE          cabackupnotifier.cpp
 
 
 USERINCLUDE     ../srvinc
@@ -65,8 +65,6 @@
 LIBRARY         bafl.lib
 LIBRARY         casrvmanager.lib
 
-LIBRARY         sifnotification.lib
-LIBRARY         sif.lib
 LIBRARY         scrclient.lib
 
 // HB LIBRARIES
--- a/contentstorage/group/group.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/group/group.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -19,9 +19,10 @@
 #Exporting ibys
 BLD_INF_RULES.prj_exports += \
      "../castorage/conf/castoragedb.confml APP_LAYER_CONFML(castoragedb.confml)" \
-     "../castorage/conf/castoragedb.implml APP_LAYER_CONFML(castoragedb.implml)" \
-     "../castorage/data/castoragedb_create.sql APP_LAYER_CONFML(../implml/castoragedb_templates/castoragedb_create.sql)" \
-     "../castorage/conf/castoragedb_templates/castoragedb_variant.sql APP_LAYER_CONFML(../implml/castoragedb_templates/castoragedb_variant.sql)" \
+     "../castorage/conf/CI_castoragedb.confml APP_LAYER_CONFML(CI_castoragedb.confml)" \
+     "../castorage/conf/castoragedb.implml APP_LAYER_CRML(castoragedb.implml)" \
+     "../castorage/data/castoragedb_create.sql APP_LAYER_CRML(castoragedb_templates/castoragedb_create.sql)" \
+     "../castorage/conf/castoragedb_templates/castoragedb_variant.sql APP_LAYER_CRML(castoragedb_templates/castoragedb_variant.sql)" \ 
      "$${LITERAL_HASH}ifndef CONTENT_ARSENAL_STORAGE_UT" \
      "../castorage/data/castorage.db z:/private/20022F90/castorage.db" \
      "$${LITERAL_HASH}else " \
--- a/contentstorage/inc/cadef.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/inc/cadef.h	Wed Aug 18 10:05:49 2010 +0300
@@ -12,7 +12,7 @@
  * Contributors:
  *
  * Description:  Definition of different constants
- *  Version     : %version: 10.1.25 % << Don't touch! Updated by Synergy at check-out.
+ *  Version     : %version: 10.1.26 % << Don't touch! Updated by Synergy at check-out.
  *
  */
 
@@ -48,7 +48,7 @@
 //Entry flags
 enum TEntryFlag
     {
-    EUsed = 1,
+    EUsed = 1,//Flag is set only for removable applications
     EUninstall = 2,
     ERemovable = 4,
     EVisible = 8,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvinc/cabackupnotifier.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,109 @@
+/*
+ * 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:  ?Description
+ *
+ */
+
+#ifndef CABACKUPNOTIFIER_H
+#define CABACKUPNOTIFIER_H
+
+#include <e32property.h>
+
+class CCaStorageProxy;
+
+/**
+ *  CA Backup notifier.
+ *
+ *  @since S60 v5.0
+ */
+
+
+NONSHARABLE_CLASS( CCaBackupNotifier ) : public CActive
+    {
+
+enum TCaBackupState
+	/** 
+	The backup / restore state of a device.
+
+	@released
+	@publishedAll
+	*/
+	{
+	ECaBackup       = 1,
+	ECaRestore      = 2
+	};
+
+public:
+
+    /**
+     * Creates an instance of CCaBackupNotifier.
+     * @param aNotifier Reference to notifier interface.
+     * @param aNotificationType Notification type.
+     */
+static CCaBackupNotifier* NewL( CCaStorageProxy* aStorageProxy );
+
+    /**
+     * Destructor.
+     */
+    virtual ~CCaBackupNotifier();
+
+private:
+
+    /**
+     * Symbian 2nd phase constructor.
+     * @param aNotificationType Notification type.
+     */
+    void ConstructL( );
+
+    /**
+     * From CActive.
+     */
+    void DoCancel();
+
+    /**
+     * From CActive.
+     */
+    void RunL();
+
+    /**
+     * From CActive.
+     */
+    TInt RunError( TInt aError );
+
+private:
+
+    CCaBackupNotifier( CCaStorageProxy* aStorageProxy );
+    
+    /**
+     * RProperty.
+     * Own.
+     */
+    RProperty iProperty;
+       
+    /*
+     * not owned
+     */
+    CCaStorageProxy* iStorageProxy;
+    
+    /*
+     * Keeps last state of backup
+     */
+    TInt iLastState;
+
+    };
+
+#endif /* CABACKUPNOTIFIER_H */
+
+// End of File
+
--- a/contentstorage/srvinc/caprogressnotifier.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  ?Description
- *
- */
-
-#ifndef CAPROGRESSNOTIFIER_H
-#define CAPROGRESSNOTIFIER_H
-
-#include <e32base.h>
-#include <usif/sif/sifnotification.h>
-#include <usif/usifcommon.h> 
-
-#include "castorage_global.h"
-using namespace Usif; 
-
-class CCaStorageProxy;
-class CCaInnerEntry;
-
-/**
- *  Uninstall Progress notifier.
- *
- *  @since S60 v5.0
- */
-NONSHARABLE_CLASS( CCaProgressNotifier ) : public CBase, 
-        public MSifOperationsHandler
-    {
-
-public:
-    /**
-     * Creates an instance of CCaProgressNotifier.
-     * @param aCaStorageProxy Reference to storage.
-     */
-IMPORT_C static CCaProgressNotifier* NewL( CCaStorageProxy& aCaStorageProxy);
-
-    /**
-     * Destructor.
-     */
-    virtual ~CCaProgressNotifier();
-
-private:
-
-    /**
-     * Constructor.
-     */
-    CCaProgressNotifier( CCaStorageProxy& aCaStorageProxy );
-
-    /**
-     * Symbian 2nd phase constructor.
-     * @param aCaStorageProxy Reference to storage.
-     */
-    void ConstructL( );
-    
-    void UpdateProgressL( const CSifOperationProgressData& aProgressData );
-    void EndOperationL(TInt aError);
-    TComponentId ComponentIdL(const TDesC& aGlobalComponentId, const TDesC& aSwType);
-    void MarkEntrysForUnistallL(TUint aKey, TComponentId aComponentId);
-
-public:
-    /**
-     * From MSifOperationsHandler
-     */
-    void StartOperationHandler(TUint aKey, const CSifOperationStartData& aStartData);
-
-    /**
-     * From MSifOperationsHandler
-     */
-    void EndOperationHandler(const CSifOperationEndData& aEndData);
-
-    /**
-     * From MSifOperationsHandler
-     */
-    void ProgressOperationHandler(const CSifOperationProgressData& aProgressData);
-    
-private:
-
-    /**
-     * USIF notifier
-     * Own.
-     * 
-     * Commented out since USIF notifications do not
-     * work on MCL wk20
-     */
-    CSifOperationsNotifier* iNotifier;
-    
-    /**
-     * Not Own.
-     * Reference to the Storage Proxy.
-     */
-    CCaStorageProxy& iStorageProxy;
-    
-    RPointerArray<CCaInnerEntry> iResultArrayItems;
-    
-    TUint iKey;
-    
-    };
-
-
-#endif /* CAPROGRESSNOTIFIER_H */
-
-// End of File
-
--- a/contentstorage/srvinc/casrv.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/srvinc/casrv.h	Wed Aug 18 10:05:49 2010 +0300
@@ -20,12 +20,13 @@
 
 //  INCLUDES
 #include <e32base.h>
+#include <usif/scr/scr.h>
 
 // FORWARD DECLARATION
 class CCaSrvEngUtils;
 class CCaSrvManager;
 class CCaStorageProxy;
-class CCaProgressNotifier;
+class CCaBackupNotifier;
 
 // GLOBAL FUNCTIONS
 /**
@@ -114,16 +115,21 @@
      * Utils. Own.
      */
     CCaSrvEngUtils* iSrvEngUtils;
+    
+    /*
+     * Software Component Registry. Own.
+     */
+    Usif::RSoftwareComponentRegistry iSoftwareRegistry;
 
     /*
      * Srv plugin manager. Own.
      */
     CCaSrvManager* iSrvManager;
-
+    
     /*
-     * Uninstall progress notifier
+     * Srv plugin manager. Own.
      */
-    CCaProgressNotifier* iProgressNotifier;
+    CCaBackupNotifier* iBackupNotifier;
 
     };
 
--- a/contentstorage/srvinc/castorageproxy.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/srvinc/castorageproxy.h	Wed Aug 18 10:05:49 2010 +0300
@@ -154,6 +154,18 @@
     IMPORT_C void CustomSortL( const RArray<TInt>& aEntryIds,
             const TInt aGroupId );
 
+    
+    /**
+     * Saves a copy of database to private.
+     */
+	IMPORT_C void SaveDatabaseL();
+	
+    /**
+     * Marks db to be restored from backup by next restart
+     */
+	IMPORT_C void RestoreDatabaseL();
+    
+    
     /**
      * Loads data base from rom.
      */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contentstorage/srvsrc/cabackupnotifier.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,135 @@
+/*
+ * 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:  ?Description
+ *
+ */
+
+#include <e32base.h>
+#include <sacls.h>
+#include <connect/sbdefs.h>
+
+#include "cabackupnotifier.h"
+#include "castorageproxy.h"
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaBackupNotifier* CCaBackupNotifier::NewL( CCaStorageProxy* aStorageProxy )
+    {
+    CCaBackupNotifier* self = new ( ELeave ) CCaBackupNotifier( aStorageProxy );
+    CleanupStack::PushL( self );
+    self->ConstructL( );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaBackupNotifier::~CCaBackupNotifier()
+    {
+    Cancel();
+    iProperty.Close();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+CCaBackupNotifier::CCaBackupNotifier( CCaStorageProxy* aStorageProxy ) :
+    CActive( EPriorityNormal ),
+    iStorageProxy( aStorageProxy ),
+    iLastState(0)
+    {
+    iProperty.Attach( KUidSystemCategory, KUidBackupRestoreKey );
+    CActiveScheduler::Add( this );
+    iStatus = KRequestPending;
+    iProperty.Subscribe( iStatus );
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaBackupNotifier::ConstructL(  )
+    {
+
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT (calls another method)
+void CCaBackupNotifier::DoCancel()
+    {
+    iProperty.Cancel();
+    }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+void CCaBackupNotifier::RunL()
+    {
+	TInt backupStateValue = 0;
+	iProperty.Get(backupStateValue);
+	// Resubscribe before dealing with the current notification 	
+    iProperty.Subscribe(iStatus);
+    SetActive();
+
+    conn::TBURPartType type = static_cast< conn::TBURPartType >
+        ( backupStateValue & conn::KBURPartTypeMask );
+    
+    if( type == conn::EBURRestoreFull || type == conn::EBURRestorePartial  )
+    	{
+        // restore starting
+        iLastState = ECaRestore;
+    	}
+    else if( type == conn::EBURBackupFull || type == conn::EBURBackupPartial )
+    	{
+        // backup starting
+        iStorageProxy->SaveDatabaseL();
+        iLastState = ECaBackup;
+    	}
+    else if( ( type == conn::EBURNormal || type == conn::EBURUnset ) && iLastState == ECaRestore )
+    	{ // restore ends
+        iStorageProxy->RestoreDatabaseL();
+    	}
+    else if( ( type == conn::EBURNormal || type == conn::EBURUnset ) && iLastState == ECaBackup )
+    	{ // backup ends
+         // do nothing
+    	}
+    }
+
+
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT (calls another method)
+TInt CCaBackupNotifier::RunError( TInt /*aError*/)
+    {
+    // No need to do anything
+    return KErrNone;
+    }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
--- a/contentstorage/srvsrc/caprogressnotifier.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-/*
- * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  ?Description
- *
- */
-
-#include <s32mem.h>
-
-#include <usif/scr/scr.h>
-#include <usif/scr/screntries.h>
-
-#include "caprogressnotifier.h"
-#include "castorageproxy.h"
-#include "cainnerquery.h"
-#include "cainnerentry.h"
-#include "caarraycleanup.inl"
-
-using namespace Usif;
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-EXPORT_C CCaProgressNotifier* CCaProgressNotifier::NewL(
-        CCaStorageProxy& aCaStorageProxy )
-    {
-    CCaProgressNotifier* self = new ( ELeave ) CCaProgressNotifier(
-            aCaStorageProxy );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCaProgressNotifier::~CCaProgressNotifier()
-    {
-    delete iNotifier;
-    iResultArrayItems.ResetAndDestroy();
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-CCaProgressNotifier::CCaProgressNotifier( CCaStorageProxy& aCaStorageProxy ) :
-    iStorageProxy( aCaStorageProxy )
-    {
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgressNotifier::ConstructL()
-    {
-    iNotifier = CSifOperationsNotifier::NewL( *this );
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgressNotifier::StartOperationHandler( TUint aKey,
-        const CSifOperationStartData& aStartData )
-    {
-    TInt err( KErrNone );
-    TComponentId componentId;
-    iResultArrayItems.ResetAndDestroy();
-
-    TRAP(err, componentId = ComponentIdL( aStartData.GlobalComponentId(),
-                    aStartData.SoftwareType() ));
-    if ( !err )
-        TRAP(err, MarkEntrysForUnistallL(aKey, componentId));
-
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgressNotifier::EndOperationHandler(
-        const CSifOperationEndData& aEndData )
-    {
-    TInt err = KErrNone;
-    TRAP(err, EndOperationL(aEndData.ErrorCode()));
-    iResultArrayItems.ResetAndDestroy();
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgressNotifier::ProgressOperationHandler(
-        const CSifOperationProgressData& aProgressData )
-    {
-    TInt err = KErrNone;
-    TRAP(err, UpdateProgressL(aProgressData));
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgressNotifier::UpdateProgressL(
-        const CSifOperationProgressData& aProgressData )
-    {
-    RBuf totalProgressBuf;
-    totalProgressBuf.CleanupClosePushL();
-    totalProgressBuf.CreateL( sizeof(TComponentId) + 1 );
-    totalProgressBuf.AppendNum( aProgressData.CurrentProgess() );
-
-    if ( iResultArrayItems.Count() && aProgressData.Phase() == EUninstalling )
-        {
-        for ( int i = 0; i < iResultArrayItems.Count(); i++ )
-            {
-            iResultArrayItems[i]->AddAttributeL( KCaAppUninstallProgress,
-                    totalProgressBuf );
-            iStorageProxy.AddL( iResultArrayItems[i], ETrue,
-                    EItemUninstallProgressChanged );
-            }
-        }
-
-    CleanupStack::PopAndDestroy( &totalProgressBuf );
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgressNotifier::EndOperationL( TInt aError )
-    {
-    if ( aError )
-        {
-        for ( int i = 0; i < iResultArrayItems.Count(); i++ )
-            {
-            iResultArrayItems[i]->SetFlags( iResultArrayItems[i]->GetFlags()
-                    & ~EUninstall );
-            iStorageProxy.AddL( iResultArrayItems[i] );
-            }
-        }
-    iNotifier->CancelSubscribeL( iKey );
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-TComponentId CCaProgressNotifier::ComponentIdL(
-        const TDesC& aGlobalComponentId, const TDesC& aSwType )
-    {
-    RSoftwareComponentRegistry registry;
-    User::LeaveIfError( registry.Connect() );
-    CleanupClosePushL( registry );
-    TComponentId componentId = registry.GetComponentIdL( aGlobalComponentId,
-            aSwType );
-    CleanupStack::PopAndDestroy( &registry ); // registry    
-    return componentId;
-    }
-
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
-void CCaProgressNotifier::MarkEntrysForUnistallL( TUint aKey,
-        TComponentId aComponentId )
-    {
-    RBuf componentIdBuf;
-    componentIdBuf.CleanupClosePushL();
-    componentIdBuf.CreateL( sizeof(TComponentId) + 1 );
-    componentIdBuf.AppendNum( aComponentId );
-
-    // find entry by componentID
-    CCaInnerQuery *innerQuery = CCaInnerQuery::NewLC();
-    innerQuery->SetRole( CCaInnerQuery::Item );
-    innerQuery->AddAttributeL( KCaAttrComponentId, componentIdBuf );
-
-    iStorageProxy.GetEntriesL( innerQuery, iResultArrayItems );
-
-    if ( iResultArrayItems.Count() )
-        {
-        for ( int i = 0; i < iResultArrayItems.Count(); i++ )
-            {
-            iResultArrayItems[i]->SetFlags( iResultArrayItems[i]->GetFlags()
-                    | EUninstall );
-            iStorageProxy.AddL( iResultArrayItems[i] );
-            }
-        // subscribe for progress notifier
-        iKey = aKey;
-        iNotifier->SubscribeL( aKey, ETrue );
-        }
-    CleanupStack::PopAndDestroy( innerQuery );
-    CleanupStack::PopAndDestroy( &componentIdBuf );
-    }
--- a/contentstorage/srvsrc/casrv.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/srvsrc/casrv.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -18,13 +18,15 @@
 #include <sqldb.h>
 #include <eikenv.h>
 #include <eikappui.h>
+
 #include "casrv.h"
 #include "casrvdef.h"
 #include "casrvsession.h"
 #include "casrvengutils.h"
 #include "castorageproxy.h"
 #include "casrvmanager.h"
-#include "caprogressnotifier.h"
+#include "cabackupnotifier.h"
+ 
 
 // ==================== LOCAL FUNCTIONS ====================
 
@@ -78,6 +80,7 @@
                 }
             }
         }
+
     // Let the caller know how it went.
     RProcess::Rendezvous( err );
     if( !err )
@@ -117,6 +120,7 @@
     // Base class would do it for us but that's too late - our sessions
     // call the server back (SessionClosed, RemoveContainer, etc.).
     Cancel();
+    delete iBackupNotifier;
     CSession2* session;
     iSessionIter.SetToFirst();
     while( ( session = iSessionIter++ ) != NULL )
@@ -124,8 +128,8 @@
         delete session;
         }
     delete iSrvManager;
+    iSoftwareRegistry.Close();
     delete iSrvEngUtils;
-    delete iProgressNotifier;
     delete iStorageProxy;
     }
 
@@ -156,8 +160,9 @@
     iSessionCount = 0;
     iStorageProxy = CCaStorageProxy::NewL();
     iSrvEngUtils = CCaSrvEngUtils::NewL();
-    iProgressNotifier = CCaProgressNotifier::NewL( *iStorageProxy );
-    iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils );
+    User::LeaveIfError( iSoftwareRegistry.Connect() );
+    iSrvManager = CCaSrvManager::NewL( *iStorageProxy,
+        &iSoftwareRegistry, iSrvEngUtils);
     TInt errCode = iSrvManager->LoadOperationErrorCodeL();
     if( KSqlErrNotDb <= errCode && errCode <= KSqlErrGeneral )
         {
@@ -166,8 +171,10 @@
         delete iSrvManager;
         iSrvManager = NULL;
         iStorageProxy->LoadDataBaseFromRomL();
-        iSrvManager = CCaSrvManager::NewL( *iStorageProxy, iSrvEngUtils );
+        iSrvManager = CCaSrvManager::NewL( *iStorageProxy,
+            &iSoftwareRegistry, iSrvEngUtils );
         }
+    iBackupNotifier = CCaBackupNotifier::NewL( iStorageProxy );
     }
 
 // ---------------------------------------------------------
--- a/contentstorage/srvsrc/castorageproxy.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/contentstorage/srvsrc/castorageproxy.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -273,7 +273,7 @@
     RPointerArray<CCaInnerEntry> resultArray;
     CleanupResetAndDestroyPushL( resultArray );
     iStorage->GetEntriesL( touchQuery, resultArray );
-    iStorage->TouchL( entryId );
+    iStorage->TouchL( entryId, aEntry->GetFlags() & ERemovable );
     for( TInt i = 0; i < iHandlerNotifier.Count(); i++ )
         {
         iHandlerNotifier[i]->EntryTouched( entryId );
@@ -363,6 +363,7 @@
     RArray<TInt> parentArray;
     CleanupClosePushL( parentArray );
     parentArray.AppendL( aGroupId );
+    iStorage->GetParentsIdsL( parentArray, parentArray );
     for( TInt i = 0; i < iHandlerNotifier.Count(); i++ )
         {
         iHandlerNotifier[i]->GroupContentChanged( parentArray );
@@ -370,13 +371,48 @@
     CleanupStack::PopAndDestroy( &parentArray );
     }
 
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
 #ifdef COVERAGE_MEASUREMENT
 #pragma CTC SKIP
 #endif //COVERAGE_MEASUREMENT (calls another method)
+
+EXPORT_C void CCaStorageProxy::SaveDatabaseL()
+    {
+    iStorage->SaveDatabaseL();
+    }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
+
+
 // ---------------------------------------------------------------------------
 //
 // ---------------------------------------------------------------------------
 //
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT (calls another method)
+
+EXPORT_C void CCaStorageProxy::RestoreDatabaseL()
+    {
+    iStorage->RestoreDatabaseL();
+    }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
+
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+//
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT (calls another method)
+
 EXPORT_C void CCaStorageProxy::LoadDataBaseFromRomL()
     {
     iStorage->LoadDataBaseFromRomL();
--- a/homescreensrv.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/homescreensrv.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -18,10 +18,12 @@
 
 SUBDIRS  += hswidgetmodel \
             contentstorage \
-            homescreensrv_plat \
-            tsrc
+            homescreensrv_plat
+            
+exists(tsrc/tsrc.pro): SUBDIRS  += tsrc
+            
 symbian:SUBDIRS += activityfw
-symbian:SUBDIRS += tstaskmonitor
+symbian:SUBDIRS += taskswitcher
 symbian:SUBDIRS += hsappkeyhandler
 symbian:SUBDIRS += tsdevicedialog
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/activity_framework_api.metaxml	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="2481ff0a026dfee0a990b5a8b3d6fb8a" dataversion="2.0">
+  <name>activity_framework_api</name>
+  <description>Activity Framework API provides ways to store/restore application activity. It also provides means to launch application in predefined activity.</description>
+  <type>c++</type>
+  <collection>activityfw</collection>
+  <libs>
+    <lib name="afservice.lib"/>
+  </libs>
+  <release category="platform" sinceversion="5.2"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/activity_framework_api.pri	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+PLATFORM_HEADERS += activity_framework_api/afactivities_global.h \
+                    activity_framework_api/afactivitystorage.h \
+                    activity_framework_api/afactivation.h \
+                    activity_framework_api/afstorageglobals.h \
+                    activity_framework_api/afactivitylauncher.h \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afactivation.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFACTIVATION_H
+#define AFACTIVATION_H
+
+#include "afactivities_global.h"
+
+#include <QObject>
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+
+class AfActivationPrivate;
+
+class AFACTIVITIES_EXPORT AfActivation : public QObject
+{
+    Q_OBJECT
+    
+public:
+    AfActivation(QObject *parent = 0);
+    
+signals:
+    void activated(Af::ActivationReason reason, QString name, QVariantHash parameters);
+    
+public slots:
+    QVariantHash parameters() const;
+    Af::ActivationReason reason() const;
+    QString name() const;
+        
+private:
+    AfActivationPrivate *d_ptr;
+
+};
+
+#endif // AFACTIVATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afactivities_global.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef AFACTIVITIES_GLOBAL_H
+#define AFACTIVITIES_GLOBAL_H
+
+#include <qglobal.h>
+
+#ifdef AFACTIVITIES_LIB
+    #define AFACTIVITIES_EXPORT Q_DECL_EXPORT
+#else
+    #ifdef AFACTIVITIES_TEST
+        #define AFACTIVITIES_EXPORT
+    #else
+        #define AFACTIVITIES_EXPORT Q_DECL_IMPORT
+    #endif
+#endif
+
+namespace Af {
+    enum ActivationReason {
+        ActivationReasonActivity = 0,
+        ActivationReasonService,
+        ActivationReasonNormal
+    };    
+    
+    const char KActivityScheme[] = "appto";
+
+    const char KActivityUriNameKey[] = "activityname";
+    const char KActivityUriBackgroundKey[] = "activityinbackground";
+}
+
+#endif // AFACTIVITIES_GLOBAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afactivitylauncher.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFACTIVITYLAUNCHER_H
+#define AFACTIVITYLAUNCHER_H
+
+#include <e32base.h>
+
+class RWsSession;
+class RApaLsSession;
+class CAfActivityLauncherPrivate;
+
+class CAfActivityLauncher : public CBase
+{
+
+public:
+    IMPORT_C static CAfActivityLauncher *NewL(RApaLsSession &apaLsSession, RWsSession &wsSession);
+    IMPORT_C static CAfActivityLauncher *NewLC(RApaLsSession &apaLsSession, RWsSession &wsSession);
+    IMPORT_C ~CAfActivityLauncher();
+    IMPORT_C void launchActivityL(const TDesC &uriDesc);
+
+private:
+    CAfActivityLauncher();
+    void ConstructL(RApaLsSession &apaLsSession, RWsSession &wsSession);
+
+private:
+    CAfActivityLauncherPrivate *mImplementation;
+
+};
+
+#endif // AFACTIVITYLAUNCHER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afactivitystorage.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFACTIVITYSTORAGE_H
+#define AFACTIVITYSTORAGE_H
+
+#include "afactivities_global.h"
+
+#include <QString>
+#include <QStringList>
+#include <QVariant>
+#include <QScopedPointer>
+
+class AfActivityStoragePrivate;
+
+class AFACTIVITIES_EXPORT AfActivityStorage : public QObject
+{
+    Q_OBJECT
+
+public:
+    AfActivityStorage(QObject *parent = 0);
+    virtual ~AfActivityStorage();
+
+public slots:
+    bool saveActivity(const QString &activityId, const QVariant &activityData, const QVariantHash &metadata);
+    bool removeActivity(const QString &activityId);
+
+    QStringList allActivities() const;
+
+    QVariant activityData(const QString &activityId) const;
+    QVariantHash activityMetaData(const QString &activityId) const;
+        
+private:
+    QScopedPointer<AfActivityStoragePrivate> d_ptr;        
+    
+private:
+    Q_DISABLE_COPY(AfActivityStorage)    
+    
+};
+
+#endif // AFACTIVITYSTORAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/activity_framework_api/afstorageglobals.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+#ifndef AFSTORAGEGLOBALS_H
+#define AFSTORAGEGLOBALS_H
+
+/**
+ * Enumerate supported functions
+ */
+
+const char ActivityApplicationKeyword [] = ":ApplicationId";
+const char ActivityActivityKeyword [] = ":ActivityName";
+const char ActivityParametersKeyword [] = ":ActivityParams";
+const char ActivityPersistence [] = ":ActivityPersistence";
+const char ActivityVisibility [] = ":ActivityVisibility";
+const char ActivityScreenshotKeyword [] = "screenshot";
+const char ActivityDataKeyword [] = ":ActivityData";
+const char ActivityApplicationName[] = ":ApplicationName";
+
+#endif //AFSTORAGEGLOBALS_H
--- a/homescreensrv_plat/contentstorage_api/caitemmodel.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/caitemmodel.h	Wed Aug 18 10:05:49 2010 +0300
@@ -49,7 +49,9 @@
         FlagsRole,
         TextRole,//contains title represented as QString,
         FullTextRole, //'title description' convinient for operations such as search
-        UninstalRole  //contains progress status as decimal number in QString
+        UninstalRole,  //contains progress status as decimal number in QString
+        CollectionTitleRole //contains title represented as QString,
+
     };
 
     // Function declarations
@@ -78,12 +80,17 @@
     void setFlagsOff(const EntryFlags &offFlags);
     QSharedPointer<CaEntry> entry(const QModelIndex &index) const;
 
-    signals:
+    QList<int> getUninstallingEntriesIds(int componentId);
+    void updateProgress(int id, int valueOfProgress);
+
+    
+signals:
 
     void scrollTo(int row, QAbstractItemView::ScrollHint hint =
         QAbstractItemView::EnsureVisible);
     void empty(bool value);
-
+    void countChange();
+    
 protected:
     // data
 
--- a/homescreensrv_plat/contentstorage_api/casoftwareregistry.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/casoftwareregistry.h	Wed Aug 18 10:05:49 2010 +0300
@@ -28,40 +28,53 @@
 //FORWARD DECLARATIONS
 class QStringList;
 class CaSoftwareRegistryPrivate;
+class CaUninstallNotifier;
 
 /**
  * Class provides Usif specific services
  */
 class CACLIENT_EXPORT CaSoftwareRegistry: public QObject
 {
-    
-Q_OBJECT    
+
+Q_OBJECT
 
     explicit CaSoftwareRegistry(QObject *parent = 0);
 
     ~CaSoftwareRegistry();
-    
+
 public:
-    
+
     static QSharedPointer<CaSoftwareRegistry> create();
-    
+
     typedef QHash<QString, QString> DetailMap;
-    
+
     bool getUninstallDetails(int componentId,
         QString &componentName,
         QStringList &applicationsUids,
         QString &confirmationMessage);
-    
+
     bool getApplicationsUids(int componentId, QStringList &applicationsUids);
+
+    DetailMap entryDetails(int componentId) const;
+
+    QList<DetailMap> retrieveLogEntries() const;
     
-    DetailMap entryDetails(int componentId) const;
-    
+    CaUninstallNotifier *createUninstallNotifier() const;
+
     static QString componentNameKey();
     static QString componentVersionKey();
     static QString componentVendorKey();
     static QString componentDriveInfoKey();
+    static QString componentProtectionDomainKey();
     static QString componentSizeKey();
     static QString componentTypeKey();
+    static QString componentDescriptionKey();
+    static QString componentTimeKey();
+    static QString componentOperationTypeKey();
+    static QString componentInstallValue();
+    static QString componentUninstallValue();
+    static QString componentUpgradeValue();
+    static QString componentHiddenValue();
 private:
     /**
      * Pointer to a private implementation.
@@ -77,7 +90,7 @@
     friend class QtSharedPointer::ExternalRefCount<CaSoftwareRegistry>;
 
     Q_DISABLE_COPY(CaSoftwareRegistry)
-    
+
 };
 
 #endif // CA_SOFTWARE_REGISTRY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/contentstorage_api/cauninstallnotifier.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: canotifier.h
+ *
+ */
+
+#ifndef CAUINSTALLNOTIFIER_H
+#define CAUINSTALLNOTIFIER_H
+
+#include <QObject>
+#include <QSharedPointer>
+
+#include "caclient_global.h"
+class CaUninstallNotifierPrivate;
+
+class CaUninstallNotifier: public QObject
+{
+Q_OBJECT
+
+public:
+
+    static CaUninstallNotifier* notifier();
+
+private: 
+    
+    explicit CaUninstallNotifier(CaUninstallNotifierPrivate *const notifierPrivate);
+
+    virtual ~CaUninstallNotifier();
+
+signals:
+
+    /*!
+        A signal emited when the entry is changed.
+        \param entryId entry id.
+        \param changeType the type of the change.
+    */
+    void progressChange(int componentId, int progressValue);
+
+private:
+
+    CaUninstallNotifierPrivate * const m_d;
+    
+    static QSharedPointer<CaUninstallNotifier> mInstance;
+    
+    Q_DISABLE_COPY(CaUninstallNotifier)
+
+    friend class CaUninstallNotifierPrivate;
+    
+    friend class QtSharedPointer::ExternalRefCount<CaUninstallNotifier>;
+};
+
+
+#endif // CAUINSTALLNOTIFIER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/contentstorage_api/contentstorage_api.metaxml	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="d782ad60750b29f0c7a73a8baf35920f" dataversion="2.0">
+  <name>contentstorage_api</name>
+  <description>Content Storage API provides data model for homescreenapp, it provides list of application, widgets, urls as well as collections.</description>
+  <type>c++</type>
+  <collection>contentstorage</collection>
+  <libs>
+    <lib name="caclient.lib"/>
+  </libs>
+  <release category="platform" sinceversion="5.2"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/homescreensrv_plat/contentstorage_api/contentstorage_api.pri	Tue Jul 06 14:37:10 2010 +0300
+++ b/homescreensrv_plat/contentstorage_api/contentstorage_api.pri	Wed Aug 18 10:05:49 2010 +0300
@@ -25,4 +25,5 @@
                       contentstorage_api/caservice.h \
                       contentstorage_api/caitemmodel.h \
                       contentstorage_api/camenuiconutility.h \
-                      contentstorage_api/casoftwareregistry.h
\ No newline at end of file
+                      contentstorage_api/casoftwareregistry.h \
+                      contentstorage_api/cauninstallnotifier.h 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/homescreen_information_api/homescreen_information_api.metaxml	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="7ac899fd1b23c60664b800b8d4652285" dataversion="2.0">
+  <name>homescreen_information_api</name>
+  <description>Home screen information api to listen home screen state</description>
+  <type>c++</type>
+  <collection/>
+  <libs/>
+  <release category="platform" sinceversion=""/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/homescreensrv_plat/homescreensrv_plat.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/homescreensrv_plat/homescreensrv_plat.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -22,6 +22,7 @@
 include(menu_sat_interface_api/menu_sat_interface_api.pri)
 include(homescreen_information_api/homescreen_information_api.pri)
 include(taskswitcher_api/taskswitcher_api.pri)
+include(activity_framework_api/activity_framework_api.pri)
 
 for(filename,PLATFORM_HEADERS){
     BLD_INF_RULES.prj_exports *= "$$filename MW_LAYER_PLATFORM_EXPORT_PATH($$basename(filename))"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/hswidgetmodel_api/hswidgetmodel_api.metaxml	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="25e0f9e1a5ff8ab2eac3620ab2a5e575" dataversion="2.0">
+  <name>hswidgetmodel_api</name>
+  <description>Home screen widget model api</description>
+  <type>c++</type>
+  <libs/>
+  <release category="platform" sinceversion=""/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/homescreensrv_plat/hswidgetmodel_api/hswidgetmodel_global.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/homescreensrv_plat/hswidgetmodel_api/hswidgetmodel_global.h	Wed Aug 18 10:05:49 2010 +0300
@@ -19,7 +19,7 @@
 #ifndef HSWIDGETMODEL_GLOBAL_H
 #define HSWIDGETMODEL_GLOBAL_H
 
-#include <Qt/qglobal.h>
+#include <qglobal.h>
 
 
 #ifdef HSWIDGETMODEL_LIB
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/taskswitcher_api/taskswitcher_api.metaxml	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="086de7c2f2a87e73b0c5674c24698c99" dataversion="2.0">
+  <name>taskswitcher_api</name>
+  <description>Task Switcher API controls appearance of application in task switcher as visibility and screenshot. It provides also keys for monitoring Task Switcher dialog visibility.</description>
+  <type>c++</type>
+  <collection>taskswitcher</collection>
+  <libs>
+    <lib name="tstaskmonitorclient.lib"/>
+  </libs>
+  <release category="platform" sinceversion="5.2"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- a/homescreensrv_plat/taskswitcher_api/taskswitcher_api.pri	Tue Jul 06 14:37:10 2010 +0300
+++ b/homescreensrv_plat/taskswitcher_api/taskswitcher_api.pri	Wed Aug 18 10:05:49 2010 +0300
@@ -15,4 +15,5 @@
 #
 
 PLATFORM_HEADERS += taskswitcher_api/tstasksettings.h \
+                    taskswitcher_api/tstaskmonitor_global.h \
                     taskswitcher_api/tspropertydefs.h \
--- a/homescreensrv_plat/taskswitcher_api/tspropertydefs.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/homescreensrv_plat/taskswitcher_api/tspropertydefs.h	Wed Aug 18 10:05:49 2010 +0300
@@ -19,7 +19,7 @@
 
 namespace TsProperty {
 
-#if defined(Q_OS_SYMBIAN)
+#if defined(__SYMBIAN32__) || defined(SYMBIAN)
     const TUid KCategory = {0x20022fc5};
     const TUint KVisibilityKey = 0x2002677F;
 #endif    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreensrv_plat/taskswitcher_api/tstaskmonitor_global.h	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,32 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#ifndef TSTASKMONITOR_GLOBAL_H
+#define TSTASKMONITOR_GLOBAL_H
+
+#include <qglobal.h>
+
+#ifdef TSTASKMONITOR_LIB
+    #define TSTASKMONITOR_EXPORT Q_DECL_EXPORT
+#else
+    #ifdef TSTASKMONITOR_TEST
+        #define TSTASKMONITOR_EXPORT
+    #else
+        #define TSTASKMONITOR_EXPORT Q_DECL_IMPORT
+    #endif
+#endif
+
+#endif //TSTASKMONITOR_GLOBAL_H
--- a/hsappkeyhandler/group/hsappkeyplugin.mmp	Tue Jul 06 14:37:10 2010 +0300
+++ b/hsappkeyhandler/group/hsappkeyplugin.mmp	Wed Aug 18 10:05:49 2010 +0300
@@ -46,5 +46,6 @@
 LIBRARY HbCore.lib
 LIBRARY apparc.lib
 LIBRARY apgrfx.lib
+LIBRARY afactivitylauncher.lib
 DEBUGLIBRARY flogger.lib
 // End of file
--- a/hsappkeyhandler/src/hsappkeyplugin.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/hsappkeyhandler/src/hsappkeyplugin.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -20,11 +20,16 @@
 #include <eikenv.h>
 #include <apgtask.h>
 #include <apgcli.h>
+#include <e32property.h>
 #include <hb/hbcore/hbdevicedialogsymbian.h>
 #include <hb/hbcore/hbsymbianvariant.h> 
+#include <tspropertydefs.h>
+#include <afactivitylauncher.h>
+#include <homescreendomainpskeys.h>
 #include "hsappkeyplugin.h"
 
-const TUid KHSAppUid  = { 0x20022F35 };
+_LIT(KHsActivactionUri, "appto://20022F35?activityname=HsIdleView");
+_LIT(KAppLibActivactionUri, "appto://20022F35?activityname=AppLibMainView");
 _LIT(KTsPluginName, "com.nokia.taskswitcher.tsdevicedialogplugin/1.0");
 
 
@@ -46,12 +51,6 @@
 CHsAppKeyPlugin* CHsAppKeyPlugin::NewL()
 {
     CHsAppKeyPlugin* self = new (ELeave) CHsAppKeyPlugin;
-    self->iEikEnv->RootWin().CaptureLongKey(EKeyApplication0, 
-                                            EKeyApplication0, 
-                                            0, 
-                                            0, 
-                                            0, 
-                                            ELongCaptureWaitShort);
     return self;
 }
     
@@ -119,7 +118,16 @@
     key.iCode = EKeyApplication0;
     key.iScanCode = EStdKeyApplication0;
     key.iModifiers = 0;
+    key.iRepeats = 0;
     aKeyEventArray.Append(key);
+    
+    TKeyEvent longkey;
+    longkey.iCode = EKeyApplication0;
+    longkey.iScanCode = EStdKeyApplication0;
+    longkey.iModifiers = 0;
+    longkey.iRepeats = 1;
+    aKeyEventArray.Append(longkey);
+
 }
 
 // ---------------------------------------------------------------------------
@@ -127,28 +135,22 @@
 // ---------------------------------------------------------------------------
 //
 void CHsAppKeyPlugin::HandleShortPressL()
-{    
-    RWsSession& ws = iEikEnv->WsSession();
-    TApaTaskList appList(ws);
-    TApaTask task = appList.FindApp(KHSAppUid);
-
-    if (task.Exists()) {
-        task.BringToForeground();
-    } else {        
-        RApaLsSession apaLsSession;
-        User::LeaveIfError(apaLsSession.Connect());
-        CleanupClosePushL(apaLsSession);
-        
-        TApaAppInfo appInfo;
-        apaLsSession.GetAppInfo(appInfo, KHSAppUid );
-        
-        CApaCommandLine *cmdLine = CApaCommandLine::NewLC();
-        cmdLine->SetExecutableNameL(appInfo.iFullName);
-        User::LeaveIfError( apaLsSession.StartApp(*cmdLine));
-    
-        CleanupStack::PopAndDestroy(cmdLine);
-        CleanupStack::PopAndDestroy(&apaLsSession);
-    }
+{   
+    RApaLsSession apaLsSession;
+    CleanupClosePushL(apaLsSession);
+    User::LeaveIfError(apaLsSession.Connect());
+    CAfActivityLauncher *activityEnabler = 
+        CAfActivityLauncher::NewLC(apaLsSession, 
+                                   iEikEnv->WsSession());
+    TInt state(0);
+    RProperty::Get(KHsCategoryUid, KHsCategoryStateKey, state);
+    if (state == EHomeScreenIdleState) {
+        activityEnabler->launchActivityL(KAppLibActivactionUri);
+    } else {
+        activityEnabler->launchActivityL(KHsActivactionUri);
+    }    
+    CleanupStack::PopAndDestroy(activityEnabler);
+    CleanupStack::PopAndDestroy(&apaLsSession);
     delete mDialog;
     mDialog =0;
 }
@@ -160,15 +162,20 @@
 void CHsAppKeyPlugin::HandleLongPressL()
 {
     if( !mDialog ) {
-         mDialog = CHbDeviceDialogSymbian ::NewL();
-        
-        CHbSymbianVariantMap* params = CHbSymbianVariantMap::NewL();
-        
+        TInt value( 0 );
+        RProperty::Get( TsProperty::KCategory, 
+                    TsProperty::KVisibilityKey,
+                    value );
+        if(!value){
+            mDialog = CHbDeviceDialogSymbian::NewL();
+    
+            CHbSymbianVariantMap* params = CHbSymbianVariantMap::NewL();
         if(KErrNone != mDialog->Show(KTsPluginName,*params,this)) {
             delete mDialog;
             mDialog = 0;
+            }
+        delete params;
         }
-        delete params;
     }
 }
 //  End of File
--- a/rom/homescreensrv_core.iby	Tue Jul 06 14:37:10 2010 +0300
+++ b/rom/homescreensrv_core.iby	Wed Aug 18 10:05:49 2010 +0300
@@ -23,16 +23,16 @@
 
 // ---- contentstorage --------------------------------------------
 file=ABI_DIR\BUILD_DIR\caapphandlerplugin.dll     SHARED_LIB_DIR\caapphandlerplugin.dll
-data=\epoc32\data\z\hsresources\plugins\commandhandler\caapphandlerplugin.qtplugin  hsresources\plugins\commandhandler\caapphandlerplugin.qtplugin
-data=\epoc32\data\z\hsresources\plugins\commandhandler\caapphandlerplugin.xml       hsresources\plugins\commandhandler\caapphandlerplugin.xml
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\caapphandlerplugin.qtplugin  resource\qt\plugins\commandhandler\caapphandlerplugin.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\caapphandlerplugin.xml       resource\qt\plugins\commandhandler\caapphandlerplugin.xml
 
 file=ABI_DIR\BUILD_DIR\catapphandlerplugin.dll     SHARED_LIB_DIR\catapphandlerplugin.dll
-data=\epoc32\data\z\hsresources\plugins\commandhandler\catapphandlerplugin.qtplugin  hsresources\plugins\commandhandler\catapphandlerplugin.qtplugin
-data=\epoc32\data\z\hsresources\plugins\commandhandler\catapphandlerplugin.xml       hsresources\plugins\commandhandler\catapphandlerplugin.xml
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\catapphandlerplugin.qtplugin  resource\qt\plugins\commandhandler\catapphandlerplugin.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\catapphandlerplugin.xml       resource\qt\plugins\commandhandler\catapphandlerplugin.xml
 
 file=ABI_DIR\BUILD_DIR\caurlhandlerplugin.dll     SHARED_LIB_DIR\caurlhandlerplugin.dll
-data=\epoc32\data\z\hsresources\plugins\commandhandler\caurlhandlerplugin.qtplugin  hsresources\plugins\commandhandler\caurlhandlerplugin.qtplugin
-data=\epoc32\data\z\hsresources\plugins\commandhandler\caurlhandlerplugin.xml       hsresources\plugins\commandhandler\caurlhandlerplugin.xml
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\caurlhandlerplugin.qtplugin  resource\qt\plugins\commandhandler\caurlhandlerplugin.qtplugin
+data=\epoc32\data\z\resource\qt\plugins\commandhandler\caurlhandlerplugin.xml       resource\qt\plugins\commandhandler\caurlhandlerplugin.xml
 
 file=ABI_DIR\BUILD_DIR\caclient.dll     SHARED_LIB_DIR\caclient.dll
 file=ABI_DIR\BUILD_DIR\cautils.dll     SHARED_LIB_DIR\cautils.dll
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/taskswitcher/testapplications/tstestpluginmanager/tspluginmanager/resource/tspluginmanager.qcrml	Wed Aug 18 10:05:49 2010 +0300
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<repository target="RProperty" uidValue="0xE1f7fe4d">
+    <key int="0xE1f7fe4d" ref="/TaskSwitcherTest/PluginSet"/>
+</repository>
--- a/tsdevicedialog/common.pri	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/common.pri	Wed Aug 18 10:05:49 2010 +0300
@@ -72,6 +72,5 @@
 win32 {
     # add platfrom API for windows
     INCLUDEPATH += \
-                $$PWD/../../homescreensrv/homescreensrv_plat/contentstorage_api \
-                $$PWD/../../homescreensrv/homescreensrv_plat/hswidgetmodel_api \
+                $$PWD/../../homescreensrv/homescreensrv_plat/contentstorage_api
 }
--- a/tsdevicedialog/tsdevicedialog.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialog.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -19,23 +19,26 @@
 coverage {
     SUBDIRS += ../activityfw
     SUBDIRS += ../hsappkeyhandler
-    SUBDIRS += ../tstaskmonitor
+    SUBDIRS += ../taskswitcher
 }
 
 SUBDIRS += tsdevicedialogplugin
 
 tests {
+    SUBDIRS += ../internal/tstestutils
     SUBDIRS += internal/tstestrunner    
     SUBDIRS += tsdevicedialogplugin/tsrc
     SUBDIRS += ../activityfw/activityserviceplugin/tsrc
     SUBDIRS += ../activityfw/storage/client/t_afstorageclient
+    SUBDIRS += ../activityfw/storage/server/tsrc
+    SUBDIRS += ../activityfw/afactivitylauncher/tsrc
     SUBDIRS += ../hsappkeyhandler/tsrc/t_hsappkeyhandler
-    SUBDIRS += ../tstaskmonitor/client/tsrc
-    SUBDIRS += ../tstaskmonitor/server/tsrc
-    SUBDIRS += ../tstaskmonitor/screenshotplugin/tsrc
+    SUBDIRS += ../taskswitcher/client/tsrc
+    SUBDIRS += ../taskswitcher/server/tsrc
+    SUBDIRS += ../taskswitcher/screenshotplugin/tsrc
     SUBDIRS += ../activityfw/tsutils/tsrc
-    SUBDIRS += ../tstaskmonitor/utils/tsrc
-    SUBDIRS += ../tstaskmonitor/backstepping/tsrc
+    SUBDIRS += ../taskswitcher/utils/tsrc
+    SUBDIRS += ../taskswitcher/backstepping/tsrc
 }
 
 symbian:include(rom.pri)
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsactivitymodelitem.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsactivitymodelitem.h	Wed Aug 18 10:05:49 2010 +0300
@@ -17,9 +17,11 @@
 
 #ifndef TSACTIVITYMODELITEM_H
 #define TSACTIVITYMODELITEM_H
-#include "tsmodelitem.h"
+
 #include <qvariant.h>
 #include <qicon.h>
+
+#include "tsmodelitem.h"
 /*!
     Implements model item which represents Activity entry
 */
@@ -27,13 +29,14 @@
 {
     Q_OBJECT
 public:
-    TsActivityModelItem(QAbstractListModel &model, QObject &service, const QVariantHash &activity);
+    TsActivityModelItem(QAbstractListModel &model, 
+                        QObject &service, 
+                        const QVariantHash &activity);
     ~TsActivityModelItem();
     QVariant data(int role) const;
     void close();
     void open();
     static QString applicationKeyword();
-    static QString visibilityKeyword();
     static QString screenshotKeyword();
 
 private:
@@ -50,7 +53,10 @@
     QObject &mService;
     const QVariantHash mActivity;
     QIcon mIcon;
-    bool mRequestPending;
+    mutable bool mRequestPending;
+    
+    Q_DISABLE_COPY(TsActivityModelItem)
+
 };
 
 #endif // TSACTIVITYMODELITEM_H
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsdataroles.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsdataroles.h	Wed Aug 18 10:05:49 2010 +0300
@@ -20,6 +20,7 @@
 namespace TsDataRoles {
     enum EntryAttributes {
         Closable = Qt::UserRole + 1,
+        Active,
     };
 }
 
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogcontainer.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogcontainer.h	Wed Aug 18 10:05:49 2010 +0300
@@ -18,9 +18,7 @@
 #define TSDEVICEDIALOGCONTAINER_H
 
 #include <QObject>
-
 #include <HbDeviceDialogInterface>
-
 #include <qvaluespacepublisher.h>
 
 #include "tsdocumentloader.h"
@@ -29,11 +27,13 @@
 
 class QAbstractListModel;
 
-class TsDeviceDialogContainer : public QObject, public HbDeviceDialogInterface
+class TsDeviceDialogContainer : public QObject, 
+                                public HbDeviceDialogInterface
 {
 Q_OBJECT
 public:
-    explicit TsDeviceDialogContainer(QAbstractListModel *model, QObject *parent = 0);
+    explicit TsDeviceDialogContainer(QAbstractListModel *model, 
+                                     QObject *parent = 0);
     ~TsDeviceDialogContainer();
 
 public:
@@ -51,11 +51,13 @@
 
 private slots:
     void notifyDialogClosed();
+    void switchViewOnModelChange();
     
 private:
     TsDocumentLoader mLoader;
     QValueSpacePublisher mVisibilityPublisher;
 
+    Q_DISABLE_COPY(TsDeviceDialogContainer)
 };
 
 #endif // TSDEVICEDIALOGCONTAINER_H
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogplugin.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsdevicedialogplugin.h	Wed Aug 18 10:05:49 2010 +0300
@@ -19,7 +19,6 @@
 #define TSDEVICEDIALOGPLUGIN_H
 
 #include <hbdevicedialogplugin.h>
-
 #include <QObject>
 #include <QVariantMap>
 #include <QSharedPointer>
@@ -36,15 +35,19 @@
     TsDeviceDialogPlugin();
     ~TsDeviceDialogPlugin();
 
-    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;
+    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:
-    int mError;
     TsDocumentLoader mLoader;
     QAbstractListModel *mModel;
     TsTaskMonitor *mStorage;
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsdocumentloader.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsdocumentloader.h	Wed Aug 18 10:05:49 2010 +0300
@@ -24,7 +24,8 @@
 {
 
 private:
-    virtual QObject *createObject(const QString &type, const QString &name);
+    virtual QObject *createObject(const QString &type, 
+                                  const QString &name);
 
 };
 
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tsmodel.h	Wed Aug 18 10:05:49 2010 +0300
@@ -28,7 +28,6 @@
 #endif
 
 class TsTaskMonitor;
-class ActivityManager;
 class CaNotifier;
 class TsModelItem;
 
@@ -37,13 +36,14 @@
     Q_OBJECT
 
 public:
-    explicit TsModel(TsTaskMonitor &applicationSrv,
-                     QObject &activitySrv,
-                     QObject *parent = 0);
+    TsModel(TsTaskMonitor &applicationSrv,
+            QObject &activitySrv,
+            QObject *parent = 0);
     ~TsModel();
 
     int rowCount(const QModelIndex &parent = QModelIndex()) const;
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+    QVariant data(const QModelIndex &index, 
+                  int role = Qt::DisplayRole) const;
     int maxRowCount()const;
 
 public slots:
@@ -76,14 +76,11 @@
 #endif
 
     /*
-     * Icon size in model
-     */
-    QSize mSize;
-    
-    /*
      * Maximum number of items (only for running apps + activities)
      */ 
     int mMaxItems;
+    
+    Q_DISABLE_COPY(TsModel)
 };
 
 #endif // TSMODEL_H
--- a/tsdevicedialog/tsdevicedialogplugin/inc/tstasksgriditem.h	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/inc/tstasksgriditem.h	Wed Aug 18 10:05:49 2010 +0300
@@ -48,6 +48,7 @@
 
     HbFrameItem *mActiveLabelFrame;
     HbTextItem *mActiveLabel;
+
 };
 
 #endif //TSTASKSGRIDITEM_H
--- a/tsdevicedialog/tsdevicedialogplugin/resource/layout.docml	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/resource/layout.docml	Wed Aug 18 10:05:49 2010 +0300
@@ -3,12 +3,24 @@
     <widget name="tsdevicedialog" type="HbDialog">
         <widget name="heading" role="HbDialog:headingWidget" type="HbLabel">
             <string name="alignment" value="AlignVCenter|AlignHCenter" />
-            <string locid="txt_tsw_title_task_switcher" name="plainText" value="Task switcher" />
+            <string locid="txt_ts_title_task_switcher" name="plainText" value="Task switcher" />
         </widget>
-        <widget name="taskgrid" role="HbDialog:contentWidget" type="TsTasksGrid">
-            <widget name="item" role="HbAbstractView:prototype" type="TsTasksGridItem"/>
-            <bool name="longPressEnabled" value="FALSE"/>
-            <enums name="horizontalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
+        <widget name="gridContainer" role="HbDialog:contentWidget" type="HbWidget">
+            <widget name="taskgrid" type="TsTasksGrid">
+                <widget name="item" role="HbAbstractView:prototype" type="TsTasksGridItem"/>
+                <bool name="longPressEnabled" value="FALSE"/>
+                <bool name="itemRecycling" value="TRUE"/>
+                <enums name="horizontalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
+                <bool name="swapDimensionsOnOrientationChange" value="FALSE"/>
+            </widget>            
+            <widget name="noitemslabel" type="HbLabel">
+                <string name="alignment" value="AlignVCenter|AlignHCenter" />
+                <string locid="txt_ts_info_no_recent_applications" name="plainText"/>
+            </widget>          
+            <layout type="stacked">
+                <stackitem itemname="noitemslabel"/>
+                <stackitem itemname="taskgrid"/>
+            </layout>
         </widget>            
         <bool name="backgroundFaded" value="TRUE"/>
         <string name="dismissPolicy" value="TapOutside"/>
@@ -31,8 +43,8 @@
         </widget>
         <widget name="taskgrid">
             <string name="scrollDirections" value="Horizontal"/>
-            <integer name="rowCount" value="2"/>
-            <integer name="columnCount" value="1"/>
+            <integer name="rowCount" value="1"/>
+            <integer name="columnCount" value="2"/>
         </widget>
     </section>
 </hbdocument>
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsactivitymodelitem.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsactivitymodelitem.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -74,6 +74,8 @@
             return decorationRole();
         case TsDataRoles::Closable:
             return QVariant(false);
+        case TsDataRoles::Active:
+            return QVariant(false);
         default:
             return QVariant(QVariant::Invalid);
     }
@@ -113,15 +115,6 @@
 }
 
 /*!
-    Return activity visibility status keyword
-*/
-QString TsActivityModelItem::visibilityKeyword()
-{
-    static QString visibility("visible");
-    return visibility;
-}
-
-/*!
     Return activity screenshot keyword
 */
 QString TsActivityModelItem::screenshotKeyword()
@@ -137,14 +130,15 @@
 QVariant TsActivityModelItem::decorationRole() const
 {
     if (!mRequestPending) {
-        const_cast<TsActivityModelItem *>(this)->mRequestPending = true;
+        mRequestPending = true;
         QVariant screenshot = mActivity.value(screenshotKeyword());
         if (screenshot.isValid()) {
-            QMetaObject::invokeMethod(&mService,
-                                      "getThumbnail",
-                                      Q_ARG(QSize, QSize(128, 128)),
-                                      Q_ARG(QString, screenshot.toString()),
-                                      Q_ARG(void *, const_cast<TsActivityModelItem *>(this)));
+            QMetaObject::invokeMethod(
+                &mService,
+                "getThumbnail",
+                Q_ARG(QSize, QSize(128, 128)),
+                Q_ARG(QString, screenshot.toString()),
+                Q_ARG(void *, const_cast<TsActivityModelItem *>(this)));
         }
     }
     return QVariant::fromValue<HbIcon>(HbIcon(mIcon));
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogcontainer.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogcontainer.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -11,18 +11,17 @@
 *
 * Contributors:
 *
-* Description: 
+* Description:
 *
 */
-#include "tsdevicedialogcontainer.h"
 
 #include <QAbstractListModel>
-
 #include <HbDialog>
 #include <HbMainWindow>
-
+#include <HbLabel>
 #include <tspropertydefs.h>
 
+#include "tsdevicedialogcontainer.h"
 #include "tstasksgrid.h"
 #include "tstasksgriditem.h"
 
@@ -30,48 +29,77 @@
     const char KDocmlPath[] = ":/resource/layout.docml";
 }
 
-TsDeviceDialogContainer::TsDeviceDialogContainer(QAbstractListModel *model, QObject *parent) : QObject(parent), mVisibilityPublisher(TsProperty::KTsPath)
+TsDeviceDialogContainer::TsDeviceDialogContainer(QAbstractListModel *model, 
+                                                 QObject *parent)
+:
+    QObject(parent), 
+    mVisibilityPublisher(TsProperty::KTsPath)
 {
     bool ok(true);
     mLoader.load(KDocmlPath, &ok);
     Q_ASSERT(ok);
 
-    HbDialog *dialog = qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
-    TsTasksGrid *grid = qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
+    HbDialog *dialog = 
+        qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
+    TsTasksGrid *grid = 
+        qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
     Q_ASSERT(dialog);
     Q_ASSERT(grid);
 
-    changeOrientation(dialog->mainWindow()->orientation());
+    grid->setModel(model);
 
-    grid->setModel(model);
+    changeOrientation(dialog->mainWindow()->orientation());
+    switchViewOnModelChange();
 
     // needed because of Qt::QueuedConnection used below
     // @todo: check if we actually need queued connections
     qRegisterMetaType<QModelIndex>("QModelIndex");
 
     // connect the grid and model
-    disconnect(grid, SIGNAL(activated(QModelIndex)), model, SLOT(openApplication(QModelIndex)));
-    disconnect(grid, SIGNAL(activated(QModelIndex)), dialog, SLOT(close()));
-    disconnect(grid, SIGNAL(deleteButtonClicked(QModelIndex)), model, SLOT(closeApplication(QModelIndex)));
+    connect(grid, 
+            SIGNAL(activated(QModelIndex)), 
+            model, 
+            SLOT(openApplication(QModelIndex)));
+    connect(grid, 
+            SIGNAL(activated(QModelIndex)), 
+            dialog, 
+            SLOT(close()));
+    connect(grid, 
+            SIGNAL(deleteButtonClicked(QModelIndex)), 
+            model, SLOT(closeApplication(QModelIndex)), 
+            Qt::QueuedConnection);
 
-    connect(grid, SIGNAL(activated(QModelIndex)), model, SLOT(openApplication(QModelIndex)));
-    connect(grid, SIGNAL(activated(QModelIndex)), dialog, SLOT(close()));
-    connect(grid, SIGNAL(deleteButtonClicked(QModelIndex)), model, SLOT(closeApplication(QModelIndex)), Qt::QueuedConnection);
+    connect(dialog->mainWindow(), 
+            SIGNAL(orientationChanged(Qt::Orientation)), 
+            this, 
+            SLOT(changeOrientation(Qt::Orientation)));
+    connect(dialog, 
+            SIGNAL(aboutToClose()), 
+            this, 
+            SIGNAL(deviceDialogClosed()));
 
-    connect(dialog->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(changeOrientation(Qt::Orientation)));
-    connect(dialog, SIGNAL(aboutToClose()), this, SIGNAL(deviceDialogClosed()));
-    
-    connect(this, SIGNAL(deviceDialogClosed()), this, SLOT(notifyDialogClosed()));    
-    mVisibilityPublisher.setValue(TsProperty::KVisibilityPath, true);
+    // note: connect to more signals when partial model updates are implemented
+    connect(model, 
+            SIGNAL(modelReset()), 
+            this, 
+            SLOT(switchViewOnModelChange()));
+
+    connect(this, 
+            SIGNAL(deviceDialogClosed()), 
+            this, 
+            SLOT(notifyDialogClosed()));
+    mVisibilityPublisher.setValue(TsProperty::KVisibilityPath, 
+                                  static_cast<int>(true));
     mVisibilityPublisher.sync();
 }
 
-TsDeviceDialogContainer::~TsDeviceDialogContainer() 
-{ 
+TsDeviceDialogContainer::~TsDeviceDialogContainer()
+{
     delete deviceDialogWidget();
 }
 
-bool TsDeviceDialogContainer::setDeviceDialogParameters(const QVariantMap &parameters)
+bool TsDeviceDialogContainer::setDeviceDialogParameters(
+                                  const QVariantMap &parameters)
 {
     Q_UNUSED(parameters);
     return false;
@@ -91,7 +119,8 @@
 
 HbPopup *TsDeviceDialogContainer::deviceDialogWidget() const
 {
-    HbDialog *widget = qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
+    HbDialog *widget = 
+        qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
     Q_ASSERT(widget);
     return widget;
 }
@@ -114,6 +143,25 @@
 
 void TsDeviceDialogContainer::notifyDialogClosed()
 {
-    mVisibilityPublisher.setValue(TsProperty::KVisibilityPath, false);
+    mVisibilityPublisher.setValue(TsProperty::KVisibilityPath, 
+                                  static_cast<int>(false));
     mVisibilityPublisher.sync();
 }
+
+void TsDeviceDialogContainer::switchViewOnModelChange()
+{
+    TsTasksGrid *grid = 
+        qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
+    HbLabel *noItemsLabel = 
+        qobject_cast<HbLabel *>(mLoader.findWidget("noitemslabel"));
+    Q_ASSERT(grid);
+    Q_ASSERT(noItemsLabel);
+
+    if (grid->model()->rowCount()) {
+        noItemsLabel->hide();
+        grid->show();
+    } else {
+        noItemsLabel->show();
+        grid->hide();
+    }
+}
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -19,9 +19,7 @@
 #include <QCoreApplication>
 #include <QLocale>
 #include <QtPlugin>
-
 #include <qservicemanager.h>
-
 #include <hbdevicedialog.h>
 #include <HbMainWindow>
 
@@ -42,12 +40,17 @@
 {
     const char KTranslationPath[] = "resource/qt/translations";
     const char KTsDialogType[] = "com.nokia.taskswitcher.tsdevicedialogplugin/1.0";
+    const char KActivityManaged [] = "com.nokia.qt.activities.ActivityManager";
 } 
  
 /*!
     Constructor.
  */
-TsDeviceDialogPlugin::TsDeviceDialogPlugin() : mError(0), mModel(0), mStorage(0), mTriedToLoadTranslation(false)
+TsDeviceDialogPlugin::TsDeviceDialogPlugin()
+: 
+mModel(0), 
+mStorage(0), 
+mTriedToLoadTranslation(false)
 {
 }
 
@@ -58,7 +61,9 @@
 /*!
     \reimp
  */
-bool TsDeviceDialogPlugin::accessAllowed(const QString &deviceDialogType, const QVariantMap &parameters, const QVariantMap &securityInfo) const
+bool TsDeviceDialogPlugin::accessAllowed(const QString &deviceDialogType, 
+                                         const QVariantMap &parameters, 
+                                         const QVariantMap &securityInfo) const
 {
     Q_UNUSED(deviceDialogType)
     Q_UNUSED(parameters)
@@ -72,7 +77,9 @@
 /*!
     \reimp
  */
-HbDeviceDialogInterface *TsDeviceDialogPlugin::createDeviceDialog(const QString &deviceDialogType, const QVariantMap &parameters)
+HbDeviceDialogInterface * 
+TsDeviceDialogPlugin::createDeviceDialog(const QString &deviceDialogType, 
+                                         const QVariantMap &parameters)
 {
     Q_UNUSED(parameters)
     HbDeviceDialogInterface *dialogInterface(0);
@@ -82,16 +89,23 @@
             mTriedToLoadTranslation = true;
 
             QTranslator *translator = new QTranslator(this);
-            QString translationFile = QString("taskswitcher_%1").arg(QLocale::system().name());
+            QString translationFile = 
+                QString("taskswitcher_%1").arg(QLocale::system().name());
     
             bool translationLoaded(false);
             #ifdef Q_OS_SYMBIAN
-                translationLoaded = translator->load(translationFile, QString("z:/") + KTranslationPath);
+                translationLoaded = 
+                    translator->load(translationFile, 
+                                     QString("z:/") + KTranslationPath);
                 if (!translationLoaded) {
-                    translationLoaded = translator->load(translationFile, QString("c:/") + KTranslationPath);
+                    translationLoaded = 
+                        translator->load(translationFile, 
+                                         QString("c:/") + KTranslationPath);
                 }
             #else
-                translationLoaded = translator->load(translationFile, QString(KTranslationPath));
+                translationLoaded = 
+                    translator->load(translationFile, 
+                                     QString(KTranslationPath));
             #endif //Q_OS_SYMBIAN
 
             Q_ASSERT(translationLoaded);
@@ -106,8 +120,8 @@
             }
             
             QtMobility::QServiceManager serviceManager;
-            QObject *activityManager(serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager"));
-            if (activityManager) {
+            QObject *activityManager(serviceManager.loadInterface(KActivityManaged));
+            if (0 != activityManager) {
                 activityManager->setParent(this); //make it autodestructed
             } else {
                 activityManager = this; //activity plugin is not present. provide invalid instance because its not critical functionality.
@@ -124,13 +138,15 @@
 /*!
     \reimp
  */
-bool TsDeviceDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, const QVariantMap &parameters, DeviceDialogInfo *info) const
+bool TsDeviceDialogPlugin::deviceDialogInfo(const QString &deviceDialogType, 
+                                            const QVariantMap &parameters, 
+                                            DeviceDialogInfo *info) const
 {
     Q_UNUSED(parameters)
     Q_UNUSED(deviceDialogType)
 
     info->group = GenericDeviceDialogGroup;
-    info->flags = NoDeviceDialogFlags;
+    info->flags = SingleInstance;
     info->priority = DefaultPriority;
 
     return true;
@@ -157,7 +173,7 @@
  */
 int TsDeviceDialogPlugin::error() const
 {
-    return mError;
+    return 0;
 }
 
 #ifdef COVERAGE_MEASUREMENT
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsdocumentloader.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsdocumentloader.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -27,7 +27,8 @@
     TS implementation of document loader. It is creating TS objects used in UI
 */
 
-QObject *TsDocumentLoader::createObject(const QString &type, const QString &name)
+QObject *TsDocumentLoader::createObject(const QString &type, 
+                                        const QString &name)
 {
     if (type == TsTasksGrid::staticMetaObject.className()) {
         QObject *object = new TsTasksGrid();
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsentrymodelitem.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsentrymodelitem.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -14,12 +14,13 @@
 * Description: tsentrymodelitem.cpp
 *
 */
-#include "tsentrymodelitem.h"
-#include "tsdataroles.h"
 
 #include <tstask.h>
 #include <HbIcon>
 
+#include "tsentrymodelitem.h"
+#include "tsdataroles.h"
+
 /*!
     \class TsEntryModelItem
     \ingroup group_tsdevicedialogplugin
@@ -55,18 +56,11 @@
         case Qt::DisplayRole:
             return QVariant(mEntry->name());
         case Qt::DecorationRole:
-            {
-                QPixmap icon = mEntry->screenshot().isNull() ? 
-                               mEntry->icon() :
-                               mEntry->screenshot();
-                if (icon.isNull()) {
-                    return HbIcon("qtg_large_application");
-                } else {
-                    return QVariant::fromValue<HbIcon>(HbIcon(icon));
-                }
-            }
+            return QVariant::fromValue<HbIcon>(HbIcon(mEntry->screenshot()));
         case TsDataRoles::Closable:
             return QVariant(mEntry->isClosable());
+        case TsDataRoles::Active:
+            return QVariant(mEntry->isActive());
         default:
             return QVariant(QVariant::Invalid);
     }
--- a/tsdevicedialog/tsdevicedialogplugin/src/tsmodel.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tsmodel.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -14,12 +14,6 @@
 * Description: tsmodel.cpp
 *
 */
-#include "tsmodel.h"
-#include "tsmodelitem.h"
-#include "tsentrymodelitem.h"
-#include "tsactivitymodelitem.h"
-#include "tsdataroles.h"
-
 #include <HbIcon>
 #include <qvariant.h>
 #include <qlist.h>
@@ -33,6 +27,12 @@
 const int ItemsLimit = 0x00000001;
 #endif
 
+#include "tsmodel.h"
+#include "tsmodelitem.h"
+#include "tsentrymodelitem.h"
+#include "tsactivitymodelitem.h"
+#include "tsdataroles.h"
+
 const int maxItems(10);
 /*!
     \class TsModel
@@ -45,19 +45,21 @@
     \param query used to create model
     \param pointer to parent object
 */
-TsModel::TsModel(TsTaskMonitor &applicationSrv, QObject &activitySrv, QObject *parent) :
+TsModel::TsModel(TsTaskMonitor &applicationSrv, 
+                 QObject &activitySrv, 
+                 QObject *parent) :
     QAbstractListModel(parent),
     mEntries(),
     mApplicationService(applicationSrv),
     mActivityService(activitySrv),
-    mSize(240, 240),
     mMaxItems(maxItems)
 {
     
 #ifdef Q_OS_SYMBIAN
     XQSettingsManager *crManager = new XQSettingsManager;
     XQCentralRepositorySettingsKey itemsNumberKey(TSDeviceDialogUid, ItemsLimit);
-    QVariant itemsNumberVariant = crManager->readItemValue(itemsNumberKey, XQSettingsManager::TypeInt);
+    QVariant itemsNumberVariant = 
+        crManager->readItemValue(itemsNumberKey, XQSettingsManager::TypeInt);
     if (!itemsNumberVariant.isNull()) {
         int number = itemsNumberVariant.toInt();
         if (number > 0) {
@@ -67,8 +69,14 @@
     iAppArcSession.Connect();
 #endif
 
-    connect(&activitySrv, SIGNAL(dataChanged()), this, SLOT(updateModel()));
-    connect(&applicationSrv, SIGNAL(taskListChanged()), this, SLOT(updateModel()));
+    connect(&activitySrv, 
+            SIGNAL(dataChanged()), 
+            this, 
+            SLOT(updateModel()));
+    connect(&applicationSrv, 
+            SIGNAL(taskListChanged()), 
+            this, 
+            SLOT(updateModel()));
     updateModel();
 }
 
@@ -132,7 +140,8 @@
 */
 void TsModel::closeApplication(const QModelIndex &index)
 {
-    if (!index.isValid() || !entry(index)->data(TsDataRoles::Closable).toBool()) {
+    if (!index.isValid() || 
+        !entry(index)->data(TsDataRoles::Closable).toBool()) {
         return;
     }
     entry(index)->close();
@@ -144,10 +153,9 @@
 void TsModel::updateModel()
 {
     //clear current data
+    beginResetModel();
     qDeleteAll(mEntries);
     mEntries.clear();
-
-    beginResetModel();
     getApplications();
     getActivities();
     endResetModel();
@@ -160,13 +168,9 @@
 void TsModel::getApplications()
 {
     //get running applications
-    TsModelItem *entry(0);
     QList< QSharedPointer<TsTask> > tasks(mApplicationService.taskList());
     foreach (QSharedPointer<TsTask> taskData, tasks) {
-        entry = new TsEntryModelItem(taskData);
-        if (0 != entry) {
-            mEntries.append(entry);
-        }
+        mEntries.append(new TsEntryModelItem(taskData));
     }
 }
 
@@ -178,16 +182,18 @@
     //get activities
     TsModelItem *entry(0);
     QList<QVariantHash> activities;
-    QMetaObject::invokeMethod(&mActivityService, "activitiesList", Q_RETURN_ARG(QList<QVariantHash>, activities));
+    QMetaObject::invokeMethod(&mActivityService, 
+                              "activitiesList", 
+                              Q_RETURN_ARG(QList<QVariantHash>, 
+                              activities));
     foreach(QVariantHash activity, activities) {
         prepareActivityEntry(activity);
         entry = new TsActivityModelItem(*this, mActivityService, activity);
-        if (entry) {
-            if (maxRowCount() <= mEntries.count()) {
-                break;
-            }
-            mEntries.append(entry);
+        if (maxRowCount() <= mEntries.count()) {
+            delete entry;
+            break;
         }
+        mEntries.append(entry);
     }
 }
 
--- a/tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/src/tstasksgriditem.cpp	Wed Aug 18 10:05:49 2010 +0300
@@ -14,8 +14,6 @@
 * Description:
 *
 */
-#include "tstasksgriditem.h"
-
 #include <HbPushButton>
 #include <HbAbstractItemView>
 #include <HbFrameItem>
@@ -23,6 +21,7 @@
 #include <HbIconItem>
 #include <HbStyleLoader>
 
+#include "tstasksgriditem.h"
 #include "tsdataroles.h"
 
 /*!
@@ -32,12 +31,21 @@
 */
 
 
-TsTasksGridItem::TsTasksGridItem() : HbAbstractViewItem(), mScreenshotLabel(0), mApplicationNameLabel(0), mDeleteButton(0), mActiveLabelFrame(0), mActiveLabel(0)
+TsTasksGridItem::TsTasksGridItem() 
+: 
+HbAbstractViewItem(), 
+mScreenshotLabel(0), 
+mApplicationNameLabel(0), 
+mDeleteButton(0), 
+mActiveLabelFrame(0), 
+mActiveLabel(0)
 {
     // Register the custom docml and css to provide our own style to the list items
-    bool widgetmlLoaded = HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.widgetml");
+    bool widgetmlLoaded = 
+        HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.widgetml");
     Q_ASSERT(widgetmlLoaded);
-    bool cssLoaded = HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.css");
+    bool cssLoaded = 
+        HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.css");
     Q_ASSERT(cssLoaded);
 }
 
@@ -54,7 +62,7 @@
     applicationLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
     applicationLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
 
-    mActiveLabel = new HbTextItem(hbTrId("txt_tsw_label_active"), this);
+    mActiveLabel = new HbTextItem(hbTrId("txt_ts_label_active"), this);
     mActiveLabelFrame = new HbFrameItem(this);
     mActiveLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
     mActiveLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
@@ -88,14 +96,21 @@
 {
     mScreenshotLabel->setIcon(modelIndex().data(Qt::DecorationRole).value<HbIcon>());
     mApplicationNameLabel->setText(modelIndex().data(Qt::DisplayRole).toString());
-    QVariant status(modelIndex().data(TsDataRoles::Closable));
-    const bool isClosable(status.isValid() && status.toBool());
+    
+    QVariant closableData(modelIndex().data(TsDataRoles::Closable));
+    const bool isClosable(closableData.isValid() && closableData.toBool());
     if (isClosable) {
         mDeleteButton->show();
+    } else {
+        mDeleteButton->hide();
+    }
+    
+    QVariant activeData(modelIndex().data(TsDataRoles::Active));
+    const bool isActive(activeData.isValid() && activeData.toBool());
+    if (isActive) {
         mActiveLabel->show();
         mActiveLabelFrame->show();
     } else {
-        mDeleteButton->hide();
         mActiveLabel->hide();
         mActiveLabelFrame->hide();
     }
Binary file tsdevicedialog/tsdevicedialogplugin/taskswitcher.qm has changed
--- a/tsdevicedialog/tsdevicedialogplugin/taskswitcher.ts	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="3.0" language="en_GB" sourcelanguage="en_GB">
-<context>
-<message numerus="no" id="txt_tsw_title_task_switcher">
-    <comment>Task switcher popup title text. Application allows user to swap between running and recently used applications and to clear them from the list.</comment>        
-    <source>Task switcher</source>
-    <translation variants="no">Task switcher</translation>
-    <extra-loc-layout_id>cell_tport_appsw_pane_t1</extra-loc-layout_id>    
-    <extra-loc-viewid>tsw_01</extra-loc-viewid>
-    <extra-loc-positionid>title</extra-loc-positionid>
-    <extra-loc-feature>ts</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
-</context>
-</TS>
--- a/tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.pro	Tue Jul 06 14:37:10 2010 +0300
+++ b/tsdevicedialog/tsdevicedialogplugin/tsdevicedialogplugin.pro	Wed Aug 18 10:05:49 2010 +0300
@@ -42,6 +42,7 @@
 
 INCLUDEPATH += . \
                ./inc \
+               ../../inc \
 
 LIBS +=     -ltstaskmonitorclient
             
@@ -58,13 +59,11 @@
     LIBS += -lxqsettingsmanager -lapparc -lapgrfx
     
     # ugly hack
-    translation.sources = ./*.qm
-    translation.path = $$QT_PLUGINS_BASE_DIR/../translations
     
     crml.sources = ./resource/*.qcrml
     crml.path = /resource/qt/crml
     
-    DEPLOYMENT += pluginstub translation crml
+    DEPLOYMENT += pluginstub crml
     
     BLD_INF_RULES.prj_exports += \
     "$${LITERAL_HASH}include <platform_paths.hrh>" \
--- a/tstaskmonitor/backstepping/backstepping.pro	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies 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
-symbian {
-    BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
-    }
--- a/tstaskmonitor/backstepping/bwins/tsbacksteppingu.def	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-EXPORTS
-	?NewL@CTsBackstepping@@SAPAV1@AAVMTsWindowGroupsMonitor@@@Z @ 1 NONAME ; class CTsBackstepping * CTsBackstepping::NewL(class MTsWindowGroupsMonitor &)
-	?NewLC@CTsBackstepping@@SAPAV1@AAVMTsWindowGroupsMonitor@@@Z @ 2 NONAME ; class CTsBackstepping * CTsBackstepping::NewLC(class MTsWindowGroupsMonitor &)
-	??1CTsBackstepping@@UAE@XZ @ 3 NONAME ; CTsBackstepping::~CTsBackstepping(void)
-
--- a/tstaskmonitor/backstepping/eabi/tsbacksteppingu.def	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-EXPORTS
-	_ZN15CTsBackstepping4NewLER22MTsWindowGroupsMonitor @ 1 NONAME
-	_ZN15CTsBackstepping5NewLCER22MTsWindowGroupsMonitor @ 2 NONAME
-	_ZN15CTsBacksteppingD0Ev @ 3 NONAME
-	_ZN15CTsBacksteppingD1Ev @ 4 NONAME
-	_ZN15CTsBacksteppingD2Ev @ 5 NONAME
-	_ZTI15CTsBackstepping @ 6 NONAME
-	_ZTV15CTsBackstepping @ 7 NONAME
-
--- a/tstaskmonitor/backstepping/group/bld.inf	Tue Jul 06 14:37:10 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:
-*
-*/
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-tsbackstepping.mmp
--- a/tstaskmonitor/backstepping/group/tsbackstepping.mmp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-TARGET         tsbackstepping.dll
-TARGETTYPE     dll
-UID            0x1000008d  0x200267AD
-SECUREID       0x200267AD
-CAPABILITY     ALL -TCB
-
-EPOCHEAPSIZE   0x100000 0x600000 // 1MB - 6MB
-
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE    ../inc
-USERINCLUDE     ../../../inc
-
-SOURCEPATH     ../src
-SOURCE         tsbackstepping.cpp
-
-LIBRARY        euser.lib 
-LIBRARY        ws32.lib // for RWsSession
-LIBRARY        apgrfx.lib // for TApaTask / TApaTasksList
-LIBRARY        tsutils.lib
-
-DEBUGLIBRARY    flogger.lib
--- a/tstaskmonitor/backstepping/inc/tsbackstepping.h	Tue Jul 06 14:37:10 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 __CBACKSTEPPING_H
-#define __CBACKSTEPPING_H
-
-#include <w32std.h>
-#include <tswindowgroupsobserver.h>
-
-
-class CTsBackstepping : public CTsWindowGroupsObserver
-{
-public:
-    IMPORT_C static CTsBackstepping* NewL(MTsWindowGroupsMonitor &);
-    IMPORT_C static CTsBackstepping* NewLC(MTsWindowGroupsMonitor &);
-    IMPORT_C virtual ~CTsBackstepping();
-
-private:
-    CTsBackstepping(MTsWindowGroupsMonitor &);
-    void ConstructL();
-
-    void HandleWindowGroupChanged(MTsResourceManager &, 
-                                  const TArray<RWsSession::TWindowGroupChainInfo> &);
-                                  
-    void HandleWindowGroupChangedL(MTsResourceManager &, 
-                                  const TArray<RWsSession::TWindowGroupChainInfo> &);
-};
-
-#endif // __CBACKSTEPPING_H
--- a/tstaskmonitor/backstepping/inc/tsbacksteppingactivation.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef CTSBACKSTEPPINGWAITINGDLE_H
-#define CTSBACKSTEPPINGWAITINGDLE_H
-
-#include <e32base.h>
-
-class RProperty;
-class MTsWindowGroupsMonitor;
-
-
-NONSHARABLE_CLASS(CTsBacksteppingActivation) : public CActive
-    {
-public:
-    /**
-    * Two-phased constructor.
-    * @param aPriority priority for the timer.
-    * @return new instance of CTeleWaitingIdle.
-    */
-    static CTsBacksteppingActivation* NewL(MTsWindowGroupsMonitor &monitor);
-    /**
-    * destructor
-    */
-    virtual ~CTsBacksteppingActivation();
-
-protected:
-    /**
-     * @see CActive.
-     */
-    void RunL();
-    
-    /**
-     * @see CActive::RunError(TInt)
-     */
-    TInt RunError(TInt);
-    
-    /**
-     * @see CActive.
-     */
-    void DoCancel();  
-
-private:
-    /**
-    * constructor.
-    * @return new instance of CTeleWaitingIdle.
-    */
-    CTsBacksteppingActivation(MTsWindowGroupsMonitor &monitor);
-    
-    void ConstructL();
-    
-    void Subscribe();
-
-private:
-    MTsWindowGroupsMonitor &mMonitor;
-    
-    // Central Repository.
-    RProperty mProperty;
-    
-    // Backstepping engine. Own
-    CBase* mEngine;
-    };
-
-#endif /* CTSBACKSTEPPINGWAITINGDLE_H */
--- a/tstaskmonitor/backstepping/src/tsbackstepping.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <w32std.h>// key event
-#include <apgwgnam.h>// for CApaWindowGroupName
-#include <apgtask.h>
-#include <coedef.h>
-#include <f32file.h>
-#include <flogger.h>
-#include <e32property.h>
-#include <startupdomainpskeys.h>
-
-#include "tsbackstepping.h"
-
-const TUid KHSUid = {0x20022f35};
-
-
-/** 
- *  CTsBackstepping::NewL
- *  two phase constructor
- */
-EXPORT_C CTsBackstepping* CTsBackstepping::NewL(MTsWindowGroupsMonitor &monitor)
-  {
-  RDebug::Print(_L("CTsBackstepping::NewL"));
-  CTsBackstepping* self = CTsBackstepping::NewLC(monitor);
-  CleanupStack::Pop(self);
-  return self;
-  }
-
-/** 
- *  CTsBackstepping::NewLC
- *  two phase constructor
- */
-EXPORT_C CTsBackstepping* CTsBackstepping::NewLC(MTsWindowGroupsMonitor &monitor)
-{ 
-  CTsBackstepping* self = new (ELeave) CTsBackstepping(monitor);
-  CleanupStack::PushL(self);
-  self->ConstructL();
-  return self;
-}
-
-/** 
- * CTsBackstepping::CTsBackstepping
- * constructor
- */
-CTsBackstepping::CTsBackstepping(MTsWindowGroupsMonitor &monitor)
-:
-CTsWindowGroupsObserver(monitor)
-{
-}
-
-
-/** 
- *  CTsBackstepping::~CTsBackstepping
- *  deconstructor
- */
-EXPORT_C CTsBackstepping::~CTsBackstepping()
-{
-}
-
-/** 
- *  CTsBackstepping::ConstructL
- *  two phase constructor
- */
-void CTsBackstepping::ConstructL ()
-{
-    RDebug::Print(_L("CTsBackstepping::ConstructL"));
-    BaseConstructL();
-}
-
-/** 
- * CTsBackstepping::AnalyseWindowStackL
- * Analyzes window stack and move homescreen to proper position
- */
-void CTsBackstepping::HandleWindowGroupChanged(MTsResourceManager &resource, const TArray<RWsSession::TWindowGroupChainInfo> &windowGroups)
-{
-    TRAP_IGNORE(HandleWindowGroupChangedL(resource, windowGroups));
-}
-
-/** 
- * CTsBackstepping::AnalyseWindowStackL
- * Analyzes window stack and move homescreen to proper position
- */
-void CTsBackstepping::HandleWindowGroupChangedL(MTsResourceManager &resource,
-                                                const TArray<RWsSession::TWindowGroupChainInfo> &windowGroups)
-{  
-    RDebug::Print(_L("CTsBackstepping::GetWindowCaption"));
-    
-    CApaWindowGroupName *windowGroupName = CApaWindowGroupName::NewLC(resource.WsSession());
-    
-    TInt count(windowGroups.Count());
-    TInt pos(0);
-    TInt whereToJump(1);
-    for (TInt i=0; i<count; i++) {//iterate through list and give debug info
-        windowGroupName->ConstructFromWgIdL(windowGroups[i].iId);
-        if (windowGroupName->AppUid() != TUid::Null()) {
-            // find the window group id and check that it has no parent
-            if ( windowGroups[i].iParentId <= 0 ) {
-                RDebug::Print( _L("CTsBackstepping::GetWindowCaption wgid:%d is standalone view"), windowGroups[i].iId);
-                //check if it is homescreen 
-                if (windowGroupName->AppUid() == KHSUid) {
-                    RDebug::Print(_L("CTsBackstepping::GetWindowCaption Homescreen position = %d ; list:%d/%d"), pos, i, count);
-                    if (pos <= 1) {// HS is in foreground or second in line - do nothing 
-                        RDebug::Print(_L("CTsBackstepping::nothing to be done - it will stop checking here"));
-                    } else {//we should move homescreen to be second (ommit embeded views) from top
-                        RDebug::Print(_L("CTsBackstepping::moving homescreen to be second from top"));
-                        RDebug::Print(_L("CTsBackstepping::whereToJump = %d"), whereToJump);
-                        resource.WsSession().SetWindowGroupOrdinalPosition(windowGroups[i].iId, whereToJump);
-                    }
-                    // and break
-                    break;
-                }
-                pos++;
-            } else {
-                // only embeded items for first standalone launch should be counted
-                if (!pos) {
-                    ++whereToJump;
-                }
-                RDebug::Print(_L("CTsBackstepping::GetWindowCaption wgid:%d is embedded view"), windowGroups[i].iId);
-            }
-        }
-    }
-    CleanupStack::PopAndDestroy(windowGroupName);
-}
-
-// end of file
--- a/tstaskmonitor/backstepping/src/tsbacksteppingactivation.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include <e32property.h>
-#include <startupdomainpskeys.h>
-#include <flogger.h>
-#include <w32std.h>
-
-#include "tsbacksteppingactivation.h"
-#include "tsbackstepping.h"
-
- // ============================ MEMBER FUNCTIONS ===============================
-// -----------------------------------------------------------------------------
-// CBacksteppingActivation::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CTsBacksteppingActivation* CTsBacksteppingActivation::NewL(MTsWindowGroupsMonitor &monitor)
-{
-    RDebug::Print(_L("CBacksteppingActivation::NewL"));
-    CTsBacksteppingActivation* self = new( ELeave ) CTsBacksteppingActivation(monitor);
-    self->ConstructL();
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-// CBacksteppingWaitingIdle::CBacksteppingWaitingIdle
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CTsBacksteppingActivation::CTsBacksteppingActivation(MTsWindowGroupsMonitor &monitor) 
-:
-    CActive(EPriorityLow),
-    mMonitor(monitor)
-{
-    CActiveScheduler::Add(this);
-}
-
-// -----------------------------------------------------------------------------
-// CBacksteppingActivation::ConstructL()
-// -----------------------------------------------------------------------------
-//
-void CTsBacksteppingActivation::ConstructL() 
-{
-    User::LeaveIfError(mProperty.Attach(KPSUidStartup, KPSIdlePhase1Ok));
-    iStatus = KRequestPending;
-    SetActive();
-    TRequestStatus* status(&iStatus);
-    User::RequestComplete(status);
-}
-
-// -----------------------------------------------------------------------------
-// CBacksteppingActivation::~CBacksteppingActivation
-// Destructor
-// -----------------------------------------------------------------------------
-//
-CTsBacksteppingActivation::~CTsBacksteppingActivation()
-{
-    Cancel();
-    delete mEngine;
-    mProperty.Close();
-}
-
-// -----------------------------------------------------------------------------
-// CBacksteppingActivation::DoCancel
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsBacksteppingActivation::DoCancel()
-{
-    if ( IsActive() && mProperty.Handle() ) {
-        mProperty.Cancel();
-    }
-}
-
-// -----------------------------------------------------------------------------
-// CBacksteppingActivation::RunL
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsBacksteppingActivation::RunL()
-{
-    User::LeaveIfError(iStatus.Int());
-    
-    TInt state(~EIdlePhase1Ok);
-    User::LeaveIfError(mProperty.Get(state));
-    
-    if (EIdlePhase1Ok == state) {
-        if (0 == mEngine) {
-            mEngine = CTsBackstepping::NewL(mMonitor);
-        }
-    } else {
-        delete mEngine;
-        mEngine = 0;
-    }
-    Subscribe();
-}
-
-// -----------------------------------------------------------------------------
-// CBacksteppingActivation::RunError
-// 
-// -----------------------------------------------------------------------------
-//
-TInt CTsBacksteppingActivation::RunError(TInt error)
-{
-    if (KErrCancel != error) {
-        Subscribe();
-    }
-    return KErrNone;
-}
-
-// -----------------------------------------------------------------------------
-// CBacksteppingActivation::Subscribe
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsBacksteppingActivation::Subscribe()
-{
-    mProperty.Subscribe(iStatus);
-    SetActive();
-}
-// end of file
--- a/tstaskmonitor/client/client.pri	Tue Jul 06 14:37:10 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:
-#
-
-INCLUDEPATH +=  $$PWD/inc
-
-HEADERS +=  $$PWD/inc/tstaskmonitor_global.h \
-            $$PWD/inc/tstaskmonitor.h \
-            $$PWD/inc/tstask.h \
-            
-SOURCES +=  $$PWD/src/tstaskmonitor.cpp \
-            
-symbian {
-    INCLUDEPATH +=  $$PWD/s60/inc \
-                    $$PWD/../inc \
-                    $$PWD/../utils/inc \   
-                    $$PWD/../../inc \   
-
-    HEADERS +=  $$PWD/s60/inc/tstaskmonitorobserver.h \
-                $$PWD/s60/inc/tstaskmonitorclient.h \
-                $$PWD/s60/inc/tstaskmonitorclientimpl.h \
-                $$PWD/s60/inc/tssession.h \
-                $$PWD/../utils/inc/tsentry.h \
-                $$PWD/../utils/inc/tsentrykey.h \
-                $$PWD/../utils/inc/tsutils.h \
-                $$PWD/s60/inc/tstaskmonitor_p.h \
-                $$PWD/s60/inc/tsapplicationtask.h \
-                $$PWD/s60/inc/tsscreenshotclient.h \
-                $$PWD/s60/inc/tsscreenshotclientimpl.h \
-                $$PWD/s60/inc/tstasksettings_p.h \
-                $$PWD/../../homescreensrv_plat/taskswitcher_api/tstasksettings.h \
-                
-    SOURCES +=  $$PWD/s60/src/tstaskmonitorclient.cpp \
-                $$PWD/s60/src/tstaskmonitorclientimpl.cpp \
-                $$PWD/s60/src/tssession.cpp \
-                $$PWD/../utils/src/tsentry.cpp \
-                $$PWD/../utils/src/tsentrykey.cpp \                              
-                $$PWD/s60/src/tstaskmonitor_p.cpp \
-                $$PWD/s60/src/tstask.cpp \
-                $$PWD/s60/src/tsapplicationtask.cpp \
-                $$PWD/s60/src/tsscreenshotclient.cpp \
-                $$PWD/s60/src/tsscreenshotclientimpl.cpp \
-                $$PWD/src/tstasksettings.cpp \
-                $$PWD/s60/src/tstasksettings_p.cpp \
-
-    LIBS    +=  -lxqutils \
-                -lestor \
-                -lfbscli
-
-} else {
-    INCLUDEPATH +=  $$PWD/stub/inc \
-
-    HEADERS +=  $$PWD/stub/inc/tstaskmonitor_p.h \
-                $$PWD/stub/inc/tsentry.h \
-                $$PWD/stub/inc/tstasksettings_p.h \
-                
-    SOURCES +=  $$PWD/stub/src/tstaskmonitor_p.cpp \
-                $$PWD/stub/src/tstask.cpp \
-                $$PWD/stub/src/tsentry.cpp \
-                $$PWD/stub/src/tstasksettings_p.cpp \
-                
-}
--- a/tstaskmonitor/client/client.pro	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies 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 = tstaskmonitorclient
-
-CONFIG += dll
-    
-DEFINES += TSTASKMONITOR_LIB
-            
-symbian {
-    dll.sources = tstaskmonitorclient.dll
-    dll.path = $$SHARED_LIB_DIR
-    DEPLOYMENT += dll
-    LIBS += -ltsutils -lws32 -lapgrfx -lcone
-
-    BLD_INF_RULES.prj_exports +=    "s60\inc\tstaskmonitorclient.h" \
-                                    "s60\inc\tstaskmonitorobserver.h" \
-                                    "inc\tstaskmonitor.h" \
-                                    "inc\tstask.h" \
-                                    "inc\tstaskmonitor_global.h" \
-                                    "s60\inc\tsscreenshotclient.h" \
-
-    TARGET.UID3 = 0x200267AF    
-    TARGET.CAPABILITY = ALL -TCB
-    TARGET.EPOCALLOWDLLDATA = 1    
-    
-    # temporary, remove when API is stable enough
-    MMP_RULES += EXPORTUNFROZEN
-}
-
-include(client.pri)
--- a/tstaskmonitor/client/inc/tstask.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSTASK_H
-#define TSTASK_H
-
-#include <QPixmap>
-#include <QString>
-
-#include "tstaskmonitor_global.h"
-
-class CTsEntry;
-
-class TsTask
-{
-    
-public:
-    TsTask(CTsEntry* entry);
-    TSTASKMONITOR_EXPORT virtual ~TsTask();
-    
-    TSTASKMONITOR_EXPORT virtual void open() = 0;
-    TSTASKMONITOR_EXPORT virtual void close() = 0;
-    
-    TSTASKMONITOR_EXPORT bool isClosable() const;
-    TSTASKMONITOR_EXPORT QPixmap icon() const;
-    TSTASKMONITOR_EXPORT QPixmap screenshot() const;
-    TSTASKMONITOR_EXPORT QString name() const;
-    
-protected:
-    CTsEntry* mEntry;
-
-};
-
-#endif //TSTASK_H
--- a/tstaskmonitor/client/inc/tstaskmonitor.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSTASKMONITOR_H
-#define TSTASKMONITOR_H
-
-#include <QObject>
-#include <QSharedPointer>
-
-#include "tstaskmonitor_global.h"
-#include "tstask.h"
-
-class TsTaskMonitorPrivate;
-
-class TSTASKMONITOR_EXPORT TsTaskMonitor : public QObject
-{
-    Q_OBJECT
-    
-public:
-    TsTaskMonitor(QObject *parent = 0);
-    ~TsTaskMonitor();
-    QList< QSharedPointer<TsTask> > taskList();
-
-signals:
-    void taskListChanged();
-    
-private:
-    TsTaskMonitorPrivate *d_ptr;   
-    friend class TsTaskMonitorPrivate;
-};
-
-#endif //TSTASKMONITOR_H
--- a/tstaskmonitor/client/inc/tstaskmonitor_global.h	Tue Jul 06 14:37:10 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 TSTASKMONITOR_GLOBAL_H
-#define TSTASKMONITOR_GLOBAL_H
-
-#include <qglobal.h>
-
-#ifdef TSTASKMONITOR_LIB
-    #define TSTASKMONITOR_EXPORT Q_DECL_EXPORT
-#else
-    #ifdef TSTASKMONITOR_TEST
-        #define TSTASKMONITOR_EXPORT
-    #else
-        #define TSTASKMONITOR_EXPORT Q_DECL_IMPORT
-    #endif
-#endif
-
-#endif //TSTASKMONITOR_GLOBAL_H
--- a/tstaskmonitor/client/s60/inc/tsapplicationtask.h	Tue Jul 06 14:37:10 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 TSAPPLICATIONTASK_H
-#define TSAPPLICATIONTASK_H
-
-#include "tstask.h"
-
-#include <w32std.h>
-
-class TsApplicationTask : public TsTask
-{
-    
-public:
-    TsApplicationTask(RWsSession &wsSession, CTsEntry* entry);
-    
-    virtual void open();
-    virtual void close();
-
-private:
-    RWsSession &mWsSession;
-    
-};
-
-#endif //TSAPPLICATIONTASK_H
--- a/tstaskmonitor/client/s60/inc/tsscreenshotclient.h	Tue Jul 06 14:37:10 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: 
-*
-*/
-#ifndef TSSCREENSHOTCLIENT_H
-#define TSSCREENSHOTCLIENT_H
-
-#include <e32base.h>
-
-#include "tstaskmonitorglobals.h"
-
-class CFbsBitmap;
-class CTsScreenshotClientImpl;
-
-NONSHARABLE_CLASS( CTsScreenshotClient ) : public CBase
-{
-public:
-    IMPORT_C static CTsScreenshotClient* NewL();
-    IMPORT_C static CTsScreenshotClient* NewLC();
-    IMPORT_C ~CTsScreenshotClient();
-
-public:
-    IMPORT_C TInt RegisterScreenshot(CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority = Normal);
-    IMPORT_C void RegisterScreenshot(TRequestStatus &status, CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority = Normal);
-    IMPORT_C TInt UnregisterScreenshot(TInt wgId);
-    IMPORT_C TInt SetVisibility(TInt wgId, Visibility value);
-
-private:
-    CTsScreenshotClient();
-    void ConstructL();
-
-private:
-    CTsScreenshotClientImpl* iImpl;
-};
-
-#endif  // TSSCREENSHOTCLIENT_H
--- a/tstaskmonitor/client/s60/inc/tsscreenshotclientimpl.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSSCREENSHOTCLIENTIMPL_H
-#define TSSCREENSHOTCLIENTIMPL_H
-
-#include <e32base.h>
-
-#include "tstaskmonitorglobals.h"
-#include "tssession.h"
-
-class CFbsBitmap;
-
-NONSHARABLE_CLASS( CTsScreenshotClientImpl ) : public CBase
-{
-public:
-    static CTsScreenshotClientImpl* NewL();
-    static CTsScreenshotClientImpl* NewLC();
-    ~CTsScreenshotClientImpl();
-
-public:
-    TInt RegisterScreenshot(CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority);
-    void RegisterScreenshot(TRequestStatus &status, CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority);
-    TInt UnregisterScreenshot(TInt wgId);
-    TInt SetVisibility(TInt wgId, Visibility value);
-
-private:
-    CTsScreenshotClientImpl();
-    void ConstructL();
-
-    RTsSession iSession;
-};
-
-#endif  // TSSCREENSHOTCLIENTIMPL_H
--- a/tstaskmonitor/client/s60/inc/tssession.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSSESSION_H
-#define TSSESSION_H
-
-#include <e32base.h>
-
-#include "tstaskmonitorglobals.h"
-#include "tsentry.h"
-
-NONSHARABLE_CLASS( RTsSession ) : public RSessionBase
-{
-public:
-    TInt Connect();
-
-public: // task monitor API
-    void TaskListL(RTsFswArray& tasks);
-    void Subscribe(TRequestStatus& aStatus);
-    void CancelSubscribe();
-
-public: // screenshots API
-    TInt RegisterScreenshot(CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority);
-    void RegisterScreenshot(TRequestStatus &status, CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority);
-    TInt UnregisterScreenshot(TInt wgId);
-    TInt SetVisibility(TInt wgId, Visibility value);
-    
-private:
-    TInt StartServer();
-};
-
-#endif  // TSSESSION_H
--- a/tstaskmonitor/client/s60/inc/tstaskmonitor_p.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSTASKMONITOR_P_H
-#define TSTASKMONITOR_P_H
-
-#include "tstaskmonitorobserver.h"
-
-#include <w32std.h>
-
-#include <QList>
-#include <QSharedPointer>
-
-class TsTask;
-class TsTaskMonitor;
-class CTsTaskMonitorClient;
-
-class TsTaskMonitorPrivate : public MTsTaskMonitorObserver
-{
-public:
-    TsTaskMonitorPrivate(TsTaskMonitor *q);
-    virtual ~TsTaskMonitorPrivate();
-    
-public:
-    QList< QSharedPointer<TsTask> > taskList();
-
-public:
-    virtual void HandleRunningAppChange();
-
-private:
-    TsTaskMonitor *q_ptr;
-    CTsTaskMonitorClient *mClient;
-    RWsSession &mWsSession;
-};
-
-#endif //TSTASKMONITOR_P_H
--- a/tstaskmonitor/client/s60/inc/tstaskmonitorclient.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSTASKMONITORCLIENT_H
-#define TSTASKMONITORCLIENT_H
-
-#include <e32base.h>
-
-#include "tsentry.h"
-
-class MTsTaskMonitorObserver;
-class CTsTaskMonitorClientImpl;
-
-NONSHARABLE_CLASS( CTsTaskMonitorClient ) : public CBase
-{
-public:
-    static CTsTaskMonitorClient* NewL();
-    static CTsTaskMonitorClient* NewLC();
-    ~CTsTaskMonitorClient();
-
-public:
-    void TaskListL(RTsFswArray& tasks);
-    void Subscribe(MTsTaskMonitorObserver& aObserver);
-    void CancelSubscribe();
-
-private:
-    CTsTaskMonitorClient();
-    void ConstructL();
-
-private:
-    CTsTaskMonitorClientImpl* iImpl;
-};
-
-#endif  // TSTASKMONITORCLIENT_H
--- a/tstaskmonitor/client/s60/inc/tstaskmonitorclientimpl.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSTASKMONITORCLIENTIMPL_H
-#define TSTASKMONITORCLIENTIMPL_H
-
-#include <e32base.h>
-
-#include "tsentry.h"
-#include "tssession.h"
-
-class MTsTaskMonitorObserver;
-
-NONSHARABLE_CLASS( CTsTaskMonitorClientImpl ) : public CActive
-{
-public:
-    static CTsTaskMonitorClientImpl* NewL();
-    static CTsTaskMonitorClientImpl* NewLC();
-    ~CTsTaskMonitorClientImpl();
-
-public:
-    void TaskListL(RTsFswArray& tasks);
-
-    void Subscribe(MTsTaskMonitorObserver& aObserver);
-    void CancelSubscribe();
-
-private:
-    void RunL();
-    void DoCancel();
-
-private:
-    CTsTaskMonitorClientImpl();
-    void ConstructL();
-
-    RTsSession iSession;
-    MTsTaskMonitorObserver* iObserver; // not owned
-};
-
-#endif  // TSTASKMONITORCLIENTIMPL_H
--- a/tstaskmonitor/client/s60/inc/tstaskmonitorobserver.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Client API
- *
-*/
-
-#ifndef TSTASKMONITOROBSERVER_H
-#define TSTASKMONITOROBSERVER_H
-
-#include <e32base.h>
-
-/**
- * Observer interface for getting notifications about fast swap content changes.
- */
-class MTsTaskMonitorObserver
-    {
-public:
-    /**
-     * Called when there is a change in the fast swap content.
-     * The data can be queried via CTsTaskMonitorClient::TaskListL
-     */
-    virtual void HandleRunningAppChange() = 0;
-    };
-
-#endif //TSTASKMONITOROBSERVER_H
--- a/tstaskmonitor/client/s60/inc/tstasksettings_p.h	Tue Jul 06 14:37:10 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 TSTASKSETTINGS_P_H
-#define TSTASKSETTINGS_P_H
-
-#include <QPixmap>
-
-class CTsScreenshotClient;
-
-class TsTaskSettingsPrivate
-{
-public:
-    TsTaskSettingsPrivate();
-    ~TsTaskSettingsPrivate();
-
-public:
-    bool registerScreenshot(const QPixmap &screenshot);
-    bool unregisterScreenshot();
-    bool setVisibility(bool visibility);
-
-private:
-    int wgId();
-    
-private:
-    CTsScreenshotClient *mClient;   
-    
-};
-
-#endif //TSTASKSETTINGS_P_H
--- a/tstaskmonitor/client/s60/src/tsapplicationtask.cpp	Tue Jul 06 14:37:10 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 "tsapplicationtask.h"
-
-#include <apgtask.h>
-#include <eikenv.h>
-#include <AknDef.h>
-
-#include "tsentry.h"
-
-TsApplicationTask::TsApplicationTask(RWsSession &wsSession, CTsEntry* entry) : TsTask(entry), mWsSession(wsSession)
-{
-}
-
-void TsApplicationTask::open()
-{
-    TApaTaskList taskList(mWsSession);
-    TApaTask task = taskList.FindApp(mEntry->AppUid());
-    task.BringToForeground();
-}
-
-void TsApplicationTask::close()
-{
-    TWsEvent event;
-    event.SetTimeNow();
-    event.SetType(KAknShutOrHideApp);
-    mWsSession.SendEventToWindowGroup(mEntry->Key().WindowGroupId(), event);
-}
--- a/tstaskmonitor/client/s60/src/tsscreenshotclient.cpp	Tue Jul 06 14:37:10 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 <s32mem.h>
-
-#include "tsscreenshotclient.h"
-#include "tsscreenshotclientimpl.h"
-
-EXPORT_C CTsScreenshotClient *CTsScreenshotClient::NewL()
-{
-    CTsScreenshotClient* self = NewLC();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-EXPORT_C CTsScreenshotClient *CTsScreenshotClient::NewLC()
-{
-    CTsScreenshotClient* self = new (ELeave) CTsScreenshotClient;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-}
-
-void CTsScreenshotClient::ConstructL()
-{
-    iImpl = CTsScreenshotClientImpl::NewL();
-}
-
-CTsScreenshotClient::CTsScreenshotClient()
-{
-}
-
-EXPORT_C CTsScreenshotClient::~CTsScreenshotClient()
-{
-    delete iImpl;
-}
-
-EXPORT_C TInt CTsScreenshotClient::RegisterScreenshot(CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority)
-{
-    return iImpl->RegisterScreenshot(screenshot, wgId, priority);
-}
-
-EXPORT_C void CTsScreenshotClient::RegisterScreenshot(TRequestStatus &status, CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority)
-{
-    iImpl->RegisterScreenshot(status, screenshot, wgId, priority);
-}
-
-EXPORT_C TInt CTsScreenshotClient::UnregisterScreenshot(TInt wgId)
-{
-    return iImpl->UnregisterScreenshot(wgId);
-}
-
-EXPORT_C TInt CTsScreenshotClient::SetVisibility(TInt wgId, Visibility value)
-{
-    return iImpl->SetVisibility(wgId, value);
-}
--- a/tstaskmonitor/client/s60/src/tsscreenshotclientimpl.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-    /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include <e32base.h>
-
-#include "tsscreenshotclientimpl.h"
-
-CTsScreenshotClientImpl* CTsScreenshotClientImpl::NewL()
-{
-    CTsScreenshotClientImpl* self = NewLC();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-CTsScreenshotClientImpl* CTsScreenshotClientImpl::NewLC()
-{
-    CTsScreenshotClientImpl* self = new (ELeave) CTsScreenshotClientImpl;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-}
-
-CTsScreenshotClientImpl::CTsScreenshotClientImpl()
-{
-}
-
-CTsScreenshotClientImpl::~CTsScreenshotClientImpl()
-{
-    iSession.Close();
-}
-
-void CTsScreenshotClientImpl::ConstructL()
-{
-    User::LeaveIfError(iSession.Connect());
-}
-
-TInt CTsScreenshotClientImpl::RegisterScreenshot(CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority)
-{
-    return iSession.RegisterScreenshot(screenshot, wgId, priority);
-}
-
-void CTsScreenshotClientImpl::RegisterScreenshot(TRequestStatus &status, CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority)
-{
-    iSession.RegisterScreenshot(status, screenshot, wgId, priority);
-}
-
-TInt CTsScreenshotClientImpl::UnregisterScreenshot(TInt wgId)
-{
-    return iSession.UnregisterScreenshot(wgId);
-}
-
-TInt CTsScreenshotClientImpl::SetVisibility(TInt wgId, Visibility value)
-{
-    return iSession.SetVisibility(wgId, value);
-}
--- a/tstaskmonitor/client/s60/src/tssession.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,148 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <s32mem.h>
-#include <fbs.h>
-
-#include "tssession.h"
-
-TInt RTsSession::Connect()
-{
-    TInt retry = 4;
-    TInt error(KErrNone);
-    do {
-        error = CreateSession(KRunningAppServerName, TVersion(0, 0, 0));
-        if (KErrNotFound != error && KErrServerTerminated != error) {
-            retry = 0;
-        } else {
-            error = StartServer();
-            if (KErrNone != error && KErrAlreadyExists != error) {
-                retry = 0;
-                error = CreateSession(KRunningAppServerName, TVersion(0, 0, 0));
-            }
-        }
-    } while (--retry > 0);
-    return error;
-}
-
-TInt RTsSession::StartServer()
-{
-    RProcess server;
-    if (TInt error = server.Create(KRunningAppServerName, KNullDesC, TUidType(KNullUid, KNullUid, KRunningAppServerUid))) {
-        return error;
-    }
-
-    TRequestStatus status;
-    server.Rendezvous(status);
-    if (status != KRequestPending) {
-        server.Kill(0);
-    } else {
-        server.Resume();
-    }
-
-    User::WaitForRequest(status);
-    TInt error = (EExitPanic == server.ExitType()) ? KErrGeneral : status.Int();
-    if (KErrCancel == error) {
-        error = KErrNone;
-    }
-    server.Close();
-
-    return error;
-}
-
-void RTsSession::TaskListL(RTsFswArray& tasks)
-{
-    for (;;) {
-        TPckgBuf<TInt> dataSize;
-        User::LeaveIfError(SendReceive(GetRunningAppInfo, TIpcArgs(&dataSize)));
-        HBufC8* data = HBufC8::NewLC(dataSize());
-        TPtr8 dataPointer(data->Des());
-        TInt err = SendReceive(FlushData, TIpcArgs(&dataPointer, dataSize()));
-        if (err == KErrNone) {
-            RDesReadStream dataStream(dataPointer);
-            CleanupClosePushL(dataStream);
-            CTsEntry::InternalizeArrayL(dataStream, tasks);
-            CleanupStack::PopAndDestroy(&dataStream);
-        } else if (err != KErrCorrupt) {
-            User::Leave(err);
-        }
-        CleanupStack::PopAndDestroy(data);
-        if (err == KErrNone) {
-            break;
-        }
-        // If result was KErrCorrupt then the size received from GetRunningAppInfo is
-        // not valid anymore so restart the whole procedure.
-    }
-}
-
-void RTsSession::Subscribe(TRequestStatus& aStatus)
-{
-    SendReceive(SubscribeRunningAppChanges, aStatus);
-}
-
-void RTsSession::CancelSubscribe()
-{
-    SendReceive(CancelSubscribeRunningAppChanges);
-}
-
-TInt RTsSession::RegisterScreenshot(CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority)
-{
-    TPckgBuf<TInt> screenshotPackage(screenshot->Handle());
-    TPckgBuf<TInt> wgIdPackage(wgId);
-    TPckgBuf<TInt> priorityPackage(priority);
-
-    TIpcArgs arguments;
-    arguments.Set(ScreenshotHandle, &screenshotPackage);
-    arguments.Set(WindowsGroup, &wgIdPackage);
-    arguments.Set(AdditionalParameters, &KNullDesC8);
-    arguments.Set(Priority, &priorityPackage);
-
-    return SendReceive(RegisterScreenshotMessage, arguments);
-}
-
-void RTsSession::RegisterScreenshot(TRequestStatus &status, CFbsBitmap *screenshot, TInt wgId, UpdatePriority priority)
-{
-    TPckgBuf<TInt> screenshotPackage(screenshot->Handle());
-    TPckgBuf<TInt> wgIdPackage(wgId);
-    TPckgBuf<TInt> priorityPackage(priority);
-
-    TIpcArgs arguments;
-    arguments.Set(ScreenshotHandle, &screenshotPackage);
-    arguments.Set(WindowsGroup, &wgIdPackage);
-    arguments.Set(AdditionalParameters, &KNullDesC8);
-    arguments.Set(Priority, &priorityPackage);
-
-    SendReceive(RegisterScreenshotMessage, arguments, status);
-}
-
-TInt RTsSession::UnregisterScreenshot(TInt wgId)
-{
-    TPckgBuf<TInt> wgIdPackage(wgId);
-    
-    TIpcArgs arguments;
-    arguments.Set(WindowsGroup, &wgIdPackage);
-    arguments.Set(AdditionalParameters, &KNullDesC8);
-    
-    return SendReceive(UnregisterScreenshotMessage, arguments);
-}
-
-TInt RTsSession::SetVisibility(TInt wgId, Visibility value)
-{
-    TPckgBuf<TInt> windowGroup(wgId), visibilityValue(value);
-    
-    TIpcArgs arguments(&windowGroup, &visibilityValue);
-    return SendReceive(VisibilityChange, arguments);
-}
--- a/tstaskmonitor/client/s60/src/tstask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#include "tstask.h"
-
-#include <XQConversions>
-
-#include "tsentry.h"
-
-/*!
-    @class TsTask
-    @ingroup publicApi
-    @brief TsTask object represents a single task.
-    
-    This class is one of the Qt interfaces for Task Monitor server. It can be
-    used to set custom screenshot of the task, or to change the task visibility.
-*/
-
-/*!
-    @internal
-    Constructor. 
-    Takes ownership over @a entry.
-*/
-TsTask::TsTask(CTsEntry* entry) : mEntry(entry)
-{
-}
-
-/*!
-    Destructor.
-*/
-TsTask::~TsTask()
-{
-    delete mEntry;
-}
-
-/*!
-    @return True if it's possible to close the task, false otherwise.
-*/
-bool TsTask::isClosable() const
-{
-    return mEntry->CloseableApp();
-}
-
-/*!
-    @return Icon of the task.
-*/
-QPixmap TsTask::icon() const
-{
-    QPixmap pixmap = QPixmap::fromSymbianCFbsBitmap(mEntry->AppIconBitmap());
-    QPixmap mask = QPixmap::fromSymbianCFbsBitmap(mEntry->AppIconMask());
-    // @todo QPixmap::setAlphaChannel() is deprecated, change to code using QPainter
-    pixmap.setAlphaChannel(mask);
-    return pixmap;
-}
-
-/*!
-    @return Screenshot of the task.
-*/
-QPixmap TsTask::screenshot() const
-{
-    return QPixmap::fromSymbianCFbsBitmap(mEntry->Screenshot());
-}
-
-/*!
-    @return Name of the task.
-*/
-QString TsTask::name() const
-{
-    return XQConversions::s60DescToQString(mEntry->AppName());
-}
-
-/*!
-    @fn TsTask::open()
-    Start or bring the task to foreground.
-*/
-
-/*!
-    @fn TsTask::close()
-    Close the task.
-*/
--- a/tstaskmonitor/client/s60/src/tstaskmonitor_p.cpp	Tue Jul 06 14:37:10 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 "tstaskmonitor_p.h"
-#include "tstaskmonitor.h"
-
-#include <eikenv.h>
-
-#include "tstaskmonitorclient.h"
-#include "tsapplicationtask.h"
-
-#include "tsutils.h"
-using TaskSwitcher::CleanupResetAndDestroyPushL;
-
-TsTaskMonitorPrivate::TsTaskMonitorPrivate(TsTaskMonitor *q) : q_ptr(q), mClient(0), mWsSession(CEikonEnv::Static()->WsSession())
-{
-    QT_TRAP_THROWING(mClient = CTsTaskMonitorClient::NewL());
-    mClient->Subscribe(*this);
-}
-
-TsTaskMonitorPrivate::~TsTaskMonitorPrivate()
-{
-    mClient->CancelSubscribe();
-    delete mClient;
-}
-
-QList< QSharedPointer<TsTask> > TsTaskMonitorPrivate::taskList()
-{
-    QList< QSharedPointer<TsTask> > tasks;
-
-    QT_TRAP_THROWING (    
-        RPointerArray<CTsEntry> entries;   
-        CleanupResetAndDestroyPushL<CTsEntry>(entries);
-        mClient->TaskListL(entries);
-        
-        // TsTask claims ownership of CTsFswEntry, so we have to remove entries from 
-        // entries array after adding task to tasks array to prevent double delete of
-        // CTsFswEntry objects in case of leave (for example due to OOM) in the middle 
-        // of the loop below.
-        while (entries.Count()) {
-            CTsEntry *firstEntry = entries[0];
-            CleanupStack::PushL(firstEntry);
-            entries.Remove(0);
-            
-            // @todo switch by entry type
-            QT_TRYCATCH_LEAVING(tasks.append(QSharedPointer<TsTask>(new TsApplicationTask(mWsSession, firstEntry))));
-            
-            CleanupStack::Pop(firstEntry);
-        }
-        
-        CleanupStack::PopAndDestroy(&entries);    
-    );
-    
-    return tasks;
-}
-
-void TsTaskMonitorPrivate::HandleRunningAppChange()
-{
-    emit q_ptr->taskListChanged();
-}
--- a/tstaskmonitor/client/s60/src/tstaskmonitorclient.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include <s32mem.h>
-
-#include "tstaskmonitorclient.h"
-#include "tstaskmonitorclientimpl.h"
-
-CTsTaskMonitorClient *CTsTaskMonitorClient::NewL()
-{
-    CTsTaskMonitorClient* self = NewLC();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-CTsTaskMonitorClient *CTsTaskMonitorClient::NewLC()
-{
-    CTsTaskMonitorClient* self = new (ELeave) CTsTaskMonitorClient;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-}
-
-void CTsTaskMonitorClient::ConstructL()
-{
-    iImpl = CTsTaskMonitorClientImpl::NewL();
-}
-
-CTsTaskMonitorClient::CTsTaskMonitorClient()
-{
-}
-
-CTsTaskMonitorClient::~CTsTaskMonitorClient()
-{
-    delete iImpl;
-}
-
-void CTsTaskMonitorClient::TaskListL(RTsFswArray& tasks)
-{
-    iImpl->TaskListL(tasks);
-}
-
-void CTsTaskMonitorClient::Subscribe(MTsTaskMonitorObserver& aObserver)
-{
-    iImpl->Subscribe(aObserver);
-}
-
-void CTsTaskMonitorClient::CancelSubscribe()
-{
-    iImpl->CancelSubscribe();
-}
--- a/tstaskmonitor/client/s60/src/tstaskmonitorclientimpl.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include <e32base.h>
-
-#include "tsentry.h"
-#include "tstaskmonitorclientimpl.h"
-#include "tstaskmonitorobserver.h"
-
-CTsTaskMonitorClientImpl* CTsTaskMonitorClientImpl::NewL()
-{
-    CTsTaskMonitorClientImpl* self = NewLC();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-CTsTaskMonitorClientImpl* CTsTaskMonitorClientImpl::NewLC()
-{
-    CTsTaskMonitorClientImpl* self = new (ELeave) CTsTaskMonitorClientImpl;
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-}
-
-CTsTaskMonitorClientImpl::CTsTaskMonitorClientImpl() : CActive(CActive::EPriorityStandard)
-{
-    CActiveScheduler::Add(this);
-}
-
-CTsTaskMonitorClientImpl::~CTsTaskMonitorClientImpl()
-{
-    Cancel();
-    iSession.Close();
-}
-
-void CTsTaskMonitorClientImpl::ConstructL()
-{
-    User::LeaveIfError(iSession.Connect());
-}
-
-void CTsTaskMonitorClientImpl::TaskListL(RTsFswArray& tasks)
-{
-    iSession.TaskListL(tasks);
-}
-
-void CTsTaskMonitorClientImpl::Subscribe(MTsTaskMonitorObserver& aObserver)
-{
-    Cancel();
-    iObserver = &aObserver;
-    iSession.Subscribe(iStatus);
-    SetActive();
-}
-
-void CTsTaskMonitorClientImpl::CancelSubscribe()
-{
-    Cancel();
-}
-
-void CTsTaskMonitorClientImpl::RunL()
-{
-    if (iStatus == KErrNone && iObserver) {
-        iSession.Subscribe(iStatus);
-        SetActive();
-        iObserver->HandleRunningAppChange();
-    }
-}
-
-void CTsTaskMonitorClientImpl::DoCancel()
-{
-    iSession.CancelSubscribe();
-}
--- a/tstaskmonitor/client/s60/src/tstasksettings_p.cpp	Tue Jul 06 14:37:10 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: 
-*
-*/
-#include "tstasksettings_p.h"
-
-#include <fbs.h>
-#include <coecntrl.h>
-#include <QScopedPointer>
-#include <QApplication>
-#include <QDesktopWidget>
-
-#include "tsscreenshotclient.h"
-#include "tstaskmonitorglobals.h"
-
-TsTaskSettingsPrivate::TsTaskSettingsPrivate() : mClient(0)
-{
-    QT_TRAP_THROWING(mClient = CTsScreenshotClient::NewL());
-}
-
-TsTaskSettingsPrivate::~TsTaskSettingsPrivate()
-{
-    delete mClient;
-}
-
-bool TsTaskSettingsPrivate::registerScreenshot(const QPixmap &screenshot)
-{    
-    QScopedPointer<CFbsBitmap> bitmap(screenshot.toSymbianCFbsBitmap());
-    if (bitmap.isNull()) 
-        return false;
-
-    return KErrNone == mClient->RegisterScreenshot(bitmap.data(), wgId());
-}
-
-bool TsTaskSettingsPrivate::unregisterScreenshot()
-{
-    return KErrNone == mClient->UnregisterScreenshot(wgId());
-}
-
-bool TsTaskSettingsPrivate::setVisibility(bool visibility)
-{
-    return (KErrNone == mClient->SetVisibility(wgId(), visibility ? Visible : Invisible));
-}
-
-int TsTaskSettingsPrivate::wgId()
-{
-    return QApplication::desktop()->winId()->ControlEnv()->RootWin().WindowGroupId();
-}
--- a/tstaskmonitor/client/src/tstaskmonitor.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "tstaskmonitor.h"
-#include "tstaskmonitor_p.h"
-
-#include "tstask.h"
-
-/*!
-    @class TsTaskMonitor
-    @ingroup publicApi
-    @brief TsTaskMonitor gives access to list of running tasks.
-    
-    This class is one of the Qt interfaces for Task Monitor server. It can be
-    used to retrieve list of running tasks and receive notifications about the
-    changes of this list.
-*/
-
-/*!
-    Constructor.
-*/
-TsTaskMonitor::TsTaskMonitor(QObject *parent) : QObject(parent), d_ptr(0)
-{
-    d_ptr = new TsTaskMonitorPrivate(this);
-}
-
-/*!
-    Destructor.
-*/
-TsTaskMonitor::~TsTaskMonitor()
-{
-    delete d_ptr;
-}
-
-/*!
-    \return Current list of tasks from Task Monitor server.
-
-    \sa TsTask, taskListChanged()
-*/
-QList< QSharedPointer<TsTask> > TsTaskMonitor::taskList()
-{
-    return d_ptr->taskList();
-}
-
-/*!
-    @fn TsTaskMonitor::taskListChanged()
-
-    This signal is emitted when task list changes in any way:
-    - the new task is started
-    - running task is terminated
-    - parameters of one task change (for example image representing the task is updated)
-
-    No data is passed within this signal, user should retrieve task list
-    using taskList().
-
-    \sa taskList()
-*/
--- a/tstaskmonitor/client/src/tstasksettings.cpp	Tue Jul 06 14:37:10 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 "tstasksettings.h"
-#include "tstasksettings_p.h"
-
-/*!
-    @class TsTaskSettings
-    @ingroup publicApi
-    @brief TsTaskSettings allows application to alter the way it will be 
-    handled by TsTaskMonitor.
-    
-    This class is one of the Qt interfaces for Task Monitor server. It can be
-    used to set custom screenshot of the task, or to change the task visibility.
-*/
-
-/*!
-    Constructor.
-*/
-TsTaskSettings::TsTaskSettings() : d_ptr(new TsTaskSettingsPrivate())
-{
-}
-
-/*!
-    Destructor.
-*/
-TsTaskSettings::~TsTaskSettings()
-{
-    delete d_ptr;
-}
-
-/*!
-    Overwrites default screenshot of task with \a screenshot. If \a 
-    screenshot is null, this method will return false.
-    @return True if the screenshot is successfully saved, false otherwise.
-*/
-bool TsTaskSettings::registerScreenshot(const QPixmap &screenshot)
-{
-    return d_ptr->registerScreenshot(screenshot);
-}
-
-/*!
-    Removes custom screenshot saved with registerScreenshot(). If there was no
-    saved screenshot, this method will return false.
-    @return True if the screenshot is successfully removed, false otherwise.
-*/
-bool TsTaskSettings::unregisterScreenshot()
-{
-    return d_ptr->unregisterScreenshot();
-}
-
-/*!
-    Changes the \a visibilty of task. Hidden tasks are not present on the task
-    list returned by TsTaskMonitor::taskList().
-    @return True if the visibility is changed successfully, false otherwise.
-*/
-bool TsTaskSettings::setVisibility(bool visibility)
-{
-    return d_ptr->setVisibility(visibility);
-}
--- a/tstaskmonitor/client/stub/inc/tsentry.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSFSWENTRY_H
-#define TSFSWENTRY_H
-
-class CTsEntry
-{
-public:
-    CTsEntry();
-};
-
-#endif //TSFSWENTRY_H
--- a/tstaskmonitor/client/stub/inc/tstaskmonitor_p.h	Tue Jul 06 14:37:10 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 TSTASKMONITOR_P_H
-#define TSTASKMONITOR_P_H
-
-#include <QList>
-#include <QSharedPointer>
-
-#include "tstask.h"
-
-class TsTaskMonitor;
-
-class TsTaskMonitorPrivate
-{
-public:
-    TsTaskMonitorPrivate(TsTaskMonitor *q);
-    
-public:
-    QList< QSharedPointer<TsTask> > taskList();
-    
-};
-
-#endif //TSTASKMONITOR_P_H
--- a/tstaskmonitor/client/stub/inc/tstasksettings_p.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSTASKSETTINGS_P_H
-#define TSTASKSETTINGS_P_H
-
-#include <QPixmap>
-
-class TsTaskSettingsPrivate
-{
-public:
-    bool registerScreenshot(const QPixmap &screenshot);
-    bool unregisterScreenshot();
-};
-
-#endif //TSTASKSETTINGS_P_H
--- a/tstaskmonitor/client/stub/src/tsentry.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "tsentry.h"
-
-CTsEntry::CTsEntry()
-{
-}
--- a/tstaskmonitor/client/stub/src/tstask.cpp	Tue Jul 06 14:37:10 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 "tstask.h"
-#include "tsentry.h"
-
-TsTask::TsTask(CTsEntry* entry) : mEntry(entry)
-{
-}
-
-TsTask::~TsTask()
-{
-    delete mEntry;
-}
-
-bool TsTask::isClosable() const
-{
-    return false;
-}
-
-QPixmap TsTask::icon() const
-{
-    return QPixmap();
-}
-
-QPixmap TsTask::screenshot() const
-{
-    return QPixmap();
-}
-
-QString TsTask::name() const
-{
-    return QString();
-}
--- a/tstaskmonitor/client/stub/src/tstaskmonitor_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "tstaskmonitor_p.h"
-
-TsTaskMonitorPrivate::TsTaskMonitorPrivate(TsTaskMonitor *q)
-{
-    Q_UNUSED(q);
-}
-
-QList< QSharedPointer<TsTask> > TsTaskMonitorPrivate::taskList()
-{
-    return QList< QSharedPointer<TsTask> >();
-}
--- a/tstaskmonitor/client/stub/src/tstasksettings_p.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#include "tstasksettings_p.h"
-
-bool TsTaskSettingsPrivate::registerScreenshot(const QPixmap &screenshot)
-{
-    Q_UNUSED(screenshot);
-    return true;
-}
-
-bool TsTaskSettingsPrivate::unregisterScreenshot()
-{
-    return true;
-}
--- a/tstaskmonitor/inc/tstaskmonitorglobals.h	Tue Jul 06 14:37:10 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 RUNNINGAPPGLOBALS_H
-#define RUNNINGAPPGLOBALS_H
-
-#include <e32base.h>
-
-_LIT(KRunningAppServerName, "hsrunningappmonitor");
-const TUid KRunningAppServerUid = {0x200267B0};
-const TInt KRequestDataSizeOffset(0); 
-const TInt KRequestDataBufferOffset(0);
-
-enum RunningAppCmd {
-    GetRunningAppInfo =0,
-    SubscribeRunningAppChanges,
-    UpdateScreenshot,
-    FlushData,
-    CancelSubscribeRunningAppChanges,
-    RegisterScreenshotMessage,
-    UnregisterScreenshotMessage,
-    VisibilityChange
-};
-
-enum UpdatePriority {
-    Low = 0,
-    Normal,
-    High
-};
-
-enum Visibility {
-    Invisible =0,
-    Visible
-};
-
-enum ScreenshotMessageOffsets {
-    ScreenshotHandle = 0,
-    WindowsGroup,
-    AdditionalParameters,
-    Priority
-};
-
-#endif  //RUNNINGAPPGLOBALS_H
-
--- a/tstaskmonitor/rom.pri	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>"
-BLD_INF_RULES.prj_exports += "rom/tstaskmonitor_core.iby  CORE_APP_LAYER_IBY_EXPORT_PATH(tstaskmonitor_core.iby)"
-BLD_INF_RULES.prj_exports += "./sis/stubs/taskmonitor_stub.sis  /epoc32/release/winscw/udeb/z/system/install/taskmonitor_stub.sis"
-BLD_INF_RULES.prj_exports += "./sis/stubs/taskmonitor_stub.sis  /epoc32/data/z/system/install/taskmonitor_stub.sis"
--- a/tstaskmonitor/rom/tstaskmonitor_core.iby	Tue Jul 06 14:37:10 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 __TSTASKMONITOR_CORE_IBY__
-#define __TSTASKMONITOR_CORE_IBY__
-
-file=ABI_DIR\BUILD_DIR\tstaskmonitorclient.dll              SHARED_LIB_DIR\tstaskmonitorclient.dll
-file=ABI_DIR\BUILD_DIR\hsrunningappmonitor.exe              PROGRAMS_DIR\hsrunningappmonitor.exe
-
-file=ABI_DIR\BUILD_DIR\tsbackstepping.dll                   SHARED_LIB_DIR\tsbackstepping.dll
-
-
-ECOM_PLUGIN( tsscreenshotplugin.dll, tsscreenshotplugin.rsc )
-
-// stub sis
-data=ZSYSTEM/install/taskmonitor_stub.sis                  system/install/taskmonitor_stub.sis
-
-#endif //__TSTASKMONITOR_CORE_IBY__
--- a/tstaskmonitor/screenshotplugin/group/bld.inf	Tue Jul 06 14:37:10 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:
-*
-*/
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-tsscreenshotplugin.mmp
--- a/tstaskmonitor/screenshotplugin/group/tsscreenshotplugin.mmp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-TARGET          tsscreenshotplugin.dll
-TARGETTYPE      PLUGIN 
-UID             0x10009D8D 0x200267AE
-CAPABILITY      CAP_ECOM_PLUGIN
-VENDORID        VID_DEFAULT
-
-OPTION_REPLACE  ARMCC --arm -O3 --cpu 6
-
-MW_LAYER_SYSTEMINCLUDE
-
-USERINCLUDE     ../inc
-
-SOURCEPATH      ../src
-SOURCE          tsscreenshotmain.cpp
-SOURCE          tsscreenshotplugin.cpp
-
-RESOURCE        tsscreenshotplugin.rss
-
-LIBRARY         ecom.lib
-LIBRARY         euser.lib
-LIBRARY         wsgraphicdrawer.lib
-LIBRARY         fbscli.lib
-LIBRARY         estor.lib
-LIBRARY         gdi.lib 
-LIBRARY         tstaskmonitorclient.lib
-DEBUGLIBRARY    flogger.lib
--- a/tstaskmonitor/screenshotplugin/inc/tsscreenshotplugin.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-#ifndef TSSCREENSHOTPLUGIN_H
-#define TSSCREENSHOTPLUGIN_H
-
-#include <w32std.h>
-#include <graphics/wsgraphicdrawerinterface.h>
-#include <graphics/wsgraphicdrawer.h>
-
-class CTsScreenshotPlugin: public CWsGraphicDrawer, 
-                           public MWsEventHandler
-{
-public:
-    /**
-     * Two phase constructor 
-     */
-    
-    static CTsScreenshotPlugin* NewL();
-    
-    /**
-     * Destructor
-     */
-    ~CTsScreenshotPlugin();
-
-private:
-    /**
-     * From CWsGraphicDrawer.
-     * @see CWsGraphicDrawer::DoDraw(MWsGc&, const TRect&, const TDesC8&) const
-     */ 
-    void DoDraw(MWsGc&, const TRect&, const TDesC8&) const;
-    
-    /**
-     * From CWsGraphicDrawer
-     * @see CWsGraphicDrawer::HandleMessage(const TDesC8&)
-     */
-    void HandleMessage(const TDesC8&);
-    
-    void HandleMessageL(const TDesC8&);
-    
-    /**
-     * From CWsGraphicDrawer
-     * @see CWsGraphicDrawer::ConstructL(MWsGraphicDrawerEnvironment&, const TGraphicDrawerId& , MWsClient&, const TDesC8&)
-     */
-    void ConstructL(MWsGraphicDrawerEnvironment& env, 
-                    const TGraphicDrawerId& id, 
-                    MWsClient& owner, 
-                    const TDesC8& data);
-    
-    /**
-     * From MWsEventHandler.
-     * 
-     * @see MWsEventHandler::DoHandleEvent(const TWservCrEvent&)
-     */
-    void DoHandleEvent(const TWservCrEvent& event);
-    
-    /**
-     * Function take screenshot od current display
-     * @param screenshot identyfier
-     */
-    void TakeScreenshot(TInt);
-        
-    /**
-     * Function take screenshot od current display
-     * @param screenshot identyfier
-     */
-    void TakeScreenshotL(TInt);
-
-private:
-    RPointerArray<CFbsBitmap> mCache;
-    TInt mWindowGroupId;
-};
-
-#endif //TSSCREENSHOTPLUGIN_H
--- a/tstaskmonitor/screenshotplugin/screenshotplugin.pro	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies 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_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
-    
--- a/tstaskmonitor/screenshotplugin/src/tsscreenshotmain.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <ecom/implementationproxy.h>
-#include "tsscreenshotplugin.h"
-
-const TInt KImpId( 0x200267AE );
-
-// --------------------------------------------------------------------------
-// KImplementationTable
-// --------------------------------------------------------------------------
-//    
-LOCAL_C const TImplementationProxy KImplementationTable[] = 
-{
-    IMPLEMENTATION_PROXY_ENTRY(KImpId, CTsScreenshotPlugin::NewL)
-};
-
-// --------------------------------------------------------------------------
-// ImplementationGroupProxy
-// --------------------------------------------------------------------------
-//    
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
-{
-    aTableCount = (sizeof(KImplementationTable) / sizeof(TImplementationProxy));
-    return KImplementationTable;
-}
--- a/tstaskmonitor/screenshotplugin/src/tsscreenshotplugin.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,176 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "tsscreenshotplugin.h"
-#include "tstaskmonitorglobals.h"
-#include <graphics/wsscreendevice.h>
-#include <s32mem.h>
-
-const TInt KMsgSize(5);
-const TInt KInvalidGroupId(~0);
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-CTsScreenshotPlugin* CTsScreenshotPlugin::NewL()
-{
-    //no second step construction is required here
-    //window server will initialize plugin later
-    return new(ELeave)CTsScreenshotPlugin();
-}
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotPlugin::ConstructL(MWsGraphicDrawerEnvironment& env, 
-                                     const TGraphicDrawerId& id, 
-                                     MWsClient& owner, 
-                                     const TDesC8& /*data*/ )
-{
-    BaseConstructL(env, id, owner);
-    env.RegisterEventHandler(this, 
-                             this, 
-                             TWservCrEvent::EWindowGroupChanged |
-                             TWservCrEvent::EDeviceOrientationChanged);
-    mWindowGroupId = KInvalidGroupId;
-}
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-CTsScreenshotPlugin::~CTsScreenshotPlugin()
-{
-    Env().UnregisterEventHandler(this);
-    mCache.ResetAndDestroy();
-}
-
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotPlugin::DoDraw(MWsGc&, const TRect&, const TDesC8&) const
-{
-    //plugin is not a real drawer
-    //no implementation required
-}
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotPlugin::HandleMessage(const TDesC8& msg)
-{
-    TRAP_IGNORE(HandleMessageL(msg));
-}
-
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotPlugin::HandleMessageL(const TDesC8& msg)
-{
-    TInt parsedMsg[KMsgSize];
-    RDesReadStream msgStream(msg);
-    for (TInt iter(0); iter < KMsgSize; ++iter) {
-        parsedMsg[iter] = msgStream.ReadInt32L(); 
-    }
-    
-    if (RegisterScreenshotMessage == parsedMsg[0]) { //Screenshot registeration ACK 
-        for(TInt iter(0); iter < mCache.Count(); ++iter) {
-            if (mCache[iter]->Handle() == parsedMsg[ScreenshotHandle + 1]) {
-                //bitmap is not needed no more
-                delete mCache[iter];
-                mCache.Remove(iter);
-                break;
-            }
-        }
-    }
-}
-
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotPlugin::DoHandleEvent(const TWservCrEvent& event)
-{
-    switch (event.Type()) {
-    case TWservCrEvent::EWindowGroupChanged:
-        if (KInvalidGroupId != mWindowGroupId) {
-            TakeScreenshot(mWindowGroupId);
-        }
-        mWindowGroupId = event.WindowGroupIdentifier();
-        break;
-    case TWservCrEvent::EDeviceOrientationChanged:
-        TakeScreenshot(mWindowGroupId);
-        break;
-    }
-}
-
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotPlugin::TakeScreenshot(TInt id)
-{
-    TRAP_IGNORE(TakeScreenshotL(id);)
-}
-
-// -----------------------------------------------------------------------------
-// 
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotPlugin::TakeScreenshotL(TInt id)
-{
-    if(0 >= Env().ScreenCount()) {
-        User::Leave(KErrCorrupt);
-    }
-    const TInt screenId(0); //use local variable in case of changing screen selection policy
-    const MWsScreenConfig* const screenConfig = 
-        Env().Screen(screenId)->ObjectInterface<MWsScreenConfig>();
-    const MWsScreenDevice* const screenDevice = 
-        static_cast<MWsScreenDevice*>(Env().Screen(screenId)->ResolveObjectInterface(MWsScreenDevice::EWsObjectInterfaceId));
-    
-    User::LeaveIfNull(screenConfig);
-    User::LeaveIfNull(screenDevice);
-    
-    //prepare destination bitmap
-    CFbsBitmap *bitmap = new (ELeave) CFbsBitmap();
-    CleanupStack::PushL(bitmap);
-    
-    
-    User::LeaveIfError(bitmap->Create(screenConfig->SizeInPixels(), 
-                                screenConfig->DisplayMode()));
-    
-    screenDevice->CopyScreenToBitmapL(bitmap, 
-                                      screenConfig->SizeInPixels());
-    
-    
-    //prepare and send message
-    TInt msg[KMsgSize] = {RegisterScreenshotMessage};
-    
-    msg[WindowsGroup + 1] = id;
-    msg[ScreenshotHandle + 1] = bitmap->Handle();
-    msg[Priority + 1] = Low;
-    msg[AdditionalParameters + 1] = 0; //unused
-    
-    const TPckgC<TInt[sizeof(msg) / sizeof(TInt)]> buf(msg);
-    
-    User::LeaveIfError(SendMessage(buf));
-    
-    mCache.AppendL(bitmap);
-    CleanupStack::Pop(bitmap);
-    
-}
-
--- a/tstaskmonitor/screenshotplugin/src/tsscreenshotplugin.rss	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  ECOM registration file
-*
-*/
-
-
-#include <ecom/registryinfo.rh>
-
-RESOURCE REGISTRY_INFO theInfo
-	{
-	dll_uid = 0x200267AE;
-	interfaces =
-		{
-		INTERFACE_INFO
-			{
-			interface_uid = 0x10281924;
-			implementations =
-				{
-				IMPLEMENTATION_INFO
-					{
-					implementation_uid = 0x200267AE;
-					version_no = 1;
-					display_name = "tsscreenshotplugin";
-					default_data = "";
-					opaque_data = "";
-					}
-				};
-			}
-		};
-	}
--- a/tstaskmonitor/server/group/bld.inf	Tue Jul 06 14:37:10 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:
-*
-*/
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-hsrunningappmonitor.mmp
--- a/tstaskmonitor/server/group/hsrunningappmonitor.mmp	Tue Jul 06 14:37:10 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:
-*
-*/
-TARGET          hsrunningappmonitor.exe
-TARGETTYPE      exe
-UID             0 0x200267B0
-
-USERINCLUDE     ../inc
-USERINCLUDE     ../../inc
-USERINCLUDE     ../../../inc
-USERINCLUDE     ../../utils/inc
-USERINCLUDE     ../../backstepping/inc
-
-MW_LAYER_SYSTEMINCLUDE 
-
-SOURCEPATH      ../src
-SOURCE          main.cpp
-SOURCE          hsrunningappserver.cpp
-SOURCE          hsrunningappsession.cpp
-SOURCE          hsdataobservertask.cpp
-SOURCE          hsdataprovidertask.cpp
-SOURCE          tsdatatask.cpp
-
-SOURCE          tsrunningappstorage.cpp
-SOURCE          tsdatalist.cpp
-SOURCE          tsscreenshotprovider.cpp
-
-SOURCEPATH      ../../utils/src
-SOURCE          tsentrykey.cpp
-SOURCE          tsentrykeygenerator.cpp
-SOURCE          tsentry.cpp
-
-
-LIBRARY         euser.lib 
-LIBRARY         estor.lib
-LIBRARY         apparc.lib
-LIBRARY         ws32.lib
-LIBRARY         apgrfx.lib
-LIBRARY         fbscli.lib
-LIBRARY         bitgdi.lib
-LIBRARY         aknicon.lib
-LIBRARY         tsutils.lib
-LIBRARY         tsbackstepping.lib
-
-CAPABILITY     ALL -TCB
-EPOCHEAPSIZE   0x100000 0x600000 // 1MB - 6MB
-
-#ifdef ENABLE_ABIV2_MODE
-DEBUGGABLE_UDEBONLY
-#endif
--- a/tstaskmonitor/server/inc/hsdataobservertask.h	Tue Jul 06 14:37:10 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 DATAOBSERVERTASK_H
-#define DATAOBSERVERTASK_H
-#include "tsdataobserver.h"
-#include <e32base.h>
-class CHsDataObserverTask: public CHsDataObserver
-{
-public:
-    ~CHsDataObserverTask();
-    static void ExecuteLD(MHsDataObserverStorage& storage,const RMessage2& msg);
-
-private:
-    CHsDataObserverTask(MHsDataObserverStorage& storage, const RMessage2& msg);
-    void DataChanged();
-    void Cancel(const RMessage2& reason);
-
-private:
-    MHsDataObserverStorage& mStorage;
-    const RMessage2 mMsg;
-    TBool mDataChanged;
-};
-#endif //DATAOBSERVERTASK_H
--- a/tstaskmonitor/server/inc/hsdataprovider.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef DATAPROVIDER_H
-#define DATAPROVIDER_H
-
-#include <e32base.h>
-class MHsDataProvider {
-public:
-    virtual const TDesC8& Data() const = 0;
-};
-
-#endif //DATAPROVIDR_H
--- a/tstaskmonitor/server/inc/hsdataprovidertask.h	Tue Jul 06 14:37:10 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 DATAPROVIDERTASK_H
-#define DATAPROVIDERTASK_H
-
-#include "hsdataprovider.h"
-
-class HsDataProviderTask {
-public:
-    static void ExecuteL(const MHsDataProvider& provider, const RMessage2& msg);
-};
-
-#endif //DATAPROVIDER_H
--- a/tstaskmonitor/server/inc/hsrunningappserver.h	Tue Jul 06 14:37:10 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 RUNNINGAPPSERVER_H
-#define RUNNINGAPPSERVER_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include <w32std.h>
-#include "tsdataobserver.h"
-
-class CRunningAppStorage;
-class CTsResourceManager;
-class CTsWindowGroupsMonitor;
-/**
- *  CRunningAppServer
- * 
- */
-class CRunningAppServer : public CServer2,
-                          public MHsDataObserver,
-                          public MHsDataObserverStorage
-{
-public:
-    /**
-     * Destructor.
-     */
-    ~CRunningAppServer();
-
-    /**
-     * Two-phased constructor.
-     */
-    static CRunningAppServer* NewLC();
-    
-public: //MHsDataObserver
-    void DataChanged();
-    
-public: //MHsDataObserverStorage
-    void PushL(CHsDataObserver*);
-    void Pop(CHsDataObserver*);
-    void Cancel(const RMessage2&);
-
-private:
-    /**
-     * Constructor for performing 1st stage construction
-     */
-    CRunningAppServer();
-
-    /**
-     * Default constructor for performing 2nd stage construction
-     */
-    void ConstructL();
-
-    /**
-     * Interface implementation
-     * @see CServer2::NewSessionL(const TVersion&, const RMessage2&)
-     */
-    CSession2* NewSessionL(const TVersion& version, const RMessage2& message) const;
-private:
-    RPointerArray<CHsDataObserver> mObservers;
-    RWsSession mWsSession;
-    CTsResourceManager* mResources;
-    CTsWindowGroupsMonitor* mMonitor;
-    CRunningAppStorage* mStorage;
-    
-    CBase *mScreenshotProviderStarter;
-    CBase *mBacksteppingEngine;
-};
-
-#endif // RUNNINGAPPSERVER_H
--- a/tstaskmonitor/server/inc/hsrunningappsession.h	Tue Jul 06 14:37:10 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 RUNNINGAPPSESSION_H
-#define RUNNINGAPPSESSION_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-#include "tsdataobserver.h"
-#include "hsdataprovider.h"
-#include "tsdatastorage.h"
-/**
- *  CActivitySession
- * 
- */
-class CRunningAppSession : public CSession2
-{
-public:
-    // Constructors and destructor
-
-    /**
-     * Destructor.
-     */
-    ~CRunningAppSession();
-
-    /**
-     * Two-phased constructor.
-     * @param fileSession - initialized file system session
-     * @param taskStorage - global observers storage
-     * @param storage - data storage
-     */
-    static CRunningAppSession* NewL(MHsDataObserverStorage& observerStorage, 
-                                    const MHsDataProvider& dataProvider,
-                                    MTsDataStorage& dataStorage);
-
-private:
-
-    /**
-     * Constructor for performing 1st stage construction
-     */
-    CRunningAppSession(MHsDataObserverStorage& observerStorage, 
-                       const MHsDataProvider& dataProvider,
-                       MTsDataStorage& dataStorage);
-
-    /**
-     * EPOC default constructor for performing 2nd stage construction
-     */
-    void ConstructL();
-
-private:
-    /**
-     * Implements interface
-     * @see void CSession2::ServiceL(const RMessage2&)
-     */
-    void ServiceL(const RMessage2& message);
-
-private:
-    MHsDataObserverStorage& mObserverStorage;
-    const MHsDataProvider& mDataProvider;
-    MTsDataStorage& mDataStorage;
-};
-
-#endif // RUNNINGAPPSESSION_H
--- a/tstaskmonitor/server/inc/tsdatalist.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Non-closeable app list class
- *
-*/
-
-
-#ifndef TSDATALIST_H
-#define TSDATALIST_H
-
-#include <e32base.h>
-#include <tswindowgroupsobserver.h>
-#include "tsentry.h"
-#include "tsdatastorage.h"
-#include "tsdataobserver.h"
-
-class CApaWindowGroupName;
-class CFbsBitmap;
-
-NONSHARABLE_CLASS( CTsDataList ) : public CTsWindowGroupsObserver,
-                                   public MTsDataStorage
-    {
-public:
-    static CTsDataList* NewL(MTsResourceManager& resources, 
-                             MTsWindowGroupsMonitor &monitor, 
-                             MHsDataObserver& observer);
-
-    ~CTsDataList();
-
-private:
-    CTsDataList(MTsResourceManager& resources,
-                MTsWindowGroupsMonitor &monitor, 
-                MHsDataObserver& observer);
-
-    void ConstructL();
-
-public:
-    const RTsFswArray& Data() const;
-
-    void HandleWindowGroupChanged(MTsResourceManager &,
-                                  const TArray<RWsSession::TWindowGroupChainInfo> &);
-
-    TBool IsHiddenUid( TUid uid );
-
-    void UpdateL(TInt key,const CFbsBitmap& data, TInt param, TInt priority);
-    
-    void UpdateL(TInt key, const Visibility& data, TInt param);
-
-    void RemoveL(TInt key, TInt param);
-
-private:
-    void CollectAppsL(RTsFswArray& appsList,
-                      const TArray<RWsSession::TWindowGroupChainInfo> &wgList);
-
-    void AddEntryL(const TTsEntryKey& key, 
-                   const TUid& appUid,
-                   CApaWindowGroupName* wgName,
-                   RTsFswArray& newList );
-
-    TBool ConsiderOldDataL( const TTsEntryKey& key );
-
-    HBufC* FindAppNameLC(CApaWindowGroupName* windowName,
-                         const TUid& appUid,
-                         TInt wgId );
-
-    void FitDataToList( RTsFswArray& listToFit);
-
-    TBool CheckIfExists(const CTsEntry& entry,
-                        const RTsFswArray& newList) const;
-
-    void GetAppIconL(const TUid& appUid,
-                     CFbsBitmap*& bitmapArg, 
-                     CFbsBitmap*& maskArg);
-
-    TInt FindEntry(const RTsFswArray& list, const TTsEntryKey& key ) const;
-
-    TBool EstablishOrder(const RArray<TTsEntryKey>& keyList);
-
-    TBool VerifyApplicationL(TUid);
-
-    TTsEntryKey GenerateKeyL(TInt);
-
-    void CompressLookupTable(RArray<TUid> &array);
-
-    void UpdateLookupTableL(RArray<TUid> &array, TInt offset);
-
-private:
-    /**
-     * Resource manager. Not own
-     */
-    MTsResourceManager& mResources;
-    
-    MHsDataObserver &mObserver;
-    
-    RTsFswArray mData; // current fsw content, i.e. the task list
-
-    // list of hidden uids
-    RArray<TUid> mHiddenUids;
-    
-    // list of allowed uids
-    RArray<TUid> mAllowedUids;
-    };
-
-#endif //TSDATALIST_H
--- a/tstaskmonitor/server/inc/tsdatastorage.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef DATASTORAGE_H
-#define DATASTORAGE_H
-
-#include <e32base.h>
-#include "tstaskmonitorglobals.h"
-class CFbsBitmap;
-class MTsDataStorage {
-public:
-    virtual void UpdateL(TInt key, const CFbsBitmap& data, TInt param, TInt priority) =0;
-    virtual void UpdateL(TInt key, const Visibility& data, TInt param) =0;
-    virtual void RemoveL(TInt key, TInt param) =0;
-};
-
-#endif //DATASTORAGE_H
--- a/tstaskmonitor/server/inc/tsdatatask.h	Tue Jul 06 14:37:10 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 TSDATATASK_H
-#define TSDATATASK_H
-#include "tstaskmonitorglobals.h"
-#include "tsdatastorage.h"
-class TsDataTask
-{
-public:
-    static void ExecuteL(MTsDataStorage& dataStorage, const RMessage2& msg);
-
-private:
-    static void RegisterScreenshotL(MTsDataStorage& dataStorage, 
-                                    const RMessage2& msg);
-    
-    static void UnregisterScreenshotL(MTsDataStorage& dataStorage, 
-                                      const RMessage2& msg);
-    
-    static void VisibilityChangeL(MTsDataStorage& dataStorage, 
-                                  const RMessage2& msg);
-};
-
-#endif //TSDATATASK_H
--- a/tstaskmonitor/server/inc/tsrunningappstorage.h	Tue Jul 06 14:37:10 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:
-*
-*/
-#ifndef RUNNINGAPPSTORAGE_H
-#define RUNNINGAPPSTORAGE_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include "tsdataobserver.h"
-#include "hsdataprovider.h"
-#include "tsdatastorage.h"
-
-class CTsDataList;
-class MTsResourceManager;
-class MTsWindowGroupsMonitor;
-
-/**
- *  CRunningAppServer
- * 
- */
-class CRunningAppStorage : public CBase,
-                           public MHsDataProvider, 
-                           public MHsDataObserver,
-                           public MTsDataStorage 
-{
-public:
-    /**
-     * Destructor.
-     */
-    ~CRunningAppStorage();
-
-    /**
-     * Two-phased constructor.
-     */
-    static CRunningAppStorage* NewL(MHsDataObserver& observer,
-                                    MTsResourceManager& resources,
-                                    MTsWindowGroupsMonitor &wsMonitor);
-    
-public: //MHsDataObserver
-    const TDesC8& Data() const; 
-    
-    //MHsDataChangeProvider
-    void DataChanged();
-    
-    void UpdateL(TInt key,const CFbsBitmap& data, TInt param, TInt priority);
-    
-    void UpdateL(TInt key, const Visibility& data, TInt param);
-    
-    void RemoveL(TInt key, TInt param);
-
-private:
-    /**
-     * Constructor for performing 1st stage construction
-     */
-    CRunningAppStorage(MHsDataObserver& observer);
-
-    /**
-     * Default constructor for performing 2nd stage construction
-     */
-    void ConstructL(MTsResourceManager& resources,
-                    MTsWindowGroupsMonitor &wsMonitor);
-    
-    void DataChangedL();
-
-private:
-    MHsDataObserver& mObserver;
-    RBuf8 mData;
-    CTsDataList* mEngine;
-};
-
-#endif // RUNNINGAPPSERVER_H
--- a/tstaskmonitor/server/inc/tsscreenshotprovider.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef TSSCREENSHOTPROVIDER_H
-#define TSSCREENSHOTPROVIDER_H
-#include "tsdatastorage.h"
-#include <w32std.h>
-
-class CTsScreenshotProvider: public CWsGraphic
-{
-public:
-    static CTsScreenshotProvider* NewL(MTsDataStorage&);
-private:
-    CTsScreenshotProvider(MTsDataStorage&);
-    void HandleMessage(const TDesC8&);
-    void HandleMessageL(const TDesC8&);
-    void OnReplace();
-private:
-    MTsDataStorage& mStorage;
-};
-
-#endif //TSSCREENSHOTTASK_H
--- a/tstaskmonitor/server/server.pro	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies 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_exports += "$${LITERAL_HASH}include \"group/bld.inf\""
-    
--- a/tstaskmonitor/server/src/hsdataobservertask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "hsdataobservertask.h"
-#include "tstaskmonitorglobals.h"
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CHsDataObserverTask::CHsDataObserverTask(MHsDataObserverStorage& storage, 
-                                         const RMessage2& msg)
-:
-    mStorage(storage),
-    mMsg(msg)
-{
-    // No implementation required
-}
-
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CHsDataObserverTask::~CHsDataObserverTask()
-{
-    if (EFalse == mMsg.IsNull()) {
-        mMsg.Complete(mDataChanged ? KErrNone : KErrCancel);
-    }
-}
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CHsDataObserverTask::ExecuteLD(MHsDataObserverStorage& storage,const RMessage2& msg)
-{
-    CHsDataObserver *self = new (ELeave)CHsDataObserverTask(storage, msg);
-    CleanupStack::PushL(self);
-    storage.PushL(self);
-    CleanupStack::Pop(self);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CHsDataObserverTask::DataChanged()
-{
-    mDataChanged = ETrue;
-    mStorage.Pop(this);
-    delete this; 
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CHsDataObserverTask::Cancel(const RMessage2& reason)
-{
-    if (CancelSubscribeRunningAppChanges == reason.Function() &&
-        mMsg.Session() == reason.Session()) {
-        mStorage.Pop(this);
-        delete this;
-   }
-}
--- a/tstaskmonitor/server/src/hsdataprovidertask.cpp	Tue Jul 06 14:37:10 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:
-*
-*/
-#include "hsdataprovidertask.h"
-#include "tstaskmonitorglobals.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void HsDataProviderTask::ExecuteL(const MHsDataProvider& provider, const RMessage2& msg)
-{
-    switch (msg.Function()) {
-    case GetRunningAppInfo:
-        msg.WriteL(KRequestDataSizeOffset, TPckgBuf<TInt>(provider.Data().Length()));
-        msg.Complete(KErrNone);
-        break;
-    
-    case FlushData:
-        if (provider.Data().Length() > msg.GetDesMaxLengthL(KRequestDataBufferOffset)) {
-            User::Leave(KErrCorrupt);
-        }
-        msg.WriteL(KRequestDataBufferOffset, provider.Data());
-        msg.Complete(KErrNone);
-        break;
-    }
-}
--- a/tstaskmonitor/server/src/hsrunningappserver.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <tswindowgroupsobserver.h>
-#include "tstaskmonitorglobals.h"
-#include "hsrunningappserver.h"
-#include "hsrunningappsession.h"
-#include "tsrunningappstorage.h"
-#include "tsscreenshotprovider.h"
-#include "tsbackstepping.h"
-
-_LIT(KErrObserverExists, "Observer already exists");
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppServer::CRunningAppServer()
-:
-CServer2(EPriorityStandard)
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppServer::~CRunningAppServer()
-{
-    delete mBacksteppingEngine;
-    delete mScreenshotProviderStarter;
-    delete mStorage;
-    delete mMonitor;
-    mObservers.ResetAndDestroy();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppServer* CRunningAppServer::NewLC()
-{
-    CRunningAppServer* self = new (ELeave) CRunningAppServer();
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppServer::ConstructL()
-{
-    StartL(KRunningAppServerName);
-    User::LeaveIfError(mWsSession.Connect());
-    mResources = CTsResourceManager::NewL();
-    mMonitor = CTsWindowGroupsMonitor::NewL(*mResources);
-    mStorage = CRunningAppStorage::NewL(*this, *mResources, *mMonitor);
-    TRAP_IGNORE(mScreenshotProviderStarter = CTsScreenshotProvider::NewL(*mStorage);
-    mBacksteppingEngine = CTsBackstepping::NewL(*mMonitor);)
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CSession2* CRunningAppServer::NewSessionL(const TVersion &, const RMessage2&) const
-{
-    return CRunningAppSession::NewL(*const_cast<CRunningAppServer *>(this),
-                                    *const_cast<CRunningAppServer *>(this)->mStorage,
-                                    *const_cast<CRunningAppServer *>(this)->mStorage);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppServer::DataChanged()
-{
-    while (0 < mObservers.Count()) {
-        mObservers[0]->DataChanged();
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppServer::PushL(CHsDataObserver* observer)
-{
-    ( 0 <= mObservers.Find(observer)) ?
-    User::Panic(KErrObserverExists, KErrAlreadyExists) :
-    mObservers.AppendL(observer);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppServer::Pop(CHsDataObserver* observer)
-{
-    const TInt offset(mObservers.Find(observer));
-    if(0 <= offset) {
-        mObservers.Remove(offset);
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppServer::Cancel(const RMessage2& reason)
-{
-    for (TInt iter(mObservers.Count() - 1); 0 <= iter; --iter) {
-        mObservers[iter]->Cancel(reason);
-    }
-    reason.Complete(KErrNone);
-}
--- a/tstaskmonitor/server/src/hsrunningappsession.cpp	Tue Jul 06 14:37:10 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 "hsrunningappsession.h"
-#include "tstaskmonitorglobals.h"
-
-#include "hsdataobservertask.h"
-#include "hsdataprovidertask.h"
-#include "tsdatatask.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppSession::CRunningAppSession(MHsDataObserverStorage& observerStorage,
-                                       const MHsDataProvider& dataProvider,
-                                       MTsDataStorage& dataStorage)
-:
-    mObserverStorage(observerStorage),
-    mDataProvider(dataProvider),
-    mDataStorage(dataStorage)
-{
-    // No implementation required
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppSession::~CRunningAppSession()
-{
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppSession* CRunningAppSession::NewL(MHsDataObserverStorage& observerStorage, 
-                                             const MHsDataProvider& dataProvider,
-                                             MTsDataStorage& dataStorage)
-{
-    CRunningAppSession* self = new (ELeave) CRunningAppSession(observerStorage, 
-                                                               dataProvider,
-                                                               dataStorage);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppSession::ConstructL()
-{
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppSession::ServiceL(const RMessage2& message)
-{
-    switch (message.Function()) {
-    case SubscribeRunningAppChanges:
-        CHsDataObserverTask::ExecuteLD(mObserverStorage, message);
-        break;
-    
-    case CancelSubscribeRunningAppChanges:
-        mObserverStorage.Cancel(message);
-        break;
-    
-    case GetRunningAppInfo:
-    case FlushData:
-        HsDataProviderTask::ExecuteL(mDataProvider, message);
-        break;
-        
-    case RegisterScreenshotMessage:
-    case UnregisterScreenshotMessage:
-    case VisibilityChange:
-        TsDataTask::ExecuteL(mDataStorage, message);
-        break;
-    
-    default:
-        message.Complete(CServer2::EBadMessageNumber);
-    }
-}
--- a/tstaskmonitor/server/src/main.cpp	Tue Jul 06 14:37:10 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:
-*
-*/
-#include "hsrunningappserver.h"
-#include <e32base.h>
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-LOCAL_C void StartRunningAppServerL()
-{
-    CActiveScheduler* activeScheduler = new( ELeave ) CActiveScheduler;
-    CleanupStack::PushL( activeScheduler );
-    CActiveScheduler::Install( activeScheduler );
-    CServer2* serverObject = CRunningAppServer::NewLC();
-    RProcess::Rendezvous( KErrNone );
-    CActiveScheduler::Start();
-    CleanupStack::PopAndDestroy( serverObject );
-    CleanupStack::PopAndDestroy( activeScheduler );
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-LOCAL_C TInt StartRunningAppServer()
-{
-    __UHEAP_MARK;
-    TInt errNo(KErrNoMemory);
-    CTrapCleanup* cleanupStack = CTrapCleanup::New();
-    if (cleanupStack) {
-        TRAP(errNo, StartRunningAppServerL());
-        delete cleanupStack;
-    }
-    __UHEAP_MARKEND;
-    if (KErrNone != errNo) {
-        RProcess::Rendezvous(errNo);
-    }
-    return errNo;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TInt E32Main()
-{
-    return StartRunningAppServer();
-}
--- a/tstaskmonitor/server/src/tsdatalist.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,541 +0,0 @@
-/*
- * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  File containing application list classes
- *
- */
-
-//INCLUDES:
-
-#include "tsdatalist.h"
-#include "tsentrykeygenerator.h"
-#include <mmf/common/mmfcontrollerpluginresolver.h> // for CleanupResetAndDestroyPushL
-#include <apgwgnam.h>
-#include <bitstd.h>
-#include <AknIconUtils.h> // avkon
-#include <apgicnfl.h> // fbsbitmap
-#include <AknIconSrvClient.h> 
-#include <fbs.h>
-#include <apgwgnam.h>
-
-
-// size for the created app icons
-const TInt KAppIconWidth = 128;
-const TInt KAppIconHeight = 128;
-
-//uids to be hidden
-const TUid KHsApplicationUid = { 0x20022F35 };
-
-const TInt KMaxLookupSize(75);
-
-// ================= MEMBER FUNCTIONS =======================
-
-// --------------------------------------------------------------------------
-/**
- * Two-phased constructor.
- */
-CTsDataList* CTsDataList::NewL(MTsResourceManager& resources,
-                                     MTsWindowGroupsMonitor &monitor, 
-                                     MHsDataObserver& observer)
-{
-    CTsDataList* self = new (ELeave) CTsDataList(resources, monitor, observer);
-    CleanupStack::PushL(self);
-    self->ConstructL();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Constructor.
- */
-CTsDataList::CTsDataList(MTsResourceManager& resources,
-                         MTsWindowGroupsMonitor &monitor, 
-                         MHsDataObserver& observer) 
-:
-    CTsWindowGroupsObserver(monitor),
-    mResources(resources),
-    mObserver(observer)
-{
-}
-
-// --------------------------------------------------------------------------
-/*
- * Destructor
- */
-CTsDataList::~CTsDataList()
-{
-    mData.ResetAndDestroy();
-    mHiddenUids.Close();
-    mAllowedUids.Close();
-    RFbsSession::Disconnect();
-    RAknIconSrvClient::Disconnect();
-}
-
-// --------------------------------------------------------------------------
-/**
- * Performs 2nd phase construction.
- */
-void CTsDataList::ConstructL()
-{
-    BaseConstructL();
-    mHiddenUids.AppendL(KHsApplicationUid);
-    User::LeaveIfError(RFbsSession::Connect());
-    RAknIconSrvClient::Connect();
-}
-
-// --------------------------------------------------------------------------
-/**
- * Returns a reference to the current content.
- * Also performs sanity checks, e.g. associates application icons
- * when no screenshot has been received.
- * @return  ref to content array
- */
-const RTsFswArray& CTsDataList::Data() const
-{
-    return mData;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Interface implementation
- * @see MTsWindowGroupsObserver HandleWindowGroupChanged
- */
-void CTsDataList::HandleWindowGroupChanged(MTsResourceManager &, 
-                                              const TArray<RWsSession::TWindowGroupChainInfo> &wgList)
-{
-    TRAP_IGNORE(RTsFswArray newAppsList;
-                CleanupResetAndDestroyPushL(newAppsList);
-                CollectAppsL(newAppsList, wgList);
-                FitDataToList(newAppsList);
-                CleanupStack::PopAndDestroy(&newAppsList));
-    
-}
-
-// --------------------------------------------------------------------------
-/**
- * Adds running apps to the list.
- * @param   appsList    array to add to
- */
-void CTsDataList::CollectAppsL(RTsFswArray& appsList, 
-                               const TArray<RWsSession::TWindowGroupChainInfo> &wgList)
-{
-    TInt offset(KErrNotFound);
-    for (TInt i = 0; i < wgList.Count(); ++i) {
-        TTsEntryKey key = TsEntryKeyGeneraror::GenerateL(wgList[i].iId, wgList);
-        //skip this entry if it is already on list
-        if (FindEntry(appsList, key) >= 0) {
-            continue;
-        }
-
-        // get window group name
-        CApaWindowGroupName* windowName = CApaWindowGroupName::NewLC(mResources.WsSession(), key.WindowGroupId());
-        TUid appUid = windowName->AppUid();
-        
-        //Check hidden applications
-        if (KErrNotFound != (offset = mHiddenUids.Find(appUid))) {
-            UpdateLookupTableL(mHiddenUids, offset);
-        } else if (KErrNotFound != (offset = mAllowedUids.Find(appUid))) {
-            UpdateLookupTableL(mAllowedUids, offset);
-            AddEntryL(key, appUid, windowName, appsList);
-        } else if(VerifyApplicationL(appUid)) {
-            AddEntryL(key, appUid, windowName, appsList);
-        }
-        CleanupStack::PopAndDestroy(windowName);
-    }
-    CompressLookupTable(mHiddenUids);
-    CompressLookupTable(mAllowedUids);
-}
-
-// --------------------------------------------------------------------------
-/**
- * Called from CollectTasksL for each entry in the task list.
- * @param   key       entry key
- * @param   appUid     application uid
- * @param   wgName     window group name or NULL
- * @param   newList    list to add to
- */
-void CTsDataList::AddEntryL(const TTsEntryKey& key, const TUid& appUid,
-    CApaWindowGroupName* wgName, RTsFswArray& newList)
-{
-    CTsEntry* entry = CTsEntry::NewLC(key, &mObserver);
-
-    // check if present in old list and if yes then take some of the old data
-    TBool found = ConsiderOldDataL(key);
-
-    // if not present previously then find out app name
-    // and check if screenshot is already available
-    if (!found) {
-        entry->SetAppUid(appUid);
-        HBufC* name = FindAppNameLC(wgName, appUid, key.WindowGroupId());
-        if (name) {
-            entry->SetAppNameL(*name);
-        }
-        CleanupStack::PopAndDestroy(name);
-
-        if (wgName) {
-            entry->SetCloseableApp(!wgName->IsSystem());
-        }
-        CFbsBitmap* iconBitmap = NULL;
-        CFbsBitmap* iconMask = NULL;
-        GetAppIconL(appUid, iconBitmap, iconMask);
-        //transfer ownership to entry
-        entry->SetAppIcon(iconBitmap, iconMask);
-    }
-
-    // add to new list, ownership is transferred
-    newList.AppendL(entry);
-    CleanupStack::Pop(entry);
-}
-
-// --------------------------------------------------------------------------
-/**
- * Checks if there is an entry for same app in the content list.
- * If yes then it takes some of the data for the entry that
- * will correspond to the same app in the refreshed content list.
- * @param   key      new key in content list
- * @return  ETrue if app was found
- */
-TBool CTsDataList::ConsiderOldDataL(const TTsEntryKey& key)
-{
-    for (TInt entryIdx = 0, oldCount = mData.Count(); entryIdx < oldCount; ++entryIdx) {
-        if (mData[entryIdx]->Key() == key) {
-            return ETrue;
-        }
-    }
-    return EFalse;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Finds out the application name.
- * @param   windowName window group name or NULL
- * @param   appUId     application uid
- * @param   wgId       window group id
- * @return  application name, ownership transferred to caller
- */
-HBufC* CTsDataList::FindAppNameLC(CApaWindowGroupName* windowName, const TUid& appUid, TInt wgId)
-{
-    //Retrieve the app name
-    TApaAppInfo info;
-    mResources.ApaSession().GetAppInfo(info, appUid);
-    TPtrC caption = info.iShortCaption;
-
-    HBufC* tempName = 0;
-    if (!caption.Length() && windowName) // if not set - use thread name instead
-    {
-        if (windowName->Caption().Length()) {
-            tempName = windowName->Caption().AllocL();
-            //put on cleanupstack after the if
-        }
-        else {
-            TThreadId threadId;
-            TInt err = mResources.WsSession().GetWindowGroupClientThreadId(wgId, threadId);
-            if (err == KErrNone) {
-                RThread thread;
-                CleanupClosePushL(thread);
-                err = thread.Open(threadId);
-                if (err == KErrNone) {
-                    tempName = thread.Name().AllocL(); // codescanner::forgottoputptroncleanupstack
-                    // tempName put on cleanupstack after the if
-                }
-                CleanupStack::PopAndDestroy(&thread);
-            }
-        }
-    }
-    else {
-        tempName = caption.AllocL();
-        //put on cleanupstack after the if
-    }
-    CleanupStack::PushL(tempName);
-    return tempName;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Fit existing class contained data list into give one.
- * Data is being changed with application type consideration that is based 
- * on aConsiderWidgets param. 
- * Function removes or add entries into data depend on given list.
- * @param   listToFit          list with actual data  
- */
-void CTsDataList::FitDataToList(RTsFswArray& listToFit)
-{
-    TBool changed = EFalse;
-    TInt listCount = listToFit.Count();
-    TInt dataCount = mData.Count();
-
-    //remove items that dont't exists in newly collected list      
-    for (TInt i = dataCount - 1; i >= 0; --i) {
-        if (!CheckIfExists(*mData[i], listToFit)) {
-            delete mData[i];
-            mData.Remove(i);
-            changed = ETrue;
-        }
-    }
-    RArray<TTsEntryKey> allKeys;
-
-    //add new item at start
-    for (TInt i = listToFit.Count() - 1; i >= 0; --i) {
-        allKeys.Insert(listToFit[i]->Key(), 0);
-        if (!CheckIfExists(*listToFit[i], mData)) {
-            mData.Insert(listToFit[i], 0);
-            listToFit[i] = 0;
-            changed = ETrue;
-        }
-    }
-    //establish order
-    TBool orderChanged = EstablishOrder(allKeys);
-    if (changed || orderChanged) {
-        mObserver.DataChanged();
-    }
-    allKeys.Close();
-}
-
-// --------------------------------------------------------------------------
-/**
- * Checks if there is an entry for same app in the given list.
- * @param   entry      entry
- * @param   newList    ref to list
- * @return  ETrue if app was found
- */
-
-TBool CTsDataList::CheckIfExists(const CTsEntry& entry, const RTsFswArray& list) const
-{
-    TBool exists(EFalse);
-    TInt pos = FindEntry(list, entry.Key());
-    if (pos >= 0) {
-        exists = ETrue;
-    }
-    return exists;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Retrieves the bitmap/mask for the icon of the given app.
- * @param   appUid application uid
- * @param   bitmapArg bitmap ptr, ownership transferred to caller, or NULL
- * @param   maskArg   mask ptr, ownership transferred to caller, or NULL
- */
-void CTsDataList::GetAppIconL(const TUid& aAppUid, CFbsBitmap*& bitmapArg, CFbsBitmap*& maskArg)
-{
-    bitmapArg = maskArg = NULL;
-
-    TSize size(KAppIconWidth, KAppIconHeight);
-    CApaMaskedBitmap* apaMaskedBitmap = CApaMaskedBitmap::NewLC();
-    TInt err = mResources.ApaSession().GetAppIcon(aAppUid, size, *apaMaskedBitmap);
-    TInt iconsCount(0);
-    if (err == KErrNone) {
-        err = mResources.ApaSession().NumberOfOwnDefinedIcons(aAppUid, iconsCount);
-    }
-
-    if ((err == KErrNone) && (iconsCount > 0)) {
-        bitmapArg = static_cast<CFbsBitmap*> (apaMaskedBitmap);
-        TInt maskHandle = apaMaskedBitmap->Mask()->Handle();
-        maskArg = new (ELeave) CFbsBitmap;
-        maskArg->Duplicate(maskHandle);
-        CleanupStack::Pop(apaMaskedBitmap);
-    }
-    else {
-        CleanupStack::PopAndDestroy(apaMaskedBitmap);
-        HBufC* fileNameFromApparc = NULL;
-        TInt err = mResources.ApaSession().GetAppIcon(aAppUid, fileNameFromApparc);
-        if (err == KErrNone) {
-            CleanupStack::PushL(fileNameFromApparc);
-            CFbsBitmap *bitamp(0);
-            CFbsBitmap *mask(0);
-            TInt bitmapIndex = 0;
-            TInt maskIndex = 1;
-            // it will change bitmap ids if it is mif (checking inside)
-            AknIconUtils::ValidateLogicalAppIconId(*fileNameFromApparc, bitmapIndex, maskIndex);
-            AknIconUtils::CreateIconLC(bitamp, mask, fileNameFromApparc->Des(), bitmapIndex,
-                maskIndex);
-
-            if (AknIconUtils::IsMifFile(*fileNameFromApparc)) {
-                AknIconUtils::DisableCompression(bitamp);
-                AknIconUtils::SetSize(bitamp, TSize(KAppIconWidth, KAppIconHeight),
-                    EAspectRatioPreservedAndUnusedSpaceRemoved);
-                // bitmap and icon, AknsUtils::CreateIconLC doesn't specify the order
-                CleanupStack::Pop(2);
-                bitmapArg = bitamp;
-                maskArg = mask;
-            }
-            else {
-                CleanupStack::PopAndDestroy(2);
-            }
-            CleanupStack::PopAndDestroy(fileNameFromApparc);
-        }
-    }
-}
-
-// --------------------------------------------------------------------------
-/**
- * Checks if given uid is on hidden list
- * @param   aUid uid to be checked
- * @return  ETrue if uid is on hidden list
- */
-TBool CTsDataList::IsHiddenUid(TUid uid)
-{
-    return mHiddenUids.Find(uid) >= 0 ? ETrue : EFalse;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Finds entry in array
- * @param   list list to find
- * @param   key finding key
- * @return   position or KErrNotFound
- */
-TInt CTsDataList::FindEntry(const RTsFswArray& list, const TTsEntryKey& key) const
-{
-    TInt pos(KErrNotFound);
-    for (TInt entryIdx = 0; entryIdx < list.Count(); ++entryIdx) {
-        if (list[entryIdx]->Key() == key) {
-            pos = entryIdx;
-            break;
-        }
-    }
-    return pos;
-}
-// --------------------------------------------------------------------------
-/**
- * Set screenshot 
- */
-void CTsDataList::UpdateL(TInt key, const CFbsBitmap& data, TInt /*param*/, TInt priority)
-{
-    const TInt pos = FindEntry(mData, GenerateKeyL(key));
-    User::LeaveIfError(pos);
-    mData[pos]->SetScreenshotL(data, static_cast<UpdatePriority>(priority));
-}
-
-// --------------------------------------------------------------------------
-/**
- * Change visibility status 
- */
-void CTsDataList::UpdateL(TInt key, const Visibility& data, TInt /*param*/)
-{
-    const TInt pos = FindEntry(mData, GenerateKeyL(key));
-    User::LeaveIfError(pos);
-    data == mData[pos]->GetVisibility() ? User::Leave(KErrInUse) : 
-                                          mData[pos]->SetVisibility(data);
-    mObserver.DataChanged();
-}
-
-// --------------------------------------------------------------------------
-/**
- * Removes screenshot 
- */
-void CTsDataList::RemoveL(TInt key, TInt /*param*/)
-{
-    TInt pos = FindEntry(mData, GenerateKeyL(key));
-    User::LeaveIfError(pos);
-    mData[pos]->RemoveScreenshotL();
-}
-
-// --------------------------------------------------------------------------
-/**
- * Establish entry order accridung to aKeyList, all keys MUST be in iData
- * @param   keyList reference key list
- * @return   ETrue if changes occured
- */
-TBool CTsDataList::EstablishOrder(const RArray<TTsEntryKey>& keyList)
-{
-    TBool changed(EFalse);
-    __ASSERT_ALWAYS(mData.Count() == keyList.Count(), User::Panic(_L("EstablishOrder 1"), KErrBadHandle) );
-    for (TInt i = 0; i < keyList.Count(); i++) {
-        const TTsEntryKey& currentdataKey = mData[i]->Key();
-        const TTsEntryKey& referenceKey = keyList[i];
-        if (!(currentdataKey == referenceKey)) {
-            TInt foundPos = FindEntry(mData, referenceKey);
-            __ASSERT_ALWAYS(foundPos>=0, User::Panic(_L("EstablishOrder 2"), KErrBadHandle) );
-            CTsEntry* entry = mData[foundPos];
-            mData.Remove(foundPos);
-            mData.Insert(entry, i);
-            changed = ETrue;
-        }
-    }
-    return changed;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Gets allowed uids, tries to filter non GUI application 
- */
-TBool CTsDataList::VerifyApplicationL(TUid uid)
-{
-    TBool retVal(EFalse);
-    TApaAppInfo appInfo;
-    TApaAppCapabilityBuf appCap;
-
-    User::LeaveIfError(mResources.ApaSession().GetAllApps(0));
-    // for every application get uid, hidden and missing attribute
-    // and add to aArray.
-    while (KErrNone == mResources.ApaSession().GetNextApp(appInfo)) {
-        User::LeaveIfError(mResources.ApaSession().GetAppCapability(appCap, appInfo.iUid));
-        if(!appCap().iAppIsHidden) {
-            if (uid == appInfo.iUid) {
-                retVal = ETrue;
-                mAllowedUids.InsertL(appInfo.iUid, mAllowedUids.Count());
-            }
-        } else if(KErrNotFound == mHiddenUids.Find(appInfo.iUid)) {
-            mHiddenUids.InsertL(appInfo.iUid, mHiddenUids.Count());
-        }
-    }
-    if (EFalse == retVal && KErrNotFound == mHiddenUids.Find(uid)) {
-        mHiddenUids.InsertL(uid, mHiddenUids.Count());
-    }
-    return retVal;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Function generate task key using window group id
- * @param wgId - window group id of running application
- * @param entry key 
- */
-TTsEntryKey CTsDataList::GenerateKeyL(TInt wgId)
-{
-    RArray<RWsSession::TWindowGroupChainInfo> allWgIds;
-   CleanupClosePushL(allWgIds);
-   User::LeaveIfError(mResources.WsSession().WindowGroupList(0, &allWgIds));
-   const TTsEntryKey key(TsEntryKeyGeneraror::GenerateL(wgId, allWgIds.Array()));
-   CleanupStack::PopAndDestroy(&allWgIds);
-   return key;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Analyse and compress lookup table id needed
- * @param array - lookup table that has to be checked
- * 
- */
-void CTsDataList::CompressLookupTable(RArray<TUid> &array)
-{
-    while(KMaxLookupSize < array.Count()) {
-        array.Remove(0);
-    }
-}
-
-// --------------------------------------------------------------------------
-/**
- * Change priority of an item in the lookup table
- * @param array - look up table
- * @param offset - index of an item in the table
- */
-void CTsDataList::UpdateLookupTableL(RArray<TUid> &array, TInt offset)
-{
-    const TUid uid(array[offset]);
-    array.Remove(offset);
-    array.InsertL(uid, array.Count());
-}
-// end of file
--- a/tstaskmonitor/server/src/tsdatatask.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <fbs.h>
-#include "tsdatatask.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void TsDataTask::ExecuteL(MTsDataStorage& dataStorage, const RMessage2& msg)
-{
-    switch(msg.Function()) {
-    case RegisterScreenshotMessage:
-        TsDataTask::RegisterScreenshotL(dataStorage, msg);
-        break;
-    case UnregisterScreenshotMessage:
-        TsDataTask::UnregisterScreenshotL(dataStorage, msg);
-        break;
-    case VisibilityChange:
-        VisibilityChangeL(dataStorage, msg);
-        break;
-    }
-    
-    msg.Complete(KErrNone);
-}
-
-void TsDataTask::RegisterScreenshotL(MTsDataStorage& dataStorage, 
-                                           const RMessage2& msg)
-{
-    TPckgBuf<TInt> wgId, fbsHdl, param, priority;
-    
-    msg.ReadL(WindowsGroup, wgId);
-    msg.ReadL(ScreenshotHandle, fbsHdl);
-    msg.ReadL(AdditionalParameters, param);
-    msg.Read(Priority, priority);
-    
-    //convert and provide data
-    CFbsBitmap* bitmap = new(ELeave) CFbsBitmap();
-    CleanupStack::PushL(bitmap);
-    User::LeaveIfError(bitmap->Duplicate(fbsHdl()));
-    dataStorage.UpdateL(wgId(), *bitmap, param(), priority());
-    CleanupStack::PopAndDestroy(bitmap);
-}
-    
-void TsDataTask::UnregisterScreenshotL(MTsDataStorage& dataStorage, 
-                                       const RMessage2& msg)
-{
-    TPckgBuf<TInt> wgId, param;
-    
-    msg.ReadL(WindowsGroup, wgId);
-    msg.ReadL(AdditionalParameters, param);
-    
-    dataStorage.RemoveL(wgId(), param());
-}
-
-void TsDataTask::VisibilityChangeL(MTsDataStorage& dataStorage, 
-                                   const RMessage2& msg)
-{
-    TPckgBuf<TInt> wgId, visibility, param;
-    
-    msg.ReadL(0, wgId);
-    msg.ReadL(1, visibility);
-    
-    dataStorage.UpdateL(wgId(), static_cast<Visibility>(visibility()), 0);
-}
--- a/tstaskmonitor/server/src/tsrunningappstorage.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "tsrunningappstorage.h"
-#include "tsdatalist.h"
-#include "tsentry.h"
-#include <s32strm.h>
-#include <s32mem.h>
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppStorage::CRunningAppStorage(MHsDataObserver& observer)
-: mObserver(observer)
-{
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppStorage::~CRunningAppStorage()
-{
-    mData.Close();
-    delete mEngine;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CRunningAppStorage* CRunningAppStorage::NewL(MHsDataObserver& observer,
-                                             MTsResourceManager& resources,
-                                             MTsWindowGroupsMonitor &wsMonitor)
-{
-    CRunningAppStorage * self = new (ELeave)CRunningAppStorage(observer);
-    CleanupStack::PushL(self);
-    self->ConstructL(resources, wsMonitor);
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppStorage::ConstructL(MTsResourceManager& resources, 
-                                    MTsWindowGroupsMonitor &wsMonitor)
-{
-    mEngine = CTsDataList::NewL(resources, wsMonitor, *this) ;
-    RArray<RWsSession::TWindowGroupChainInfo> wgList;
-    CleanupClosePushL(wgList);
-    User::LeaveIfError(resources.WsSession().WindowGroupList(&wgList));
-    mEngine->HandleWindowGroupChanged(resources, wgList.Array());
-    CleanupStack::PopAndDestroy(&wgList);
-    DataChangedL();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-const TDesC8& CRunningAppStorage::Data() const
-{
-    return mData;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppStorage::DataChanged() 
-{
-    TRAPD( err, DataChangedL() );
-    if ( err == KErrNone)
-    {
-        mObserver.DataChanged();
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppStorage::DataChangedL()
-{
-    const TInt KExpandSize = 256; // "Granularity" of dynamic buffer
-    CBufFlat* buf = CBufFlat::NewL(KExpandSize);
-    CleanupStack::PushL(buf);
-    RBufWriteStream stream(*buf); 
-    CleanupClosePushL(stream);
-    CTsEntry::ExternalizeArrayL(stream, mEngine->Data());
-    CleanupStack::PopAndDestroy(&stream);
-    mData.Close();
-    mData.CreateL( buf->Size() );
-    buf->Read(0, mData, buf->Size());
-    CleanupStack::PopAndDestroy(buf);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppStorage::UpdateL(TInt key, const CFbsBitmap& data, TInt param, TInt priority)
-{
-    mEngine->UpdateL(key, data, param, priority);
-    
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppStorage::UpdateL(TInt key, const Visibility& data, TInt param)
-{
-    mEngine->UpdateL(key, data, param);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CRunningAppStorage::RemoveL(TInt key, TInt param)
-{
-    mEngine->RemoveL(key, param);
-}
--- a/tstaskmonitor/server/src/tsscreenshotprovider.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include "tsscreenshotprovider.h"
-#include "tstaskmonitorglobals.h"
-#include <s32mem.h>
-
-const TUid KPluginUID = {0x200267AE};
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CTsScreenshotProvider* CTsScreenshotProvider::NewL(MTsDataStorage& storage)
-{
-    CTsScreenshotProvider *self = new (ELeave)CTsScreenshotProvider(storage);
-    CleanupStack::PushL(self);
-    self->BaseConstructL(KPluginUID, KNullDesC8);
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-CTsScreenshotProvider::CTsScreenshotProvider(MTsDataStorage& storage)
-:
-mStorage(storage)
-{}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotProvider::HandleMessage(const TDesC8& msg)
-{
-    TRAP_IGNORE(HandleMessageL(msg));
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotProvider::HandleMessageL(const TDesC8& msg)
-{
-    const TInt KMsgSize(5); 
-    TInt parsedMsg[KMsgSize];
-    
-    RDesReadStream msgStream(msg);
-    for (TInt iter(0); iter < KMsgSize; ++iter) {
-        parsedMsg[iter] = msgStream.ReadInt32L();
-    }
-    
-    if (RegisterScreenshotMessage == parsedMsg[0]) {
-        CFbsBitmap *bitmap = new CFbsBitmap;
-        TInt errNo(KErrNoMemory);
-        if (0 != bitmap) {
-            CleanupStack::PushL(bitmap);
-            errNo = bitmap->Duplicate(parsedMsg[ScreenshotHandle + 1]);
-        }
-        const TPckgC<TInt[sizeof(parsedMsg) / sizeof(TInt)]> buf(parsedMsg);//ACK bitmap duplication
-        SendMessage(msg);
-        User::LeaveIfError(errNo);
-        
-        mStorage.UpdateL(parsedMsg[WindowsGroup +1 ], 
-                         *bitmap, 
-                         parsedMsg[AdditionalParameters + 1], 
-                         parsedMsg[Priority + 1]);
-       
-        CleanupStack::PopAndDestroy(bitmap);
-    }
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void CTsScreenshotProvider::OnReplace()
-{
-    //no implementation required
-}
--- a/tstaskmonitor/sis/stubs/createstubs.bat	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-@rem
-@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-@rem All rights reserved.
-@rem This component and the accompanying materials are made available
-@rem under the terms of "Eclipse Public License v1.0"
-@rem which accompanies this distribution, and is available
-@rem at the URL "http://www.eclipse.org/legal/epl-v10.html".
-@rem
-@rem Initial Contributors:
-@rem Nokia Corporation - initial contribution.
-@rem
-@rem Contributors:
-@rem
-@rem Description: 
-@rem
-
-for %%f in (*.pkg) do makesis -s %%f
--- a/tstaskmonitor/sis/stubs/taskmonitor_stub.pkg	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 
-;
-; ------------------------------------------------------------------------------
-; Taskswitcher stub SIS package file.
-; Used to enable Taskswitcher to be updated from ROM with a SIS package.
-; When you add new files into this stub, please remember to update
-; SIS stub with "makesis -s" command.
-; ------------------------------------------------------------------------------
-;
-;Language - standard language definitions
-&EN
-
-; standard SIS file header
-#{"taskmonitor"},(0x200267B0),1,0,0,TYPE=SA
-
-;Localized Vendor Name
-%{"Nokia"}
-
-;Unique Vendor name
-:"Nokia"
-
-"" - "Z:\sys\bin\tstaskmonitorclient.dll"
-"" - "Z:\sys\bin\hsrunningappmonitor.exe"
-"" - "Z:\sys\bin\tsscreenshotplugin.dll"
-"" - "Z:\resource\plugins\tsscreenshotplugin.rsc"
-"" - "Z:\sys\bin\tsbackstepping.dll"
\ No newline at end of file
Binary file tstaskmonitor/sis/stubs/taskmonitor_stub.sis has changed
--- a/tstaskmonitor/sis/taskmonitor.pkg	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-;
-; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-; All rights reserved.
-; This component and the accompanying materials are made available
-; under the terms of "Eclipse Public License v1.0"
-; which accompanies this distribution, and is available
-; at the URL "http://www.eclipse.org/legal/epl-v10.html".
-;
-; Initial Contributors:
-; Nokia Corporation - initial contribution.
-;
-; Contributors:
-;
-; Description: 
-;
-
-;Language - standard language definitions
-&EN
-
-; standard SIS file header
-#{"taskmonitor"},(0x200267B0),1,0,0,TYPE=SA, RU
-
-;Localized Vendor Name
-%{"Nokia"}
-
-;Unique Vendor name
-:"Nokia"
-
-
-"/epoc32/release/armv5/urel/hsrunningappmonitor.exe" - "!:\sys\bin\hsrunningappmonitor.exe"
-"/epoc32/release/armv5/urel/tstaskmonitorclient.dll"-"!:\sys\bin\tstaskmonitorclient.dll"
-"/epoc32/release/armv5/urel/tsscreenshotplugin.dll"-"!:\sys\bin\tsscreenshotplugin.dll"
-"/epoc32/data/z/resource/plugins/tsscreenshotplugin.rsc"-"!:\resource\plugins\tsscreenshotplugin.rsc"
-"/epoc32/release/armv5/urel/tsbackstepping.dll"-"!:\sys\bin\tsbackstepping.dll"
--- a/tstaskmonitor/tstaskmonitor.pro	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies 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
-
-CONFIG += ordered
-SUBDIRS += client
-symbian {
-    SUBDIRS += backstepping \
-               server \
-               screenshotplugin
-               
-    BLD_INF_RULES.prj_exports +=    "inc\tstaskmonitorglobals.h"
-    
-}
-
-symbian:include(rom.pri)
\ No newline at end of file
--- a/tstaskmonitor/utils/inc/tsdataobserver.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#ifndef DATAOBSERVER_H
-#define DATAOBSERVER_H
-
-#include <e32base.h>
-
-class MHsDataObserver {
-public:
-    virtual void DataChanged() =0;
-};
-
-class CHsDataObserver: public CBase,
-                       public MHsDataObserver
-{
-public:
-    virtual void Cancel(const RMessage2& reason) =0;
-};
-
-class MHsDataObserverStorage
-{
-public:
-    virtual void PushL(CHsDataObserver*) =0;
-    virtual void Pop(CHsDataObserver*) =0;
-    virtual void Cancel(const RMessage2& reason) =0;
-};
-
-#endif //DATAOBSERVER_H
--- a/tstaskmonitor/utils/inc/tsentry.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Task list entry
- *
-*/
-
-
-#ifndef TSENTRY_H
-#define TSENTRY_H
-
-#include <e32base.h>
-#include <e32cmn.h>
-#include <tsgraphicfilescalinghandler.h>
-
-#include "tsentrykey.h"
-#include "tstaskmonitorglobals.h"
-
-class CTsEntry;
-class RReadStream;
-class RWriteStream;
-class CFbsBitmap;
-class MHsDataObserver;
-
-typedef RPointerArray<CTsEntry> RTsFswArray;
-
-enum TAppType
-{
-    EApp = 0,
-    EWidget,
-    EJava
-};
-
-/**
- * An entry in the task list.
- */
-NONSHARABLE_CLASS( CTsEntry ) : public CBase,
-                                private MImageReadyCallBack
-    {
-public:
-    static CTsEntry* NewL();
-
-    static CTsEntry* NewLC();
-
-    static CTsEntry* NewL(const TTsEntryKey& key, MHsDataObserver* observer =0);
-
-    static CTsEntry* NewLC(const TTsEntryKey& key, MHsDataObserver* observer =0);
-
-    ~CTsEntry();
-
-    TUid AppUid() const;
-
-    TAppType Type() const;
-
-    const TDesC& AppName() const;
-
-    TBool CloseableApp() const;
-
-    Visibility GetVisibility() const;
-    
-    void SetVisibility(Visibility visibility);
-
-    CFbsBitmap* AppIconBitmap() const;
-
-    CFbsBitmap* AppIconMask() const;
-
-    CFbsBitmap* Screenshot() const;
-
-    UpdatePriority Priority() const;
-
-    const TTsEntryKey& Key() const;
-
-    void SetAppUid( const TUid& uid );
-
-    void SetAppNameL( const TDesC& appName );
-
-    void SetCloseableApp( TBool value );
-
-    void SetScreenshotL(const CFbsBitmap& bitmap, UpdatePriority priority);
-
-    void RemoveScreenshotL();
-
-    void SetAppIcon( CFbsBitmap* aBitmap, CFbsBitmap* aMask );
-
-    void ExternalizeL( RWriteStream& aStream ) const;
-
-    void InternalizeL( RReadStream& aStream );
-
-    static void ExternalizeArrayL( RWriteStream& stream,
-        const RTsFswArray& array );
-
-    static void InternalizeArrayL( RReadStream& stream,
-        RTsFswArray& array );
-
-private:
-    CTsEntry();
-
-    CTsEntry(const TTsEntryKey& aKey, MHsDataObserver* observer);
-
-    void ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap );
-
-private:
-    TUid mAppUid;
-    HBufC* mAppName;
-    TBool mCloseableApp;
-    Visibility mVisibility;
-    CFbsBitmap* mAppIconBitmap;
-    CFbsBitmap* mAppIconMask;
-    CFbsBitmap* mScreenshot;
-    TTsEntryKey mKey;
-    UpdatePriority mPriority;
-    MHsDataObserver* mObserver;
-    CTsGraphicFileScalingHandler* mImgTool;
-    };
-
-#endif
--- a/tstaskmonitor/utils/inc/tsentrykey.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Task list entry
- *
-*/
-
-
-#ifndef TSENTRYKEY_H
-#define TSENTRYKEY_H
-
-#include <e32base.h>
-class RReadStream;
-class RWriteStream;
-
-class TTsEntryKey
-{
-public:
-    TTsEntryKey(TInt parentId =0);
-    TBool operator ==(const TTsEntryKey& key) const;
-    void ExternalizeL(RWriteStream& output) const;
-    void InternalizeL(RReadStream& input);
-    TInt WindowGroupId() const;
-
-private:
-    TInt mParentId;
-};
-
-#endif //TSENTRYKEY_H
--- a/tstaskmonitor/utils/inc/tsentrykeygenerator.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Task list entry
- *
-*/
-
-
-#ifndef TSENTRYKEYGENERATOR_H
-#define TSENTRYKEYGENERATOR_H
-
-#include <e32base.h>
-#include <e32cmn.h>
-#include <w32std.h>
-
-#include "tsentrykey.h"
-
-
-class TsEntryKeyGeneraror
-{
-public:
-    static TTsEntryKey GenerateL(TInt windowGroupId, 
-                                 const TArray<RWsSession::TWindowGroupChainInfo>& groupChain);
-};
-
-#endif //TSENTRYKEYGENERATOR_H
--- a/tstaskmonitor/utils/inc/tsutils.h	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-namespace TaskSwitcher {
-    template <class T>
-    void RPointerArrayCleanupMethod(TAny *aPtr)
-    {
-        static_cast< RPointerArray<T>* >(aPtr)->ResetAndDestroy();
-    }
-
-    template <class T>
-    void CleanupResetAndDestroyPushL(RPointerArray<T> &array) {
-        CleanupStack::PushL(TCleanupItem(&RPointerArrayCleanupMethod<T>, &array));            
-    }
-}
\ No newline at end of file
--- a/tstaskmonitor/utils/src/tsentry.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,409 +0,0 @@
-/*
- * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  Task list entry
- *
- */
-
-#define __E32SVR_H__
-#include <s32strm.h>
-#include <fbs.h>
-#include "tsentry.h"
-#include "tsdataobserver.h"
-
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::NewL
-// --------------------------------------------------------------------------
-//
-CTsEntry* CTsEntry::NewL()
-{
-    CTsEntry* self = NewLC();
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::NewLC
-// --------------------------------------------------------------------------
-//
-CTsEntry* CTsEntry::NewLC()
-{
-    CTsEntry* self = new (ELeave) CTsEntry;
-    CleanupStack::PushL(self);
-    return self;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::NewL
-// --------------------------------------------------------------------------
-//
-CTsEntry* CTsEntry::NewL(const TTsEntryKey& key, MHsDataObserver *observer)
-{
-    CTsEntry* self = NewLC(key, observer);
-    CleanupStack::Pop(self);
-    return self;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::NewLC
-// --------------------------------------------------------------------------
-//
-CTsEntry* CTsEntry::NewLC(const TTsEntryKey& key, MHsDataObserver* observer)
-{
-    CTsEntry* self = new (ELeave) CTsEntry(key, observer);
-    CleanupStack::PushL(self);
-    return self;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::~CTsFswEntry
-// --------------------------------------------------------------------------
-//
-CTsEntry::~CTsEntry()
-{
-    delete mAppName;
-    delete mAppIconBitmap;
-    delete mAppIconMask;
-    delete mScreenshot;
-    delete mImgTool;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::CTsFswEntry
-// --------------------------------------------------------------------------
-//
-CTsEntry::CTsEntry() :
-    mVisibility(Visible),
-    mPriority(Low)
-{
-    mKey = TTsEntryKey();
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::CTsFswEntry
-// --------------------------------------------------------------------------
-//
-CTsEntry::CTsEntry(const TTsEntryKey& key, MHsDataObserver *observer) 
-:
-    mVisibility(Visible),
-    mKey(key), 
-    mPriority(Low), 
-    mObserver(observer)
-{
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::SetAppUid
-// --------------------------------------------------------------------------
-//
-void CTsEntry::SetAppUid(const TUid& uid)
-{
-    mAppUid = uid;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::SetAppNameL
-// --------------------------------------------------------------------------
-//
-void CTsEntry::SetAppNameL(const TDesC& appName)
-{
-    delete mAppName;
-    mAppName = 0;
-    mAppName = appName.AllocL();
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::SetSystemApp
-// --------------------------------------------------------------------------
-//
-void CTsEntry::SetCloseableApp(TBool value)
-{
-    mCloseableApp = value;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::SetAppIconHandles
-// --------------------------------------------------------------------------
-//
-void CTsEntry::SetAppIcon(CFbsBitmap* bitmap, CFbsBitmap* mask)
-{
-    mAppIconBitmap = bitmap;
-    mAppIconMask = mask;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Application uid.
- */
-TUid CTsEntry::AppUid() const
-{
-    return mAppUid;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Application name.
- */
-const TDesC& CTsEntry::AppName() const
-{
-    return mAppName ? *mAppName : KNullDesC();
-}
-
-// --------------------------------------------------------------------------
-/**
- * Retrieve entry visibilit status
- */
-Visibility CTsEntry::GetVisibility() const
-{
-    return mVisibility;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Change entry visibility status
- * @param visibility - new visibility status
- */
-void CTsEntry::SetVisibility(Visibility visibility)
-{
-    mVisibility = visibility;
-}
-
-// --------------------------------------------------------------------------
-/**
- * ETrue if the application is closeable
- */
-TBool CTsEntry::CloseableApp() const
-{
-    return mCloseableApp;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Application icon bitmap
- */
-CFbsBitmap* CTsEntry::AppIconBitmap() const
-{
-    return mAppIconBitmap;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Application icon mask.
- */
-CFbsBitmap* CTsEntry::AppIconMask() const
-{
-    return mAppIconMask;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Entry's key
- */
-const TTsEntryKey& CTsEntry::Key() const
-{
-    return mKey;
-}
-// --------------------------------------------------------------------------
-// CTsFswEntry::ExternalizeL
-// --------------------------------------------------------------------------
-//
-void CTsEntry::ExternalizeL(RWriteStream& stream) const
-{
-    stream.WriteInt32L(mAppUid.iUid);
-    stream << AppName();
-    stream.WriteInt32L(mCloseableApp);
-    if (mAppIconBitmap) {
-        stream.WriteInt32L(mAppIconBitmap->Handle());
-    }
-    else {
-        stream.WriteInt32L(KErrNotFound);
-    }
-
-    if (mAppIconMask) {
-        stream.WriteInt32L(mAppIconMask->Handle());
-    }
-    else {
-        stream.WriteInt32L(KErrNotFound);
-    }
-
-    if (mScreenshot) {
-        stream.WriteInt32L(mScreenshot->Handle());
-    }
-    else {
-        stream.WriteInt32L(KErrNotFound);
-    }
-
-    mKey.ExternalizeL(stream);
-    TInt currentPriority = static_cast<TInt> (mPriority);
-    stream.WriteInt32L(currentPriority);
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::InternalizeL
-// --------------------------------------------------------------------------
-//
-void CTsEntry::InternalizeL(RReadStream& stream)
-{
-    
-    mAppUid = TUid::Uid(stream.ReadInt32L());
-    delete mAppName;
-    mAppName = NULL;
-    mAppName = HBufC::NewL(stream, KMaxTInt);
-    mCloseableApp = stream.ReadInt32L();
-    TInt appIconBitmapHandle = stream.ReadInt32L();
-    TInt appIconMaskHandle = stream.ReadInt32L();
-    TInt screenshotHandle = stream.ReadInt32L();
-    if (appIconBitmapHandle != KErrNotFound) {
-        mAppIconBitmap = new (ELeave) CFbsBitmap;
-        mAppIconBitmap->Duplicate(appIconBitmapHandle);
-    }
-    if (appIconMaskHandle != KErrNotFound) {
-        mAppIconMask = new (ELeave) CFbsBitmap;
-        mAppIconMask->Duplicate(appIconMaskHandle);
-    }
-    if (screenshotHandle != KErrNotFound) {
-        mScreenshot = new (ELeave) CFbsBitmap;
-        mScreenshot->Duplicate(screenshotHandle);
-    }
-    mKey.InternalizeL(stream);
-    TInt currentPriority = stream.ReadInt32L();
-    mPriority = static_cast<UpdatePriority> (currentPriority);
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::ExternalizeArrayL
-// --------------------------------------------------------------------------
-//
-void CTsEntry::ExternalizeArrayL(RWriteStream& stream, const RTsFswArray& array)
-{
-    TInt iter(0);
-    RArray<TInt> visibleItems(array.Count() ? array.Count() : 1);
-    CleanupClosePushL(visibleItems);
-    for (iter = 0; iter < array.Count(); ++iter) {
-        if (Visible == array[iter]->GetVisibility()) {
-            visibleItems.AppendL(iter);
-        }
-    }
-    stream.WriteInt32L(visibleItems.Count());
-    for (iter = 0; iter < visibleItems.Count(); ++iter) {
-        array[visibleItems[iter]]->ExternalizeL(stream);
-    }
-    CleanupStack::PopAndDestroy(&visibleItems);
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::InternalizeArrayL
-// --------------------------------------------------------------------------
-//
-void CTsEntry::InternalizeArrayL(RReadStream& stream, RTsFswArray& array)
-{
-    array.ResetAndDestroy();
-    TInt count = stream.ReadInt32L();
-    for (TInt i = 0; i < count; ++i) {
-        CTsEntry* entry = CTsEntry::NewLC();
-        entry->InternalizeL(stream);
-        array.AppendL(entry);
-        CleanupStack::Pop(entry);
-    }
-}
-
-// --------------------------------------------------------------------------
-/**
- * Application type.
- */
-TAppType CTsEntry::Type() const
-{
-    return EApp;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::SetScreenshot
-// --------------------------------------------------------------------------
-//
-void CTsEntry::SetScreenshotL(const CFbsBitmap& bitmapArg, UpdatePriority priority)
-{
-    TInt currentPriority = static_cast<TInt> (mPriority);
-    TInt newPriority = static_cast<TInt> (priority);
-    if(newPriority <currentPriority) {
-        User::Leave(KErrAccessDenied);
-    }
-    
-    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
-    CleanupStack::PushL(bitmap);
-    User::LeaveIfError(bitmap->Duplicate(bitmapArg.Handle()));
-    CleanupStack::Pop(bitmap);
-
-    mPriority = priority;
-    delete mScreenshot;
-    mScreenshot = bitmap;
-
-    delete mImgTool;
-    mImgTool = 0;
-
-    mImgTool = CTsGraphicFileScalingHandler::NewL(*this, *mScreenshot, TSize(128, 128),
-    CTsGraphicFileScalingHandler::EKeepAspectRatioByExpanding);
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::RemoveScreenshot
-// --------------------------------------------------------------------------
-//
-void CTsEntry::RemoveScreenshotL()
-{
-    if (!mScreenshot) {
-        User::Leave(KErrNotFound);
-    }
-    delete mScreenshot;
-    mScreenshot = NULL;
-    mPriority = Low;
-    if (mObserver) {
-        mObserver->DataChanged();
-    }
-}
-
-// --------------------------------------------------------------------------
-/**
- * Application screenshot.
- */
-CFbsBitmap* CTsEntry::Screenshot() const
-{
-    return mScreenshot;
-}
-
-// --------------------------------------------------------------------------
-/**
- * Priority.
- */
-UpdatePriority CTsEntry::Priority() const
-{
-    return mPriority;
-}
-
-// --------------------------------------------------------------------------
-// CTsFswEntry::Priority
-// --------------------------------------------------------------------------
-//
-void CTsEntry::ImageReadyCallBack(TInt error, const CFbsBitmap *bitmap)
-{
-    if (KErrNone == error && 0 != bitmap) {
-        mScreenshot->Reset();
-        mScreenshot->Duplicate(bitmap->Handle());
-
-        if (mObserver) {
-            mObserver->DataChanged();
-        }
-    }
-}
-
-// end of file
--- a/tstaskmonitor/utils/src/tsentrykey.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Task list entry
- *
-*/
-
-
-#include "tsentrykey.h"
-#include <s32strm.h>
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TTsEntryKey::TTsEntryKey(TInt parentId)
-:
-    mParentId(parentId)
-{}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TBool TTsEntryKey::operator ==(const TTsEntryKey& key) const
-{
-    return (mParentId == key.mParentId);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void TTsEntryKey::ExternalizeL(RWriteStream& output) const
-{
-    output.WriteInt32L(mParentId);
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-void TTsEntryKey::InternalizeL(RReadStream& input)
-{
-    mParentId = input.ReadInt32L();
-}
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TInt TTsEntryKey::WindowGroupId() const
-{
-    return mParentId;
-}
--- a/tstaskmonitor/utils/src/tsentrykeygenerator.cpp	Tue Jul 06 14:37:10 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Task list entry
- *
-*/
-#include "tsentrykeygenerator.h"
-
-// -----------------------------------------------------------------------------
-//
-// -----------------------------------------------------------------------------
-//
-TTsEntryKey TsEntryKeyGeneraror::GenerateL(TInt windowGroupId, 
-                                           const TArray<RWsSession::TWindowGroupChainInfo>& groupChain) 
-{
-    for (TInt iter(0); iter < groupChain.Count(); ++iter) {
-        if (groupChain[iter].iId == windowGroupId) {
-            return 0 >= groupChain[iter].iParentId ?
-                   TTsEntryKey(windowGroupId) :
-                   TsEntryKeyGeneraror::GenerateL(groupChain[iter].iParentId, groupChain);
-        }
-    }
-    User::Leave(KErrNotFound);
-    // for avoid compile error
-    return TTsEntryKey(); 
-}
-