Revision: 201023
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 23 Jun 2010 18:03:36 +0300
changeset 60 30f14686fb04
parent 55 03646e8da489
child 61 2b1b11a301d2
Revision: 201023 Kit: 2010125
homescreenapp/examples/helloworldwidgetplugin/src/helloworldwidgetplugin.cpp
homescreenapp/hsapplication/conf/base/confml/homescreendb.confml
homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/create.sql
homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/fill.sql
homescreenapp/hsapplication/conf/buildhomescreendb.bat
homescreenapp/hsapplication/inc/hshomescreenclientserviceprovider.h
homescreenapp/hsapplication/installs_symbian.pri
homescreenapp/hsapplication/installs_win.pri
homescreenapp/hsapplication/ipc_service_conf.xml
homescreenapp/hsapplication/resource_s60/d_landscape.png
homescreenapp/hsapplication/resource_s60/d_portrait.png
homescreenapp/hsapplication/resource_s60/homescreen.db
homescreenapp/hsapplication/resource_s60/page/1_landscape.png
homescreenapp/hsapplication/resource_s60/page/1_portrait.png
homescreenapp/hsapplication/resource_s60/page/2_landscape.png
homescreenapp/hsapplication/resource_s60/page/2_portrait.png
homescreenapp/hsapplication/resource_s60/page/3_landscape.png
homescreenapp/hsapplication/resource_s60/page/3_portrait.png
homescreenapp/hsapplication/resource_s60/page/default_landscape.png
homescreenapp/hsapplication/resource_s60/page/default_portrait.png
homescreenapp/hsapplication/resource_s60/scene/default_landscape.png
homescreenapp/hsapplication/resource_s60/scene/default_portrait.png
homescreenapp/hsapplication/resource_win/d_landscape.png
homescreenapp/hsapplication/resource_win/d_portrait.png
homescreenapp/hsapplication/resource_win/homescreen.db
homescreenapp/hsapplication/resource_win/page/1_landscape.png
homescreenapp/hsapplication/resource_win/page/1_portrait.png
homescreenapp/hsapplication/resource_win/page/2_landscape.png
homescreenapp/hsapplication/resource_win/page/2_portrait.png
homescreenapp/hsapplication/resource_win/page/3_landscape.png
homescreenapp/hsapplication/resource_win/page/3_portrait.png
homescreenapp/hsapplication/resource_win/page/default_landscape.png
homescreenapp/hsapplication/resource_win/page/default_portrait.png
homescreenapp/hsapplication/resource_win/scene/default_landscape.png
homescreenapp/hsapplication/resource_win/scene/default_portrait.png
homescreenapp/hsapplication/src/hshomescreenclientserviceprovider.cpp
homescreenapp/hsapplication/src/main.cpp
homescreenapp/hsdomainmodel/hsdomainmodel.pri
homescreenapp/hsdomainmodel/inc/hsbackuprestoreactivecallback.h
homescreenapp/hsdomainmodel/inc/hsbackuprestoreobserver.h
homescreenapp/hsdomainmodel/inc/hsconfiguration.h
homescreenapp/hsdomainmodel/inc/hscontentservice.h
homescreenapp/hsdomainmodel/inc/hsdatabase.h
homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h
homescreenapp/hsdomainmodel/inc/hspage.h
homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h
homescreenapp/hsdomainmodel/inc/hsscene.h
homescreenapp/hsdomainmodel/inc/hsshortcutservice.h
homescreenapp/hsdomainmodel/inc/hswallpaper.h
homescreenapp/hsdomainmodel/inc/hswallpaperloader.h
homescreenapp/hsdomainmodel/inc/hswallpaperloaderthread.h
homescreenapp/hsdomainmodel/inc/hswidgetcomponent.h
homescreenapp/hsdomainmodel/inc/hswidgetcomponentregistry.h
homescreenapp/hsdomainmodel/inc/hswidgethost.h
homescreenapp/hsdomainmodel/src/hsbackuprestoreactivecallback.cpp
homescreenapp/hsdomainmodel/src/hsbackuprestoreobserver.cpp
homescreenapp/hsdomainmodel/src/hsconfiguration.cpp
homescreenapp/hsdomainmodel/src/hscontentservice.cpp
homescreenapp/hsdomainmodel/src/hsdatabase.cpp
homescreenapp/hsdomainmodel/src/hsgui.cpp
homescreenapp/hsdomainmodel/src/hspage.cpp
homescreenapp/hsdomainmodel/src/hspagenewwidgetlayout.cpp
homescreenapp/hsdomainmodel/src/hsscene.cpp
homescreenapp/hsdomainmodel/src/hsshortcutservice.cpp
homescreenapp/hsdomainmodel/src/hswallpaper.cpp
homescreenapp/hsdomainmodel/src/hswallpaperloader.cpp
homescreenapp/hsdomainmodel/src/hswallpaperloaderthread.cpp
homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp
homescreenapp/hsdomainmodel/src/hswidgethost.cpp
homescreenapp/hshomescreenclientplugin/src/hshomescreenclient.cpp
homescreenapp/hsmenuclientplugin/inc/hsmenuclient.h
homescreenapp/hsmenuclientplugin/src/hsmenuclient.cpp
homescreenapp/hsutils/inc/hsspinnerdialog.h
homescreenapp/hsutils/inc/hswallpaperhelper.h
homescreenapp/hsutils/inc/hswallpaperimagereader.h
homescreenapp/hsutils/inc/xqaiwcommon.h
homescreenapp/hsutils/inc/xqaiwgetimageclient.h
homescreenapp/hsutils/src/hsdeviceinfolistener.cpp
homescreenapp/hsutils/src/hsimagefetcherclient.cpp
homescreenapp/hsutils/src/hspageindicator.cpp
homescreenapp/hsutils/src/hspageindicatoritem.cpp
homescreenapp/hsutils/src/hsspinnerdialog.cpp
homescreenapp/hsutils/src/hstitleresolver.cpp
homescreenapp/hsutils/src/hswallpaperhelper.cpp
homescreenapp/hsutils/src/hswallpaperimagereader.cpp
homescreenapp/hsutils/src/hswidgetpositioningonorientationchange.cpp
homescreenapp/hsutils/src/hswidgetpositioningonwidgetadd.cpp
homescreenapp/hsutils/src/xqaiwgetimageclient.cpp
homescreenapp/hswidgetuninstaller/hswidgetuninstaller.pro
homescreenapp/hswidgetuninstaller/src/hswidgetinstallersender.cpp
homescreenapp/inc/hsapp_defs.h
homescreenapp/inc/hsapp_defs.inl
homescreenapp/rom/homescreenapp_core.iby
homescreenapp/runtimeplugins/hsdefaultruntimeplugin/inc/hsdefaultruntime.h
homescreenapp/runtimeplugins/hsdefaultruntimeplugin/src/hsdefaultruntime.cpp
homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro
homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp
homescreenapp/sis/homescreenapp_ut_hs.pkg
homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc
homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h
homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h
homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml
homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.css
homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.widgetml
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp
homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h
homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlewidget.h
homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsselectbackgroundstate.h
homescreenapp/stateplugins/hshomescreenstateplugin/inc/hswallpaperselectionstate.h
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsbackuprestorestate.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsdocumentloader.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlewidget.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/src/hsselectbackgroundstate.cpp
homescreenapp/stateplugins/hshomescreenstateplugin/src/hswallpaperselectionstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.qrc
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsmenubasestate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsmenustates_global.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h
homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml
homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsuninstalldialog.docml
homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hswidgetpreviewdialog.docml
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionslistdialog.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenubasestate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp
homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp
homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsanalogclockwidget.cpp
homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp
taskswitcherapp/taskswitcherapp.pro
taskswitcherapp/tsdevicedialogplugin/inc/tsdevicedialog.h
taskswitcherapp/tsdevicedialogplugin/inc/tsdevicedialogcontainer.h
taskswitcherapp/tsdevicedialogplugin/inc/tsdevicedialogplugin.h
taskswitcherapp/tsdevicedialogplugin/inc/tstasksgriditem.h
taskswitcherapp/tsdevicedialogplugin/resource/delete.png
taskswitcherapp/tsdevicedialogplugin/resource/layout.docml
taskswitcherapp/tsdevicedialogplugin/resource/tstasksgriditem.css
taskswitcherapp/tsdevicedialogplugin/resource/tstasksgriditem.widgetml
taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialog.cpp
taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialogcontainer.cpp
taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp
taskswitcherapp/tsdevicedialogplugin/src/tsdocumentloader.cpp
taskswitcherapp/tsdevicedialogplugin/src/tsmodel.cpp
taskswitcherapp/tsdevicedialogplugin/src/tstasksgriditem.cpp
taskswitcherapp/tsdevicedialogplugin/tsdevicedialogplugin.pro
taskswitcherapp/tsdevicedialogplugin/tsdevicedialogplugin.qrc
--- a/homescreenapp/examples/helloworldwidgetplugin/src/helloworldwidgetplugin.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/examples/helloworldwidgetplugin/src/helloworldwidgetplugin.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -22,8 +22,8 @@
 #include "helloworldwidgetplugin.h"
 #include "helloworldwidget.h"
 
-/**
-    @page page_creating_widget_plugin Creating Home Screen Widget Plugin
+/*!
+    @page page_creatingwidgetplugin Creating Home Screen Widget Plugin
 
     Widgets are exposed to the home screen through QT Service Framework.
     Widget plugins are implemented according to
@@ -73,8 +73,8 @@
     @endcode
 */
 
-/**
-    @page page_deploying_widget_plugin Deploying Home Screen Widget Plugin
+/*!
+    @page page_deployingwidgetplugin Deploying Home Screen Widget Plugin
     
     Widget's binaries and xml file(s) must be deployed to correct folders on emulator and in target. 
     Below are the needed .pro file for the \c helloworldwidgetplugin.
@@ -90,12 +90,12 @@
     
     HEADERS += ./inc/ .h
     SOURCES += ./src/ .cpp
-  
-    DESTDIR = $${EPOCROOT}epoc32/data/c/private/20022F35/import/widgetregistry/20022F7E
     
     INCLUDEPATH += ./inc               
     
     symbian: {
+
+        DESTDIR = /private/20022F35/import/widgetregistry/20022F7E
         INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
     
         TARGET.UID3 = 0x20022F7E
@@ -103,17 +103,17 @@
         TARGET.CAPABILITY = ALL -TCB
         
         plugins.path = $${DESTDIR}
-        plugins.sources = $${TARGET}.dll
+        plugins.sources = $${TARGET}.dll 
         
         widgetResources.path = $${DESTDIR}
         widgetResources.sources += resource/$${TARGET}.xml    
         widgetResources.sources += resource/$${TARGET}.manifest
         widgetResources.sources += resource/$${TARGET}.png
-        
+            
         DEPLOYMENT += plugins \
                       widgetResources
     }
-    
+
     @endcode
     
     For detailed information on DEPLOYMENT macro, see <a HREF="http://pepper.troll.no/s60prereleases/doc/qmake-variable-reference.html#deployment">here</a>.
--- a/homescreenapp/hsapplication/conf/base/confml/homescreendb.confml	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/conf/base/confml/homescreendb.confml	Wed Jun 23 18:03:36 2010 +0300
@@ -1,8 +1,6 @@
 <?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" name="HomeScreen database settings">
   <confml:feature ref="HomeScreenDbSettings" name="HomeScreen database settings">
-    <confml:setting ref="portraitWallpaper" name="Portrait wallpaper" type="string"/>
-    <confml:setting ref="landscapeWallpaper" name="Landscape wallpaper" type="string"/>
     <confml:setting ref="Pages" mapKey="id" mapValue="id" name="Pages" type="sequence">
       <confml:setting ref="id" name="ID" type="int"/>
       <confml:setting ref="indexPosition" name="Index Position" type="int"/>
@@ -30,57 +28,13 @@
         <confml:option map="HomeScreenDbSettings/Widgets"/>
       </confml:setting>
     </confml:setting>
-    <confml:setting ref="SnapConfiguration" name="Snap Configuration">
-      <confml:setting ref="snappingEnabled" name="Snap enabled" type="int"/>
-      <confml:setting ref="showEffects" name="Show snap effects" type="int"/>
-      <confml:setting ref="snapForce" name="Snap force" type="real"/>
-      <confml:setting ref="snapGap" name="Snap gap" type="real"/>
-      <confml:setting ref="borderGap" name="Snap border gap" type="real"/>
-      <confml:setting ref="timeout" name="Snap timeout" type="int"/>
-    </confml:setting>
-    <confml:setting ref="FeedbackConfiguration" name="Feedback Configuration">
-      <confml:setting ref="pageChangeFeedbackType" name="Page change feedback delay" type="string"/>
-      <confml:setting ref="widgetPickFeedbackType" name="Widget pick feedback type" type="string"/>
-      <confml:setting ref="widgetDropFeedbackType" name="Widget drop feedback type" type="string"/>
-      <confml:setting ref="widgetRepositionFeedbackType" name="Widget forced reposition feedback type" type="string"/>
-      <confml:setting ref="widgetOverTrashbinFeedbackType" name="Widget move over trashbin feedback type" type="string"/>
-      <confml:setting ref="widgetDropToTrashbinFeedbackType" name="Widget drop to trashbin feedback type" type="string"/>
-      <confml:setting ref="shortcutWidgetTapFeedbackType" name="Shortcut widget tap feedback type" type="string"/>
-      <confml:setting ref="widgetMoveBlockedFeedbackType" name="Widget movement blocked feedback type" type="string"/>
-      <confml:setting ref="clockWidgetTapFeedbackType" name="Clock widget tap feedback type" type="string"/>
-      <confml:setting ref="widgetSnappingFeedbackType" name="Widget snapping feedback type" type="string"/>
-    </confml:setting>
-    <confml:setting ref="GeneralConfiguration" name="General Configuration">
-      <confml:setting ref="bounceEffect" name="Bounce effect" type="int"/>
-      <confml:setting ref="tapAndHoldDistance" name="Tap and hold distance" type="real"/>
-      <confml:setting ref="widgetTapAndHoldTimeout" name="Widget tap and hold timeout" type="int"/>
-      <confml:setting ref="sceneTapAndHoldTimeout" name="Scene tap and hold timeout" type="int"/>
-      <confml:setting ref="pageChangeZoneWidth" name="Page change zone width" type="real"/>
-      <confml:setting ref="pageIndicatorSpacing" name="Page indicator spacing" type="real"/>
-      <confml:setting ref="pageChangeAnimationDuration" name="Page change zone animation duration" type="int"/>
-      <confml:setting ref="pageChangeZoneAnimationDuration" name="Page change zone animation duration" type="int"/>
-      <confml:setting ref="pageChangeZoneReverseAnimationDuration" name="Page change zone reverse animation duration" type="int"/>
-      <confml:setting ref="pageRemovedAnimationDuration" name="Page removed animation duration" type="int"/>
-      <confml:setting ref="newPageAddedAnimationDuration" name="Page added animation duration" type="int"/>
-      <confml:setting ref="widgetDragEffectDuration" name="Widget drag effect duration" type="int"/>
-      <confml:setting ref="widgetDropEffectDuration" name="Widget drop effect duration" type="int"/>
-      <confml:setting ref="boundaryFeedbackEffectDistance" name="Boundary feedback effect distance" type="int"/>
-      <confml:setting ref="maximumPageCount" name="Maximum number of pages" type="int"/>
-      <confml:setting ref="maximumWidgetHeight" name="Maximum height of widget" type="real"/>
-      <confml:setting ref="maximumWidgetWidth" name="Maximum width of widget" type="real"/>
-      <confml:setting ref="minimumWidgetHeight" name="Minimum height of widget" type="real"/>
-      <confml:setting ref="minimumWidgetWidth" name="Minimum width of widget" type="real"/>
-      <confml:setting ref="defaultPageId" name="Default page ID" type="selection">
-        <confml:option map="HomeScreenDbSettings/Pages"/>
-      </confml:setting>
-      <confml:setting ref="shortcutLabelsVisible" name="Minimum width of widget" type="int"/>     
-      <confml:setting ref="pageChangePanDistance" name="Amount of pan needed to change page" type="real"/>     
-    </confml:setting>
+    <confml:setting ref="Configuration" name="Configuration" type="sequence">
+      <confml:setting ref="key" name="Key" type="string"/>
+      <confml:setting ref="value" name="Value" type="string"/>      
+    </confml:setting>    
   </confml:feature>
   <confml:data>
     <confml:HomeScreenDbSettings>
-      <confml:landscapeWallpaper/>
-      <confml:portraitWallpaper/>
       <confml:Widgets><confml:id>1</confml:id><confml:uri>hsclockwidgetplugin</confml:uri><confml:pageId  map="HomeScreenDbSettings/Pages[@key='1']"></confml:pageId></confml:Widgets>
       <confml:Widgets><confml:id>2</confml:id><confml:uri>hsdialerwidgetplugin</confml:uri><confml:pageId map="HomeScreenDbSettings/Pages[@key='1']"></confml:pageId></confml:Widgets>
       <confml:Widgets><confml:id>3</confml:id><confml:uri>ftuhswidget</confml:uri><confml:pageId map="HomeScreenDbSettings/Pages[@key='1']"></confml:pageId></confml:Widgets>
@@ -124,50 +78,48 @@
       <confml:Pages><confml:id>1</confml:id><confml:indexPosition>0</confml:indexPosition></confml:Pages>
       <confml:Pages><confml:id>2</confml:id><confml:indexPosition>1</confml:indexPosition></confml:Pages>
       <confml:Pages><confml:id>3</confml:id><confml:indexPosition>2</confml:indexPosition></confml:Pages>
-      <confml:SnapConfiguration>
-      	<confml:snappingEnabled>1</confml:snappingEnabled>
-      	<confml:showEffects>1</confml:showEffects>
-      	<confml:snapForce>30.0</confml:snapForce>
-      	<confml:snapGap>6.0</confml:snapGap>
-      	<confml:borderGap>0.0</confml:borderGap>
-      	<confml:timeout>500</confml:timeout>
-      </confml:SnapConfiguration> 
-      <confml:FeedbackConfiguration>
-      	<confml:pageChangeFeedbackType>Sensitive</confml:pageChangeFeedbackType>
-      	<confml:widgetPickFeedbackType>ItemPick</confml:widgetPickFeedbackType>
-      	<confml:widgetDropFeedbackType>ItemDrop</confml:widgetDropFeedbackType> 
-      	<confml:widgetRepositionFeedbackType>BounceEffect</confml:widgetRepositionFeedbackType> 
-      	<confml:widgetOverTrashbinFeedbackType>ItemMoveOver</confml:widgetOverTrashbinFeedbackType>
-      	<confml:widgetDropToTrashbinFeedbackType>ItemDrop</confml:widgetDropToTrashbinFeedbackType> 
-      	<confml:shortcutWidgetTapFeedbackType>BasicItem</confml:shortcutWidgetTapFeedbackType> 
-      	<confml:widgetMoveBlockedFeedbackType>Basic</confml:widgetMoveBlockedFeedbackType> 
-      	<confml:clockWidgetTapFeedbackType>BasicItem</confml:clockWidgetTapFeedbackType> 
-      	<confml:widgetSnappingFeedbackType>ItemMoveOver</confml:widgetSnappingFeedbackType>
-      </confml:FeedbackConfiguration>
-      <confml:GeneralConfiguration>
-      	<confml:bounceEffect>20</confml:bounceEffect>
-      	<confml:tapAndHoldDistance>16</confml:tapAndHoldDistance>
-      	<confml:widgetTapAndHoldTimeout>500</confml:widgetTapAndHoldTimeout>
-      	<confml:sceneTapAndHoldTimeout>500</confml:sceneTapAndHoldTimeout>
-      	<confml:pageChangeZoneWidth>60</confml:pageChangeZoneWidth>
-      	<confml:pageIndicatorSpacing>8</confml:pageIndicatorSpacing>
-      	<confml:pageChangeAnimationDuration>200</confml:pageChangeAnimationDuration>
-      	<confml:pageChangeZoneAnimationDuration>800</confml:pageChangeZoneAnimationDuration>
-      	<confml:pageChangeZoneReverseAnimationDuration>200</confml:pageChangeZoneReverseAnimationDuration>
-      	<confml:pageRemovedAnimationDuration>200</confml:pageRemovedAnimationDuration>
-      	<confml:newPageAddedAnimationDuration>700</confml:newPageAddedAnimationDuration>
-      	<confml:widgetDragEffectDuration>200</confml:widgetDragEffectDuration>
-      	<confml:widgetDropEffectDuration>200</confml:widgetDropEffectDuration>
-      	<confml:boundaryFeedbackEffectDistance>3</confml:boundaryFeedbackEffectDistance>
-        <confml:maximumPageCount>8</confml:maximumPageCount>
-        <confml:maximumWidgetHeight>39</confml:maximumWidgetHeight>
-        <confml:maximumWidgetWidth>48</confml:maximumWidgetWidth>
-        <confml:minimumWidgetHeight>8.75</confml:minimumWidgetHeight>
-        <confml:minimumWidgetWidth>8.75</confml:minimumWidgetWidth> 
-       	<confml:defaultPageId map="HomeScreenDbSettings/Pages[@key='1']"/>
-        <confml:shortcutLabelsVisible>1</confml:shortcutLabelsVisible>
-        <confml:pageChangePanDistance>17.91</confml:pageChangePanDistance>           	
-      </confml:GeneralConfiguration>
+      <confml:Configuration><confml:key>bounceEffect</confml:key><confml:value>20</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetTapAndHoldTimeout</confml:key><confml:value>500</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>sceneTapAndHoldTimeout</confml:key><confml:value>500</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageChangeAnimationDuration</confml:key><confml:value>200</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageChangeZoneAnimationDuration</confml:key><confml:value>800</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageChangeZoneReverseAnimationDuration</confml:key><confml:value>200</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageRemovedAnimationDuration</confml:key><confml:value>200</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>newPageAddedAnimationDuration</confml:key><confml:value>200</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetDragEffectDuration</confml:key><confml:value>200</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetDropEffectDuration</confml:key><confml:value>200</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>defaultPageId</confml:key><confml:value>1</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>maximumPageCount</confml:key><confml:value>8</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>isShortcutLabelVisible</confml:key><confml:value>true</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>bounceFeedbackEffectDistance</confml:key><confml:value>3</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageChangePanDistanceInPixels</confml:key><confml:value>120</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>tapAndHoldDistance</confml:key><confml:value>16</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageChangeZoneWidth</confml:key><confml:value>60</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageIndicatorSpacing</confml:key><confml:value>8</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>maximumWidgetHeight</confml:key><confml:value>39</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>maximumWidgetWidth</confml:key><confml:value>48</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>minimumWidgetHeight</confml:key><confml:value>8.75</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>minimumWidgetWidth</confml:key><confml:value>8.75</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageChangePanDistance</confml:key><confml:value>17.91</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>pageChangeFeedbackEffect</confml:key><confml:value>Sensitive</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetPickFeedbackEffect</confml:key><confml:value>ItemPick</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetDropFeedbackEffect</confml:key><confml:value>ItemDrop</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetRepositionFeedbackEffect</confml:key><confml:value>BounceEffect</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetOverTrashbinFeedbackEffect</confml:key><confml:value>ItemMoveOver</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetDropToTrashbinFeedbackEffect</confml:key><confml:value>ItemDrop</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>shortcutWidgetTapFeedbackEffect</confml:key><confml:value>BasicItem</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetMoveBlockedFeedbackEffect</confml:key><confml:value>Basic</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>clockWidgetTapFeedbackEffect</confml:key><confml:value>BasicItem</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>widgetSnappingFeedbackEffect</confml:key><confml:value>ItemMoveOver</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>isSnapEnabled</confml:key><confml:value>true</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>snapTimeout</confml:key><confml:value>1000</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>snapForce</confml:key><confml:value>30</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>snapGap</confml:key><confml:value>6</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>snapBorderGap</confml:key><confml:value>0</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>snapLineFadeInDuration</confml:key><confml:value>200</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>snapLineFadeOutDuration</confml:key><confml:value>100</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>isSnapEffectsEnabled</confml:key><confml:value>true</confml:value></confml:Configuration>
+      <confml:Configuration><confml:key>sceneType</confml:key><confml:value>PageWallpapers</confml:value></confml:Configuration>
     </confml:HomeScreenDbSettings>
   </confml:data>
-</confml:configuration>
\ No newline at end of file
+</confml:configuration>
--- a/homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/create.sql	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/create.sql	Wed Jun 23 18:03:36 2010 +0300
@@ -1,8 +1,6 @@
 DROP TABLE IF EXISTS Scene;
 CREATE TABLE Scene (
-  id INTEGER PRIMARY KEY,
-  portraitWallpaper TEXT,
-  landscapeWallpaper TEXT);
+  id INTEGER PRIMARY KEY);
 
 DROP TABLE IF EXISTS Pages;
 CREATE TABLE Pages (
@@ -33,50 +31,9 @@
   UNIQUE(widgetId, key) ON CONFLICT REPLACE,
   FOREIGN KEY(widgetId) REFERENCES Widgets(id) ON DELETE CASCADE);
 
-DROP TABLE IF EXISTS SnapConfiguration;
-CREATE TABLE SnapConfiguration (
-	snappingEnabled INTEGER,
-	showEffects INTEGER,
-	snapForce REAL,
-	snapGap REAL,
-	borderGap REAL,
-	timeout INTEGER);
-	
-DROP TABLE IF EXISTS FeedbackConfiguration;
-CREATE TABLE FeedbackConfiguration (
-  pageChangeFeedbackType TEXT,
-  widgetPickFeedbackType TEXT, 
-  widgetDropFeedbackType TEXT,
-  widgetRepositionFeedbackType TEXT,
-  widgetOverTrashbinFeedbackType TEXT,
-  widgetDropToTrashbinFeedbackType TEXT,
-  shortcutWidgetTapFeedbackType TEXT,
-  widgetMoveBlockedFeedbackType TEXT,
-  clockWidgetTapFeedbackType TEXT,
-  widgetSnappingFeedbackType TEXT);
-
-DROP TABLE IF EXISTS GeneralConfiguration;
-CREATE TABLE GeneralConfiguration (
-  bounceEffect INTEGER, 
-  tapAndHoldDistance REAL, 
-  widgetTapAndHoldTimeout INTEGER,
-  sceneTapAndHoldTimeout INTEGER,  
-  pageChangeZoneWidth REAL,
-  pageIndicatorSpacing REAL,
-  pageChangeAnimationDuration INTEGER,
-  pageChangeZoneAnimationDuration INTEGER,
-  pageChangeZoneReverseAnimationDuration INTEGER,
-  pageRemovedAnimationDuration INTEGER, 
-  newPageAddedAnimationDuration INTEGER, 
-  widgetDragEffectDuration INTEGER, 
-  widgetDropEffectDuration INTEGER,
-  boundaryFeedbackEffectDistance INTEGER,
-  defaultPageId INTEGER,
-  maximumPageCount INTEGER,
-  maximumWidgetHeight REAL,
-  maximumWidgetWidth REAL,
-  minimumWidgetHeight REAL,
-  minimumWidgetWidth REAL,
-  shortcutLabelsVisible INTEGER,
-  pageChangePanDistance REAL);
- 
\ No newline at end of file
+DROP TABLE IF EXISTS Configuration;
+CREATE TABLE Configuration (
+	key TEXT,
+	value TEXT,
+	UNIQUE(key) ON CONFLICT REPLACE);
+	
\ No newline at end of file
--- a/homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/fill.sql	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/conf/base/implml/homescreendb_templates/fill.sql	Wed Jun 23 18:03:36 2010 +0300
@@ -1,6 +1,4 @@
-{%- set portraitWallpaper = feat_tree.HomeScreenDbSettings.portraitWallpaper._value or '' -%}
-{%- set landscapeWallpaper = feat_tree.HomeScreenDbSettings.landscapeWallpaper._value or '' -%}
-INSERT INTO Scene (portraitWallpaper, landscapeWallpaper) VALUES ('{{portraitWallpaper}}', '{{landscapeWallpaper}}');
+INSERT INTO Scene (id) VALUES (1);
 
 {% for index in range(feat_tree.HomeScreenDbSettings.Pages._value|length) -%}
     {%- set id = feat_tree.HomeScreenDbSettings.Pages.id._value[index] -%}
@@ -34,47 +32,9 @@
     INSERT INTO WidgetPreferences (key, value, widgetId) VALUES ('{{key}}', '{{value}}', {{widgetId}});
 {% endfor %}
 
-{%- set snappingEnabled = feat_tree.HomeScreenDbSettings.SnapConfiguration.snappingEnabled._value -%}    
-{%- set showEffects = feat_tree.HomeScreenDbSettings.SnapConfiguration.showEffects._value -%} 
-{%- set snapForce = feat_tree.HomeScreenDbSettings.SnapConfiguration.snapForce._value -%}    
-{%- set snapGap = feat_tree.HomeScreenDbSettings.SnapConfiguration.snapGap._value -%}    
-{%- set borderGap = feat_tree.HomeScreenDbSettings.SnapConfiguration.borderGap._value -%}    
-{%- set timeout = feat_tree.HomeScreenDbSettings.SnapConfiguration.timeout._value -%}    
-INSERT INTO SnapConfiguration (snappingEnabled, showEffects, snapForce, snapGap, borderGap, timeout) VALUES ({{snappingEnabled}}, {{showEffects}}, {{snapForce}}, {{snapGap}}, {{borderGap}}, {{timeout}});
-
-{%- set bounceEffect = feat_tree.HomeScreenDbSettings.GeneralConfiguration.bounceEffect._value -%}
-{%- set tapAndHoldDistance = feat_tree.HomeScreenDbSettings.GeneralConfiguration.tapAndHoldDistance._value -%}
-{%- set widgetTapAndHoldTimeout = feat_tree.HomeScreenDbSettings.GeneralConfiguration.widgetTapAndHoldTimeout._value -%}
-{%- set sceneTapAndHoldTimeout = feat_tree.HomeScreenDbSettings.GeneralConfiguration.sceneTapAndHoldTimeout._value -%}
-{%- set pageChangeZoneWidth = feat_tree.HomeScreenDbSettings.GeneralConfiguration.pageChangeZoneWidth._value -%}
-{%- set pageIndicatorSpacing = feat_tree.HomeScreenDbSettings.GeneralConfiguration.pageIndicatorSpacing._value -%}
-{%- set pageChangeAnimationDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.pageChangeAnimationDuration._value -%}
-{%- set pageChangeZoneAnimationDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.pageChangeZoneAnimationDuration._value -%}
-{%- set pageChangeZoneReverseAnimationDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.pageChangeZoneReverseAnimationDuration._value -%}
-{%- set pageRemovedAnimationDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.pageRemovedAnimationDuration._value -%}
-{%- set newPageAddedAnimationDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.newPageAddedAnimationDuration._value -%}
-{%- set widgetDragEffectDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.widgetDragEffectDuration._value -%}
-{%- set widgetDropEffectDuration = feat_tree.HomeScreenDbSettings.GeneralConfiguration.widgetDropEffectDuration._value -%}
-{%- set boundaryFeedbackEffectDistance = feat_tree.HomeScreenDbSettings.GeneralConfiguration.boundaryFeedbackEffectDistance._value -%}
-{%- set defaultPageId = feat_tree.HomeScreenDbSettings.GeneralConfiguration.defaultPageId._value -%}
-{%- set maximumPageCount = feat_tree.HomeScreenDbSettings.GeneralConfiguration.maximumPageCount._value -%}
-{%- set maximumWidgetHeight = feat_tree.HomeScreenDbSettings.GeneralConfiguration.maximumWidgetHeight._value -%}
-{%- set maximumWidgetWidth = feat_tree.HomeScreenDbSettings.GeneralConfiguration.maximumWidgetWidth._value -%}
-{%- set minimumWidgetHeight = feat_tree.HomeScreenDbSettings.GeneralConfiguration.minimumWidgetHeight._value -%}
-{%- set minimumWidgetWidth = feat_tree.HomeScreenDbSettings.GeneralConfiguration.minimumWidgetWidth._value -%}
-{%- set shortcutLabelsVisible = feat_tree.HomeScreenDbSettings.GeneralConfiguration.shortcutLabelsVisible._value -%}
-{%- set pageChangePanDistance = feat_tree.HomeScreenDbSettings.GeneralConfiguration.pageChangePanDistance._value -%}
-INSERT INTO GeneralConfiguration (bounceEffect, tapAndHoldDistance, widgetTapAndHoldTimeout, sceneTapAndHoldTimeout, pageChangeZoneWidth, pageIndicatorSpacing, pageChangeAnimationDuration, pageChangeZoneAnimationDuration, pageChangeZoneReverseAnimationDuration, pageRemovedAnimationDuration, newPageAddedAnimationDuration, widgetDragEffectDuration, widgetDropEffectDuration, boundaryFeedbackEffectDistance, defaultPageId, maximumPageCount, maximumWidgetHeight, maximumWidgetWidth, minimumWidgetHeight, minimumWidgetWidth, shortcutLabelsVisible, pageChangePanDistance) VALUES ({{bounceEffect}}, {{tapAndHoldDistance}}, {{widgetTapAndHoldTimeout}}, {{widgetTapAndHoldTimeout}}, {{pageChangeZoneWidth}}, {{pageIndicatorSpacing}}, {{pageChangeAnimationDuration}}, {{pageChangeZoneAnimationDuration}}, {{pageChangeZoneReverseAnimationDuration}}, {{pageRemovedAnimationDuration}}, {{newPageAddedAnimationDuration}}, {{widgetDragEffectDuration}}, {{widgetDropEffectDuration}}, {{boundaryFeedbackEffectDistance}}, {{defaultPageId}}, {{maximumPageCount}}, {{maximumWidgetHeight}}, {{maximumWidgetWidth}}, {{minimumWidgetHeight}}, {{minimumWidgetWidth}}, {{shortcutLabelsVisible}}, {{pageChangePanDistance}});
-
-{%- set pageChangeFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.pageChangeFeedbackType._value -%}
-{%- set widgetPickFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.widgetPickFeedbackType._value -%}
-{%- set widgetDropFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.widgetDropFeedbackType._value -%}
-{%- set widgetRepositionFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.widgetRepositionFeedbackType._value -%}
-{%- set widgetOverTrashbinFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.widgetOverTrashbinFeedbackType._value -%}
-{%- set widgetDropToTrashbinFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.widgetDropToTrashbinFeedbackType._value -%}
-{%- set shortcutWidgetTapFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.shortcutWidgetTapFeedbackType._value -%}
-{%- set widgetMoveBlockedFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.widgetMoveBlockedFeedbackType._value -%}
-{%- set clockWidgetTapFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.clockWidgetTapFeedbackType._value -%}
-{%- set widgetSnappingFeedbackType = feat_tree.HomeScreenDbSettings.FeedbackConfiguration.widgetSnappingFeedbackType._value -%}
-INSERT INTO FeedbackConfiguration (pageChangeFeedbackType, widgetPickFeedbackType, widgetDropFeedbackType, widgetRepositionFeedbackType, widgetOverTrashbinFeedbackType, widgetDropToTrashbinFeedbackType, shortcutWidgetTapFeedbackType, widgetMoveBlockedFeedbackType, clockWidgetTapFeedbackType, widgetSnappingFeedbackType) VALUES ('{{pageChangeFeedbackType}}', '{{widgetPickFeedbackType}}', '{{widgetDropFeedbackType}}', '{{widgetRepositionFeedbackType}}', '{{widgetOverTrashbinFeedbackType}}', '{{widgetDropToTrashbinFeedbackType}}', '{{shortcutWidgetTapFeedbackType}}', '{{widgetMoveBlockedFeedbackType}}', '{{clockWidgetTapFeedbackType}}', '{{widgetSnappingFeedbackType}}');
-
+{% for index in range(feat_tree.HomeScreenDbSettings.Configuration._value|length) -%}
+    {%- set key = feat_tree.HomeScreenDbSettings.Configuration.key._value[index] or '' -%}
+    {%- set value = feat_tree.HomeScreenDbSettings.Configuration.value._value[index] -%}
+    
+    INSERT INTO Configuration (key, value) VALUES ('{{key}}', '{{value}}');
+{% endfor %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsapplication/conf/buildhomescreendb.bat	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,17 @@
+@rem
+@rem Copyright (c) 2010 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
+
+call cone generate -c root.confml -o output
\ No newline at end of file
--- a/homescreenapp/hsapplication/inc/hshomescreenclientserviceprovider.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/inc/hshomescreenclientserviceprovider.h	Wed Jun 23 18:03:36 2010 +0300
@@ -22,6 +22,12 @@
 
 #include <xqserviceprovider.h>
 #include "hswidgetcomponentdescriptor.h"
+#include "hstest_global.h"
+
+HOMESCREEN_TEST_CLASS(t_hsapplication)
+
+class HsSpinnerDialog;
+class HsWallpaper;
 
 class HsHomeScreenClientServiceProvider : public XQServiceProvider
 {
@@ -30,14 +36,29 @@
 public:
     HsHomeScreenClientServiceProvider(QObject *parent = 0);
     ~HsHomeScreenClientServiceProvider();
+private:
+    void startAnimation();
+    void stopAnimation();
+
+signals:
+    void requestFinished();
     
 public slots:
     bool addWidget(const QString &uri,const QVariantHash &preferences);
-    bool setWallpaper(const QString &fileName);
+    void setWallpaper(const QString &fileName);
     bool widgetUninstalled(const QVariantHash &widgetDescriptor);
+    void onImageSet();
+    void onImageSetFailed();    
     
 private:
     HsWidgetComponentDescriptor widgetComponentDescriptor(const QVariantHash& widgetDescriptor);
+    HsSpinnerDialog *mWaitDialog;
+    bool mShowAnimation;
+    int mAsyncRequestIndex;
+    QVariant mReturnValue;
+    HsWallpaper *mWallpaper;
+
+    HOMESCREEN_TEST_FRIEND_CLASS(t_hsapplication)
 };
 
 #endif // HSHOMESCREENCLIENTSERVICEPROVIDER_H
--- a/homescreenapp/hsapplication/installs_symbian.pri	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/installs_symbian.pri	Wed Jun 23 18:03:36 2010 +0300
@@ -21,7 +21,18 @@
 exports1.sources += data/backup_registration.xml
 for(export1, exports1.sources):BLD_INF_RULES.prj_exports += "./$$export1 $$deploy.path$$exports1.path/$$basename(export1)"
 
-exports2.path = /private/20022f35/wallpapers
-exports2.sources += resource_s60/d_landscape.png
-exports2.sources += resource_s60/d_portrait.png
+exports2.path = /private/20022f35/wallpapers/scene
+exports2.sources += resource_s60/scene/default_landscape.png
+exports2.sources += resource_s60/scene/default_portrait.png
 for(export2, exports2.sources):BLD_INF_RULES.prj_exports += "./$$export2 $$deploy.path$$exports2.path/$$basename(export2)"
+
+exports3.path = /private/20022f35/wallpapers/page
+exports3.sources += resource_s60/page/default_landscape.png
+exports3.sources += resource_s60/page/default_portrait.png
+exports3.sources += resource_s60/page/1_landscape.png
+exports3.sources += resource_s60/page/1_portrait.png
+exports3.sources += resource_s60/page/2_landscape.png
+exports3.sources += resource_s60/page/2_portrait.png
+exports3.sources += resource_s60/page/3_landscape.png
+exports3.sources += resource_s60/page/3_portrait.png
+for(export3, exports3.sources):BLD_INF_RULES.prj_exports += "./$$export3 $$deploy.path$$exports3.path/$$basename(export3)"
--- a/homescreenapp/hsapplication/installs_win.pri	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/installs_win.pri	Wed Jun 23 18:03:36 2010 +0300
@@ -24,10 +24,21 @@
 homescreendb.path = $$DESTDIR/private/20022f35
 homescreendb.files = ./resource_win/homescreen.db
 
-wallpapers.CONFIG += no_build
-wallpapers.path = $$DESTDIR/private/20022f35/wallpapers
-wallpapers.files = ./resource_win/d_landscape.png \
-                   ./resource_win/d_portrait.png
+scenewallpapers.CONFIG += no_build
+scenewallpapers.path = $$DESTDIR/private/20022f35/wallpapers/scene
+scenewallpapers.files = ./resource_win/scene/default_landscape.png \
+                   ./resource_win/scene/default_portrait.png
 
-INSTALLS += kqtihswallpapers homescreendb wallpapers 
-PRE_TARGETDEPS += install_kqtihswallpapers install_homescreendb install_wallpapers
+pagewallpapers.CONFIG += no_build
+pagewallpapers.path = $$DESTDIR/private/20022f35/wallpapers/page
+pagewallpapers.files = ./resource_win/page/default_landscape.png \
+                       ./resource_win/page/default_portrait.png \
+                       ./resource_win/page/1_portrait.png \
+                       ./resource_win/page/1_landscape.png \
+                       ./resource_win/page/2_portrait.png \
+                       ./resource_win/page/2_landscape.png \
+                       ./resource_win/page/3_portrait.png \
+                       ./resource_win/page/3_landscape.png
+
+INSTALLS += kqtihswallpapers homescreendb scenewallpapers pagewallpapers
+PRE_TARGETDEPS += install_kqtihswallpapers install_homescreendb install_scenewallpapers install_pagewallpapers
--- a/homescreenapp/hsapplication/ipc_service_conf.xml	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/ipc_service_conf.xml	Wed Jun 23 18:03:36 2010 +0300
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<service name="com.nokia.services.hsapplication"  filepath="must-not-be-empty" >
+<service name="com.nokia.symbian"  filepath="must-not-be-empty" >
   <description>Homescreen client service provider</description>
   <interface name="IHomeScreenClient" version="1.0" capabilities="">
     <description>Homescreen client service interface</description>
Binary file homescreenapp/hsapplication/resource_s60/d_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_s60/d_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_s60/homescreen.db has changed
Binary file homescreenapp/hsapplication/resource_s60/page/1_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_s60/page/1_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_s60/page/2_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_s60/page/2_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_s60/page/3_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_s60/page/3_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_s60/page/default_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_s60/page/default_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_s60/scene/default_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_s60/scene/default_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_win/d_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_win/d_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_win/homescreen.db has changed
Binary file homescreenapp/hsapplication/resource_win/page/1_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_win/page/1_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_win/page/2_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_win/page/2_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_win/page/3_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_win/page/3_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_win/page/default_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_win/page/default_portrait.png has changed
Binary file homescreenapp/hsapplication/resource_win/scene/default_landscape.png has changed
Binary file homescreenapp/hsapplication/resource_win/scene/default_portrait.png has changed
--- a/homescreenapp/hsapplication/src/hshomescreenclientserviceprovider.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/src/hshomescreenclientserviceprovider.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -15,31 +15,38 @@
 *
 */
 
-#include <QDir>
-#include <QFileInfo>
-
 #include "hshomescreenclientserviceprovider.h"
 #include "hswidgetcomponentdescriptor.h"
 #include "hscontentservice.h"
-
 #include "hsscene.h"
-#include "hsdomainmodeldatastructures.h"
+#include "hspage.h"
 #include "hswallpaper.h"
-#include "hsdatabase.h"
-#include "hswallpaperhelper.h"
 #include "hswidgetcomponentregistry.h"
 #include "hsconfiguration.h"
+#include "hsspinnerdialog.h"
 
 namespace
 {
-    const char gInterfaceName[] = "com.nokia.services.hsapplication.IHomeScreenClient";
+    const char gInterfaceName[] = "com.nokia.symbian.IHomeScreenClient";
 }
 
+
+/*!
+    \class HsHomeScreenClientServiceProvider
+    \ingroup group_hsapplication
+    \brief TODO
+*/
+
 /*!
     Constructor.
 */
 HsHomeScreenClientServiceProvider::HsHomeScreenClientServiceProvider(QObject *parent)
-  : XQServiceProvider(gInterfaceName, parent)
+  : XQServiceProvider(gInterfaceName, parent),
+    mWaitDialog(0),
+    mShowAnimation(false),
+    mAsyncRequestIndex(0),    
+    mReturnValue(false),
+    mWallpaper(0)
 {
     publishAll();
 }
@@ -56,7 +63,7 @@
 #endif //COVERAGE_MEASUREMENT
 
 /*!
-    Adds new widget, with the give \a uri and \a preferences, 
+    Adds new widget, with the give \a uri and \a preferences,
     to the active home screen page.
 */
 bool HsHomeScreenClientServiceProvider::addWidget(const QString &uri, const QVariantHash &preferences)
@@ -67,69 +74,67 @@
 /*!
     Changes \a fileName image to the active home screen page's wallpaper.
 */
-bool HsHomeScreenClientServiceProvider::setWallpaper(const QString &fileName)
+void HsHomeScreenClientServiceProvider::setWallpaper(const QString &fileName)
 {
-    HsScene *scene = HsScene::instance();
-        
-    HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-    
-    HsSceneData sceneData;
-    if (!db->scene(sceneData)) {
-        return false;
-    }
-
-    QFileInfo fileInfo(fileName);
-    QString fileExtension("");
-    if (!fileInfo.suffix().isEmpty()) {
-        fileExtension = fileInfo.suffix();
-    }
-    
-    QFile::remove(sceneData.portraitWallpaper);
-    QFile::remove(sceneData.landscapeWallpaper); 
-    
-    QString wallpaperDir = HsWallpaper::wallpaperDirectory();            
-    QDir dir(wallpaperDir);
-    if (!dir.exists()) {
-        dir.mkpath(wallpaperDir);
+#ifndef HOMESCREEN_TEST //We can't use QtHighway at unit tests due to missing service client connection
+    mAsyncRequestIndex = setCurrentRequestAsync();
+#endif
+    if ( !mWaitDialog ) {
+        mWaitDialog = new HsSpinnerDialog();
+        }
+    mWaitDialog->start();
+    mShowAnimation = true;
+    if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) {
+        mWallpaper = HsScene::instance()->activePage()->wallpaper();
+    } else {
+        mWallpaper = HsScene::instance()->wallpaper();
     }
-    
-    QString portraitPath = HsWallpaper::wallpaperPath(
-        Qt::Vertical, QString(), fileExtension);
-    QString landscapePath = HsWallpaper::wallpaperPath(
-        Qt::Horizontal, QString(), fileExtension);
-    
-    int bounceEffect = HsConfiguration::bounceEffect();
-
-    QRect portraitRect = QRect(0, 0, (2 * 360) + bounceEffect, 640);
-    QRect landscapeRect = QRect(0, 0, (2 * 640) + bounceEffect, 360);
-    QRect sourceRect; // left empty to signal we want to use full size image as source
-    
-    QImage portraitImage = HsWallpaperHelper::processImage(fileName,
-            portraitRect, sourceRect);
-
-    QImage landscapeImage = HsWallpaperHelper::processImage(fileName,
-            landscapeRect, sourceRect);
-
-    if (!portraitImage.isNull() && !landscapeImage.isNull()) {
-        portraitImage.save(portraitPath);
-        sceneData.portraitWallpaper = portraitPath;
-        
-        landscapeImage.save(landscapePath);
-        sceneData.landscapeWallpaper = landscapePath;
-        
-        if (db->updateScene(sceneData)) {
-            scene->wallpaper()->setImagesById(QString(), fileInfo.suffix());
-        }
-    }
-    else {
-        // display some error note here
-    }
-    return true;
+    connect(mWallpaper, SIGNAL(imageSet()), SLOT(onImageSet()));
+    connect(mWallpaper, SIGNAL(imageSetFailed()),
+            SLOT(onImageSetFailed()));
+    mWallpaper->setImage(fileName);
 }
 
+/*!
+    \internal
+    Called when wallpaper image has been set successfully  
+*/
+void HsHomeScreenClientServiceProvider::onImageSet()
+{
+    mWallpaper->disconnect(this);
+    stopAnimation();
+#ifndef HOMESCREEN_TEST //We can't use QtHighway at unit tests due to missing service client connection
+    completeRequest(mAsyncRequestIndex, QVariant(true));
+#endif
+}
 
+/*!
+    \internal
+    Called when error has happened in wallpaper image setting
+*/
+void HsHomeScreenClientServiceProvider::onImageSetFailed()
+{
+    mWallpaper->disconnect(this);
+    stopAnimation();
+#ifndef HOMESCREEN_TEST //We can't use QtHighway at unit tests due to missing service client connection
+    completeRequest(mAsyncRequestIndex, QVariant(false));
+#endif
+}
 
+/*!
+    Stops progress animation
+*/
+void HsHomeScreenClientServiceProvider::stopAnimation()
+{
+    if (mShowAnimation) {
+        mWaitDialog->stop();
+        mWaitDialog=0;
+    }
+}
+
+/*!
+
+*/
 bool HsHomeScreenClientServiceProvider::widgetUninstalled(const QVariantHash &widgetDescriptor)
 {
     HsWidgetComponentDescriptor widgetComponent = widgetComponentDescriptor(widgetDescriptor);
@@ -143,16 +148,19 @@
 #pragma CTC ENDSKIP
 #endif //COVERAGE_MEASUREMENT
 
+/*!
+
+*/
 HsWidgetComponentDescriptor HsHomeScreenClientServiceProvider::widgetComponentDescriptor(const QVariantHash& widgetDescriptor)
 {
     HsWidgetComponentDescriptor widget;
-    widget.installationPath = widgetDescriptor["installationPath"].toString(); 
-    widget.uri = widgetDescriptor["uri"].toString(); 
-    widget.title = widgetDescriptor["title"].toString(); 
-    widget.description = widgetDescriptor["description"].toString(); 
-    widget.iconUri = widgetDescriptor["iconUri"].toString(); 
-    widget.hidden = widgetDescriptor["hidden"].toString(); 
-    widget.serviceXml = widgetDescriptor["serviceXml"].toString(); 
-    widget.version = widgetDescriptor["version"].toString(); 
+    widget.installationPath = widgetDescriptor["installationPath"].toString();
+    widget.uri = widgetDescriptor["uri"].toString();
+    widget.title = widgetDescriptor["title"].toString();
+    widget.description = widgetDescriptor["description"].toString();
+    widget.iconUri = widgetDescriptor["iconUri"].toString();
+    widget.hidden = widgetDescriptor["hidden"].toString();
+    widget.serviceXml = widgetDescriptor["serviceXml"].toString();
+    widget.version = widgetDescriptor["version"].toString();
     return widget;
 }
--- a/homescreenapp/hsapplication/src/main.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsapplication/src/main.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -44,6 +44,12 @@
 void copyHsDatabaseFileFromRom();
 void createPrivateFolder();
 
+/*!
+    \fn setHomescreenAsSystemAppL(CEikonEnv* eikonEnv)
+    \ingroup group_hsapplication
+    \internal
+    \brief TODO
+*/
 void setHomescreenAsSystemAppL(CEikonEnv* eikonEnv)
 {
     CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(eikonEnv->WsSession());
@@ -54,6 +60,12 @@
     CleanupStack::PopAndDestroy();
 }
 
+/*!
+    \fn myMessageOutput(QtMsgType type, const char *msg)
+    \ingroup group_hsapplication
+    \internal    
+    \brief TODO
+*/
 void myMessageOutput(QtMsgType type, const char *msg)
 {
     switch (type) {
@@ -79,7 +91,10 @@
 #endif //Q_OS_SYMBIAN
 
 /*!
-
+    \fn main(int argc, char *argv[])
+    \ingroup group_hsapplication
+    \internal    
+    \brief TODO
 */
 int main(int argc, char *argv[])
 {
@@ -89,7 +104,7 @@
 
     HSTEST_FUNC_ENTRY("HS::main()");
 
-    HbApplication app(argc, argv);
+    HbApplication app(argc, argv, Hb::NoSplash);
 
 #ifdef Q_OS_SYMBIAN
     QString currentPath = QString(argv[0]).left(2);
@@ -147,8 +162,12 @@
 #ifdef Q_OS_SYMBIAN
 
 /*!
- * Creates private folder to c: drive if not exists yet.
- */
+    \fn createPrivateFolder()
+    \ingroup group_hsapplication
+    \internal    
+    \brief Private folder creator
+    Creates private folder to c: drive if not exists yet.
+*/
 void createPrivateFolder()
 {
     QDir dir("c:/private/20022f35/");
@@ -168,9 +187,14 @@
     HSTEST("HS::main() - c:/private/20022f35/ exists.");
 }
 
+
 /*!
- * Copies homescreen database from rom if database does not exist on c: drive
- */
+    \fn copyHsDatabaseFileFromRom()
+    \ingroup group_hsapplication
+    \internal    
+    \brief Database copier
+    Copies homescreen database from rom if database does not exist on c: drive
+*/
 void copyHsDatabaseFileFromRom()
 {
     QFile file("c:/private/20022f35/homescreen.db");
@@ -204,33 +228,66 @@
 }
 
 /*!
- * Copies homescreen wallpapers from rom if wallpaper directory does not exist on c: drive
- */
+    \fn copyWallpapersFromRom()
+    \ingroup group_hsapplication
+    \internal    
+    \brief Wallpaper copier
+    Copies homescreen wallpapers from rom if wallpaper directory
+    does not exist on c: drive
+*/
 void copyWallpapersFromRom()
 {
-    QDir dir("c:/private/20022f35/wallpapers");
-    if(!dir.exists()) {
-        dir.mkpath("c:/private/20022f35/wallpapers/");
-        QDir dir2("z:/private/20022f35/wallpapers");
-        dir2.setFilter(QDir::Files);
-        QStringList files = dir2.entryList();
-        foreach(QString file, files)
-        {
-            QString targetFile("c:/private/20022f35/wallpapers/" + file);
-            if ( QFile::copy(dir2.absoluteFilePath(file), targetFile) ) {
-                qDebug() << "image copied" << dir2.absoluteFilePath(file);
-            } 
-            QFile createdFile(targetFile);
-            if(!createdFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner)) {
-                qDebug() << "read write permission set failed for file" << targetFile;
+    {
+        QDir dir("c:/private/20022f35/wallpapers/scene");
+        if(!dir.exists()) {
+            dir.mkpath("c:/private/20022f35/wallpapers/scene");
+            QDir dir2("z:/private/20022f35/wallpapers/scene");
+            dir2.setFilter(QDir::Files);
+            QStringList files = dir2.entryList();
+            foreach(QString file, files)
+            {
+                QString targetFile("c:/private/20022f35/wallpapers/scene/" + file);
+                if ( QFile::copy(dir2.absoluteFilePath(file), targetFile) ) {
+                    qDebug() << "image copied" << dir2.absoluteFilePath(file);
+                } 
+                QFile createdFile(targetFile);
+                if(!createdFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner)) {
+                    qDebug() << "read write permission set failed for file" << targetFile;
+                }
+            }
+        }
+    }
+    {
+        QDir dir("c:/private/20022f35/wallpapers/page");
+        if(!dir.exists()) {
+            dir.mkpath("c:/private/20022f35/wallpapers/page");
+            QDir dir2("z:/private/20022f35/wallpapers/page");
+            dir2.setFilter(QDir::Files);
+            QStringList files = dir2.entryList();
+            foreach(QString file, files)
+            {
+                QString targetFile("c:/private/20022f35/wallpapers/page/" + file);
+                if ( QFile::copy(dir2.absoluteFilePath(file), targetFile) ) {
+                    qDebug() << "image copied" << dir2.absoluteFilePath(file);
+                } 
+                QFile createdFile(targetFile);
+                if(!createdFile.setPermissions(QFile::ReadOwner | QFile::WriteOwner)) {
+                    qDebug() << "read write permission set failed for file" << targetFile;
+                }
             }
         }
     }
 }
 
 /*!
- * Load translation files.
- */
+    \fn loadTranslationFilesOnSymbian(QTranslator &commonTranslator, 
+                                      QTranslator &hsTranslator, 
+                                      QTranslator &alTranslator)
+    \ingroup group_hsapplication
+    \internal    
+    \brief translation loader
+    Load translation files.
+*/
 void loadTranslationFilesOnSymbian(QTranslator &commonTranslator, 
                                    QTranslator &hsTranslator, 
                                    QTranslator &alTranslator)
--- a/homescreenapp/hsdomainmodel/hsdomainmodel.pri	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/hsdomainmodel.pri	Wed Jun 23 18:03:36 2010 +0300
@@ -16,40 +16,46 @@
 
 HEADERS += ./inc/hscontentservice.h \
            ./inc/hsdomainmodeldatastructures.h \
-           ./inc/hsdatabase.h  \                        
+           ./inc/hsdatabase.h  \
            ./inc/hsdomainmodel_global.h  \
-           ./inc/hspage.h \  
-           ./inc/hsgui.h  \          
+           ./inc/hspage.h \
+           ./inc/hspagenewwidgetlayout.h \
+           ./inc/hsgui.h  \
            ./inc/hsscene.h \
            ./inc/hsshortcutservice.h \
            ./inc/hsshortcutservice_p.h \
            ./inc/hswallpaper.h \
+           ./inc/hswallpaperloader.h \
+           ./inc/hswallpaperloaderthread.h \
            ./inc/hswidgethost.h \
            ./inc/hswidgetcomponentregistry.h \
            ./inc/hswidgetcomponent.h \
            ./inc/hswidgetcomponentdescriptor.h \
            ./inc/hsbackuprestoreobserver.h \
-	   ./inc/hsconfiguration.h     
-					 
-SOURCES += ./src/hscontentservice.cpp   \           
-           ./src/hsdatabase.cpp  \                        
+           ./inc/hsconfiguration.h
+
+SOURCES += ./src/hscontentservice.cpp   \
+           ./src/hsdatabase.cpp  \
            ./src/hspage.cpp  \
-           ./src/hsgui.cpp  \           
-           ./src/hsscene.cpp \                        
-           ./src/hsshortcutservice.cpp \   
-           ./src/hswallpaper.cpp \ 
+           ./src/hspagenewwidgetlayout.cpp  \
+           ./src/hsgui.cpp  \
+           ./src/hsscene.cpp \
+           ./src/hsshortcutservice.cpp \
+           ./src/hswallpaper.cpp \
+           ./src/hswallpaperloader.cpp \
+           ./src/hswallpaperloaderthread.cpp \
            ./src/hswidgethost.cpp \
            ./src/hswidgetcomponentregistry.cpp \
            ./src/hswidgetcomponent.cpp \
            ./src/hswidgetcomponentdescriptor.cpp \
            ./src/hsbackuprestoreobserver.cpp \
-	   ./src/hsconfiguration.cpp     
+           ./src/hsconfiguration.cpp
 
 symbian: {
 HEADERS += ./inc/hsbackuprestoreobserver_p.h \
            ./inc/hsbackuprestoreactivecallback.h
 SOURCES += ./src/hsbackuprestoreactivecallback.cpp
-}                              
+}
 
-                              
 
+
--- a/homescreenapp/hsdomainmodel/inc/hsbackuprestoreactivecallback.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsbackuprestoreactivecallback.h	Wed Jun 23 18:03:36 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  Home screen active callback in HsBackupRestoreObserver.
+* Description: Active callback for Backup/Restore observer.
 *
 */
 
@@ -19,17 +19,12 @@
 #ifndef HSBACKUPRESTOREACTIVECALLBACK_H
 #define HSBACKUPRESTOREACTIVECALLBACK_H
 
-#include <e32base.h>    // CBase
+#include <e32base.h>
 #include <connect/abclient.h>
 
 class HsBackupRestoreObserver;
 
-/**
- *  Home screen active callback in backup/restore.
- *
- *  @lib hsdomainmodel
- *  @since S60 ^4
- */
+
 NONSHARABLE_CLASS(CHsBURActiveCallback) : public CBase, 
 	                                     public conn::MActiveBackupDataClient
     {
@@ -39,161 +34,21 @@
 
     virtual ~CHsBURActiveCallback();    
 
-// new functions
-
-// from base class MActiveBackupDataClient
-
-    /**
-     * This method informs the active backup data client that all 
-     * snapshots have been supplied. If the client has not
-     * received a snapshot then it should perform a base backup
-     */
+    // new functions from base class MActiveBackupDataClient
     virtual void AllSnapshotsSuppliedL();
-
-    /**
-     * This method receives all or part of a snapshot of data to allow 
-     * calculation of an incremental backup.  The snapshot is one that
-     * was previously supplied by the data owner.  The snapshot data 
-     * should be read from the location supplied. The snapshot data may
-     * be larger than the location supplied in which case the routine 
-     * will be called repeatedly until all data has been supplied.
-     *
-     * Snapshot data will also be supplied as part of a restore operation
-     *        
-     * @param aDrive the drive being backed up
-     * @param aBuffer a pointer to the base of the location from whence 
-     *        data can be copied.
-     * @param aLastSection ETrue if this is the last section of snapshot 
-     *        data, else EFalse.
-     */
     virtual void ReceiveSnapshotDataL(
         TDriveNumber aDrive, TDesC8& aBuffer, TBool aLastSection);
-
-    /**
-     * This method returns the expected size of backup data that will be
-     * supplied. If an incremental backup is underway then this method
-     * then this method will not be called until after 
-     * ReceiveSnapshotDataL(). The size data will be used for the purpose
-     * of tracking progess during a backup. If it is inaccurate then the
-     * user may see irregular progress but the actual backup data will 
-     * not be affected so it is acceptable to return an estimated value.
-     *
-     * @param aDrive the drive being backed up.
-     * @return the size of the data that will be returned
-     */
     virtual TUint GetExpectedDataSize(TDriveNumber aDrive);
-
-    /**
-     * This method returns a snapshot of data to accompany a backup. The 
-     * snapshot is expected to contain details on files / data being 
-     * backed up. The format of the snapshot is only meaningful to the
-     * data owner. The snapshot will be supplied if the data owner is 
-     * asked for an incremental backup and for a restore operation. The 
-     * snapshot data should be copied to the location supplied.
-     *
-     * The snapshot data may be larger than the location supplied in 
-     * which case the routine will be called repeatedly until all data
-     * has been retrieved.
-     *
-     * @param aDrive the drive being backed up
-     * @param aBuffer a pointer to the base of the location where data 
-     *        can be copied.
-     * @param aFinished on return ETrue if all data has been returned 
-     *        for this drive, else EFalse.
-     */
     virtual void GetSnapshotDataL( 
         TDriveNumber aDrive, TPtr8& aBuffer, TBool& aFinished);
-
-    /**
-     * This method prepares the implementor to return backup data. It 
-     * will be followed by a sequence of calls to request the actual 
-     * data.
-     *        
-     * @param aDrive the drive being backed up.
-     */
     virtual void InitialiseGetBackupDataL(TDriveNumber aDrive);
-
-    /**
-     * This method requests a section of backup data.  
-     * InitialiseGetBackupDataL() will have been called previously to
-     * specify the drive concerned.  The data returned may be base or
-     * incremental depending on the type of backup and the capability of
-     * the data owner.
-     *
-     * @param aBuffer a pointer to the base of the location where data 
-     *        can be copied.
-     * @param aFinished on return ETrue if all data has been returned 
-     *        for this drive, else EFalse.
-     */
     virtual void GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished);
-
-    /**
-     * This method prepares the implementor to receive base restore data
-     * for a drive. It will be followed by a sequence of calls to supply
-     * the actual data.
-     *
-     * @param aDrive the drive being restored.
-     */
     virtual void InitialiseRestoreBaseDataL(TDriveNumber aDrive);
-
-    /**
-     * This method receives a section of base restore data.
-     * InitialiseRestoreBaseDataL() will have been called previously to 
-     * specify the drive concerned.
-     *
-     * @param aBuffer a pointer to the base of the location whence data
-     *        can be read.
-     * @param aFinished ETrue if all data has been returned for this 
-     *        drive, else EFalse.
-     */
     virtual void RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished);
-
-    /**
-     * This method prepares the implementor to receive incremental 
-     * restore data for a drive. It will be followed by a sequence 
-     * of calls to supply the actual data.  If multiple increments
-     * are supplied then this methid will be called before each increment
-     *
-     * @param aDrive the drive being restored.
-     */
     virtual void InitialiseRestoreIncrementDataL(TDriveNumber aDrive);
-
-    /**
-     * This method receives a section of increment restore data.
-     * InitialiseRestoreIncrementDataL() will have been called 
-     * previously to specify the drive concerned.
-     *
-     * @param aBuffer a pointer to the base of the location whence data 
-     *        can be read.
-     * @param aFinished ETrue if all data has been returned for this 
-     *        increment, else EFalse.
-     */
     virtual void RestoreIncrementDataSectionL(TDesC8& aBuffer, TBool aFinished);
-
-    /**
-     * This method is called when all data to be restored has been 
-     * supplied.
-     *
-     * @param aDrive the drive being restored.
-     */
     virtual void RestoreComplete(TDriveNumber aDrive);   
-
-    /**
-     * This method is called if copying of data is terminated prematurely 
-     * to allow the implementor to tidy up.  The same method applies to 
-     * all types of data and to backup and restore.
-     */
     virtual void TerminateMultiStageOperation();
-
-    /**
-     * Gets a 32-bit checksum for its private data.
-     * This routine is for test purposes.  It must be implemented but an
-     * invariant checksum value can be provided.  Some tests may cause 
-     * checksum values to be compared.
-     *
-     * @param aDrive the drive containing data being checksummed
-     * @return the 32-bit checksum
-     */
     virtual TUint GetDataChecksum(TDriveNumber aDrive);
 
 private:
@@ -201,7 +56,7 @@
 
     void ConstructL();
 
-private: // data
+private:
 	// Bacup/Restore observer. Not own.
     HsBackupRestoreObserver *iObserver;
     };
--- a/homescreenapp/hsdomainmodel/inc/hsbackuprestoreobserver.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsbackuprestoreobserver.h	Wed Jun 23 18:03:36 2010 +0300
@@ -22,7 +22,7 @@
 #include "hsdomainmodel_global.h"
 #include "hstest_global.h"
 
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 
 #ifdef Q_OS_SYMBIAN
 class HsBackupRestoreObserverPrivate;
@@ -37,14 +37,14 @@
 	~HsBackupRestoreObserver();
 	
 	void backupRestoreStarted();
-    void backupRestoreComplited();
+    void backupRestoreCompleted();
     
     void readyForBUR();
     bool checkBUR();
 
 signals:	
     void event_backupRestoreStarted();
-    void event_backupRestoreComplited();	
+    void event_backupRestoreCompleted();	
 
 private:
 	HsBackupRestoreObserver(QObject *parent = 0);
@@ -67,7 +67,7 @@
 #ifdef Q_OS_SYMBIAN
     friend class HsBackupRestoreObserverPrivate;
 #endif //Q_OS_SYMBIAN
-    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
 };
 
 #endif // HSBACKUPRESTOREOBSERVER_H
--- a/homescreenapp/hsdomainmodel/inc/hsconfiguration.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsconfiguration.h	Wed Jun 23 18:03:36 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -19,148 +19,226 @@
 #define HSCONFIGURATION_H
 
 #include <QObject>
+#include <QVariant>
 
 #include <HbFeedback>
-#include <HbDeviceProfile>
 
 #include "hsdomainmodel_global.h"
 
-class HsGeneralConfiguration;
-class HsFeedbackConfiguration;
-class HsSnapConfiguration;
-class HsDatabase;
-class HsConfiguration;
+#include "hstest_global.h"
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 
-class HSDOMAINMODEL_EXPORT HsConfiguration
-{
-    
-public:
-    static void loadConfiguration();
+#define HSCONFIGURATION_GET(getter) \
+    HsConfiguration::instance()->getter()
+#define HSCONFIGURATION_SET(setter, value) \
+    HsConfiguration::instance()->setter(value)
 
-    static inline int bounceEffect() { return mBounceEffect; };
-    static inline qreal tapAndHoldDistance() { return mTapAndHoldDistance; };
-    static inline int widgetTapAndHoldTimeout() { return mWidgetTapAndHoldTimeout; };
-    static inline int sceneTapAndHoldTimeout() { return mSceneTapAndHoldTimeout; };
-    static inline qreal pageChangeZoneWidth() { return mPageChangeZoneWidth; };
-    static inline qreal pageIndicatorSpacing() { return mPageIndicatorSpacing; };
-    static inline int pageChangeAnimationDuration() { return mPageChangeAnimationDuration; };
-    static inline int pageChangeZoneAnimationDuration() { return mPageChangeZoneAnimationDuration; };
-    static inline int pageChangeZoneReverseAnimationDuration() { return mPageChangeZoneReverseAnimationDuration; };
-    static inline int pageRemovedAnimationDuration() { return mPageRemovedAnimationDuration; };
-    static inline int newPageAddedAnimationDuration() { return mNewPageAddedAnimationDuration; };
-    static inline int widgetDragEffectDuration() { return mWidgetDragEffectDuration; };
-    static inline int widgetDropEffectDuration() { return mWidgetDropEffectDuration; };
-    static inline int bounceFeedbackEffectDistance() { return mBounceFeedbackEffectDistance; };
-    static inline int defaultPageId() { return mDefaultPageId; };
-    static inline int maximumPageCount() { return mMaximumPageCount; };
-    static inline qreal maximumWidgetHeight() { return mMaximumWidgetHeight; };
-    static inline qreal maximumWidgetWidth() { return mMaximumWidgetWidth; };
-    static inline qreal minimumWidgetHeight() { return mMinimumWidgetHeight; };
-    static inline qreal minimumWidgetWidth() { return mMinimumWidgetWidth; };
-    static inline bool shortcutLabelsVisible() { return mShortcutLabelsVisible; };
-    static inline qreal pageChangePanDistance() { return mPageChangePanDistance; };
-    static inline int pageChangePanDistanceInPixels() { return mPageChangePanDistanceInPixels; };
+class HSDOMAINMODEL_EXPORT HsConfiguration : public QObject
+{
+    Q_OBJECT
+    Q_PROPERTY(int bounceEffect READ bounceEffect WRITE setBounceEffect)
+    Q_PROPERTY(int widgetTapAndHoldTimeout READ widgetTapAndHoldTimeout WRITE setWidgetTapAndHoldTimeout)
+    Q_PROPERTY(int sceneTapAndHoldTimeout READ sceneTapAndHoldTimeout WRITE setSceneTapAndHoldTimeout)
+    Q_PROPERTY(int pageChangeAnimationDuration READ pageChangeAnimationDuration WRITE setPageChangeAnimationDuration)
+    Q_PROPERTY(int pageChangeZoneAnimationDuration READ pageChangeZoneAnimationDuration WRITE setPageChangeZoneAnimationDuration)
+    Q_PROPERTY(int pageChangeZoneReverseAnimationDuration READ pageChangeZoneReverseAnimationDuration WRITE setPageChangeZoneReverseAnimationDuration)
+    Q_PROPERTY(int pageRemovedAnimationDuration READ pageRemovedAnimationDuration WRITE setPageRemovedAnimationDuration)
+    Q_PROPERTY(int newPageAddedAnimationDuration READ newPageAddedAnimationDuration WRITE setNewPageAddedAnimationDuration)
+    Q_PROPERTY(int widgetDragEffectDuration READ widgetDragEffectDuration WRITE setWidgetDragEffectDuration)
+    Q_PROPERTY(int widgetDropEffectDuration READ widgetDropEffectDuration WRITE setWidgetDropEffectDuration)
+    Q_PROPERTY(int defaultPageId READ defaultPageId WRITE setDefaultPageId)
+    Q_PROPERTY(int maximumPageCount READ maximumPageCount WRITE setMaximumPageCount)    
+    Q_PROPERTY(bool isShortcutLabelVisible READ isShortcutLabelVisible WRITE setShortcutLabelVisible)
+    Q_PROPERTY(qreal bounceFeedbackEffectDistance READ bounceFeedbackEffectDistance WRITE setBounceFeedbackEffectDistance)
+    Q_PROPERTY(qreal pageChangePanDistanceInPixels READ pageChangePanDistanceInPixels WRITE setPageChangePanDistanceInPixels)
+    Q_PROPERTY(qreal tapAndHoldDistance READ tapAndHoldDistance WRITE setTapAndHoldDistance)
+    Q_PROPERTY(qreal pageChangeZoneWidth READ pageChangeZoneWidth WRITE setPageChangeZoneWidth)
+    Q_PROPERTY(qreal pageIndicatorSpacing READ pageIndicatorSpacing WRITE setPageIndicatorSpacing)
+    Q_PROPERTY(qreal maximumWidgetHeight READ maximumWidgetHeight WRITE setMaximumWidgetHeight)
+    Q_PROPERTY(qreal maximumWidgetWidth READ maximumWidgetWidth WRITE setMaximumWidgetWidth)
+    Q_PROPERTY(qreal minimumWidgetHeight READ minimumWidgetHeight WRITE setMinimumWidgetHeight)
+    Q_PROPERTY(qreal minimumWidgetWidth READ minimumWidgetWidth WRITE setMinimumWidgetWidth)
+    Q_PROPERTY(qreal pageChangePanDistance READ pageChangePanDistance WRITE setPageChangePanDistance)
+    Q_PROPERTY(HbFeedback::InstantEffect pageChangeFeedbackEffect READ pageChangeFeedbackEffect WRITE setPageChangeFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect widgetPickFeedbackEffect READ widgetPickFeedbackEffect WRITE setWidgetPickFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect widgetDropFeedbackEffect READ widgetDropFeedbackEffect WRITE setWidgetDropFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect widgetRepositionFeedbackEffect READ widgetRepositionFeedbackEffect WRITE setWidgetRepositionFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect widgetOverTrashbinFeedbackEffect READ widgetOverTrashbinFeedbackEffect WRITE setWidgetOverTrashbinFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect widgetDropToTrashbinFeedbackEffect READ widgetDropToTrashbinFeedbackEffect WRITE setWidgetDropToTrashbinFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect shortcutWidgetTapFeedbackEffect READ shortcutWidgetTapFeedbackEffect WRITE setShortcutWidgetTapFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect widgetMoveBlockedFeedbackEffect READ widgetMoveBlockedFeedbackEffect WRITE setWidgetMoveBlockedFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect clockWidgetTapFeedbackEffect READ clockWidgetTapFeedbackEffect WRITE setClockWidgetTapFeedbackEffect)
+    Q_PROPERTY(HbFeedback::InstantEffect widgetSnappingFeedbackEffect READ widgetSnappingFeedbackEffect WRITE setWidgetSnappingFeedbackEffect)
+    Q_PROPERTY(bool isSnapEnabled READ isSnapEnabled WRITE setSnapEnabled)
+    Q_PROPERTY(int snapTimeout READ snapTimeout WRITE setSnapTimeout)
+    Q_PROPERTY(qreal snapForce READ snapForce WRITE setSnapForce)
+    Q_PROPERTY(qreal snapGap READ snapGap WRITE setSnapGap)
+    Q_PROPERTY(qreal snapBorderGap READ snapBorderGap WRITE setSnapBorderGap)
+    Q_PROPERTY(int snapLineFadeInDuration READ snapLineFadeInDuration WRITE setSnapLineFadeInDuration)
+    Q_PROPERTY(int snapLineFadeOutDuration READ snapLineFadeOutDuration WRITE setSnapLineFadeOutDuration)
+    Q_PROPERTY(bool isSnapEffectsEnabled READ isSnapEffectsEnabled WRITE setSnapEffectsEnabled)
+    Q_PROPERTY(SceneType sceneType READ sceneType WRITE setSceneType)
 
-    static inline HbFeedback::InstantEffect pageChangeFeedbackType() { return mPageChangeFeedbackType; };
-    static inline HbFeedback::InstantEffect widgetPickFeedbackType() { return mWidgetPickFeedbackType; };
-    static inline HbFeedback::InstantEffect widgetDropFeedbackType() { return mWidgetDropFeedbackType; };
-    static inline HbFeedback::InstantEffect widgetRepositionFeedbackType() { return mWidgetRepositionFeedbackType; };
-    static inline HbFeedback::InstantEffect widgetOverTrashbinFeedbackType() { return mWidgetOverTrashbinFeedbackType; };
-    static inline HbFeedback::InstantEffect widgetDropToTrashbinFeedbackType() { return mWidgetDropToTrashbinFeedbackType; };
-    static inline HbFeedback::InstantEffect shortcutWidgetTapFeedbackType() { return mShortcutWidgetTapFeedbackType; };
-    static inline HbFeedback::InstantEffect widgetMoveBlockedFeedbackType() { return mWidgetMoveBlockedFeedbackType; };
-    static inline HbFeedback::InstantEffect clockWidgetTapFeedbackType() { return mClockWidgetTapFeedbackType; };
-    static inline HbFeedback::InstantEffect widgetSnappingFeedbackType() { return mWidgetSnappingFeedbackType; };
+    Q_ENUMS(SceneType)
+
+public:
+    HsConfiguration(QObject *parent = 0);
+    ~HsConfiguration();
+
+    enum SceneType
+    {
+        PageWallpapers,
+        SceneWallpaper
+    };
 
-    static inline bool snapEnabled() { return mSnapEnabled; };
-    static inline qreal snapForce() { return mSnapForce; };
-    static inline qreal snapGap() { return mSnapGap; };
-    static inline qreal snapBorderGap() { return mSnapBorderGap; };
-    static inline int snapTimeout() { return mSnapTimeout; };
-
-    // setters should be removed before code is released to SF
-    static void setBounceEffect(int bounceEffect) { mBounceEffect = bounceEffect; };
-    static void setTapAndHoldDistance(qreal tapAndHoldDistance) { mTapAndHoldDistance = tapAndHoldDistance; };
-    static void setWidgetTapAndHoldTimeout(int tapAndHoldTimeout) { mWidgetTapAndHoldTimeout = tapAndHoldTimeout; };
-    static void setSceneTapAndHoldTimeout(int tapAndHoldTimeout) { mSceneTapAndHoldTimeout = tapAndHoldTimeout; };
-    static void setPageChangeZoneWidth(qreal pageChangeZoneWidth) { mPageChangeZoneWidth = pageChangeZoneWidth; };
-    static void setPageIndicatorSpacing(qreal pageIndicatorSpacing) { mPageIndicatorSpacing = pageIndicatorSpacing; };
-    static void setPageChangeAnimationDuration(int pageChangeAnimationDuration) { mPageChangeAnimationDuration = pageChangeAnimationDuration; };
-    static void setPageChangeZoneAnimationDuration(int pageChangeZoneAnimationDuration) { mPageChangeZoneAnimationDuration = pageChangeZoneAnimationDuration; };
-    static void setPageChangeZoneReverseAnimationDuration(int pageChangeZoneReverseAnimationDuration) { mPageChangeZoneReverseAnimationDuration = pageChangeZoneReverseAnimationDuration; };
-    static void setPageRemovedAnimationDuration(int pageRemovedAnimationDuration) { mPageRemovedAnimationDuration = pageRemovedAnimationDuration; };
-    static void setNewPageAddedAnimationDuration(int newPageAddedAnimationDuration) { mNewPageAddedAnimationDuration = newPageAddedAnimationDuration; };
-    static void setWidgetDragEffectDuration(int widgetDragEffectDuration) { mWidgetDragEffectDuration = widgetDragEffectDuration; };
-    static void setWidgetDropEffectDuration(int widgetDropEffectDuration) { mWidgetDropEffectDuration = widgetDropEffectDuration; };
-    static void setBounceFeedbackEffectDistance(int bounceFeedbackEffectDistance) { mBounceFeedbackEffectDistance = bounceFeedbackEffectDistance; };
-    static void setDefaultPageId(int defaultPageId) { mDefaultPageId = defaultPageId;  };
-    static void setMaximumPageCount(int maximumPageCount) { mMaximumPageCount = maximumPageCount; };
-    static void setMaximumWidgetHeight(qreal maximumWidgetHeight) { mMaximumWidgetHeight = maximumWidgetHeight; };
-    static void setMaximumWidgetWidth(qreal maximumWidgetWidth) { mMaximumWidgetWidth = maximumWidgetWidth; };
-    static void setMinimumWidgetHeight(qreal minimumWidgetHeight) { mMinimumWidgetHeight = minimumWidgetHeight; };
-    static void setMinimumWidgetWidth(qreal minimumWidgetWidth) { mMinimumWidgetWidth = minimumWidgetWidth; };
-    static void setShortcutLabelsVisible(bool shortcutLabelsVisible) { mShortcutLabelsVisible = shortcutLabelsVisible; };
-    static void setPageChangePanDistance(qreal pageChangePanDistance) { mPageChangePanDistance = pageChangePanDistance; 
-                                                                        mPageChangePanDistanceInPixels = pageChangePanDistance * HbDeviceProfile::current().unitValue(); };
-
-    static void setPageChangeFeedbackType(HbFeedback::InstantEffect pageChangeFeedbackType ) { mPageChangeFeedbackType = pageChangeFeedbackType; };
-    static void setWidgetPickFeedbackType(HbFeedback::InstantEffect widgetPickFeedbackType ) { mWidgetPickFeedbackType = widgetPickFeedbackType; };
-    static void setWidgetDropFeedbackType(HbFeedback::InstantEffect widgetDropFeedbackType ) { mWidgetDropFeedbackType = widgetDropFeedbackType; };
-    static void setWidgetRepositionFeedbackType(HbFeedback::InstantEffect widgetRepositionFeedbackType ) { mWidgetRepositionFeedbackType = widgetRepositionFeedbackType; };
-    static void setWidgetOverTrashbinFeedbackType(HbFeedback::InstantEffect widgetOverTrashbinFeedbackType ) { mWidgetOverTrashbinFeedbackType = widgetOverTrashbinFeedbackType; };
-    static void setWidgetDropToTrashbinFeedbackType(HbFeedback::InstantEffect widgetDropToTrashbinFeedbackType ) { mWidgetDropToTrashbinFeedbackType = widgetDropToTrashbinFeedbackType; };
-    static void setShortcutWidgetTapFeedbackType(HbFeedback::InstantEffect shortcutWidgetTapFeedbackType ) { mShortcutWidgetTapFeedbackType = shortcutWidgetTapFeedbackType; };
-    static void setWidgetMoveBlockedFeedbackType(HbFeedback::InstantEffect widgetMoveBlockedFeedbackType ) { mWidgetMoveBlockedFeedbackType = widgetMoveBlockedFeedbackType; };
-    static void setClockWidgetTapFeedbackType(HbFeedback::InstantEffect clockWidgetTapFeedbackType ) { mClockWidgetTapFeedbackType = clockWidgetTapFeedbackType; };
-    static void setWidgetSnappingFeedbackType(HbFeedback::InstantEffect widgetSnappingFeedbackType ) { mWidgetSnappingFeedbackType = widgetSnappingFeedbackType; };
-
-    static void setSnapEnabled(bool snapEnabled) { mSnapEnabled = snapEnabled; };
-    static void setSnapForce(qreal snapForce) { mSnapForce = snapForce; };
-    static void setSnapGap(qreal snapGap) { mSnapGap = snapGap; };
-    static void setSnapBorderGap(qreal snapBorderGap) { mSnapBorderGap = snapBorderGap; };
-    static void setSnapTimeout(int snapTimeout) { mSnapTimeout = snapTimeout; };
+    int bounceEffect() const { return mBounceEffect; }
+    void setBounceEffect(int effect) { mBounceEffect = effect; }
+    int widgetTapAndHoldTimeout() const { return mWidgetTapAndHoldTimeout; }
+    void setWidgetTapAndHoldTimeout(int timeout) { mWidgetTapAndHoldTimeout = timeout; }
+    int sceneTapAndHoldTimeout() const { return mSceneTapAndHoldTimeout; }
+    void setSceneTapAndHoldTimeout(int timeout) { mSceneTapAndHoldTimeout = timeout; }
+    int pageChangeAnimationDuration() const { return mPageChangeAnimationDuration; }
+    void setPageChangeAnimationDuration(int duration) { mPageChangeAnimationDuration = duration; }    
+    int pageChangeZoneAnimationDuration() const { return mPageChangeZoneAnimationDuration; }
+    void setPageChangeZoneAnimationDuration(int duration) { mPageChangeZoneAnimationDuration = duration; }    
+    int pageChangeZoneReverseAnimationDuration() const { return mPageChangeZoneReverseAnimationDuration; }
+    void setPageChangeZoneReverseAnimationDuration(int duration) { mPageChangeZoneReverseAnimationDuration = duration; }
+    int pageRemovedAnimationDuration() const { return mPageRemovedAnimationDuration; }
+    void setPageRemovedAnimationDuration(int duration) { mPageRemovedAnimationDuration = duration; }    
+    int newPageAddedAnimationDuration() const { return mNewPageAddedAnimationDuration; }
+    void setNewPageAddedAnimationDuration(int duration) { mNewPageAddedAnimationDuration = duration; }  
+    int widgetDragEffectDuration() const { return mWidgetDragEffectDuration; }
+    void setWidgetDragEffectDuration(int duration) { mWidgetDragEffectDuration = duration; }  
+    int widgetDropEffectDuration() const { return mWidgetDropEffectDuration; }
+    void setWidgetDropEffectDuration(int duration) { mWidgetDropEffectDuration = duration; }  
+    int defaultPageId() const { return mDefaultPageId; }
+    void setDefaultPageId(int id) { mDefaultPageId = id; }
+    int maximumPageCount() const { return mMaximumPageCount; }
+    void setMaximumPageCount(int count) { mMaximumPageCount = count; }  
+    bool isShortcutLabelVisible() const { return mIsShortcutLabelVisible; }
+    void setShortcutLabelVisible(bool visible) { mIsShortcutLabelVisible = visible; }  
+    qreal bounceFeedbackEffectDistance() const { return mBounceFeedbackEffectDistance; }
+    void setBounceFeedbackEffectDistance(qreal distance) { mBounceFeedbackEffectDistance = distance; }  
+    qreal pageChangePanDistanceInPixels() const { return mPageChangePanDistanceInPixels; }
+    void setPageChangePanDistanceInPixels(qreal distance) { mPageChangePanDistanceInPixels = distance; }  
+    qreal tapAndHoldDistance() const { return mTapAndHoldDistance; }
+    void setTapAndHoldDistance(qreal distance) { mTapAndHoldDistance = distance; }  
+    qreal pageChangeZoneWidth() const { return mPageChangeZoneWidth; }
+    void setPageChangeZoneWidth(qreal width) { mPageChangeZoneWidth = width; }  
+    qreal pageIndicatorSpacing() const { return mPageIndicatorSpacing; }
+    void setPageIndicatorSpacing(qreal spacing) { mPageIndicatorSpacing = spacing; }
+    qreal maximumWidgetHeight() const { return mMaximumWidgetHeight; }
+    void setMaximumWidgetHeight(qreal height) { mMaximumWidgetHeight = height; }  
+    qreal maximumWidgetWidth() const { return mMaximumWidgetWidth; }
+    void setMaximumWidgetWidth(qreal width) { mMaximumWidgetWidth = width; }  
+    qreal minimumWidgetHeight() const { return mMinimumWidgetHeight; }
+    void setMinimumWidgetHeight(qreal height) { mMinimumWidgetHeight = height; }
+    qreal minimumWidgetWidth() const { return mMinimumWidgetWidth; }
+    void setMinimumWidgetWidth(qreal width) { mMinimumWidgetWidth = width; }  
+    qreal pageChangePanDistance() const { return mPageChangePanDistance; }
+    void setPageChangePanDistance(qreal distance) { mPageChangePanDistance = distance; }  
+    HbFeedback::InstantEffect pageChangeFeedbackEffect() const { return mPageChangeFeedbackEffect; }
+    void setPageChangeFeedbackEffect(HbFeedback::InstantEffect effect) { mPageChangeFeedbackEffect = effect; }   
+    HbFeedback::InstantEffect widgetPickFeedbackEffect() const { return mWidgetPickFeedbackEffect; }
+    void setWidgetPickFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetPickFeedbackEffect = effect; }  
+    HbFeedback::InstantEffect widgetDropFeedbackEffect() const { return mWidgetDropFeedbackEffect; }
+    void setWidgetDropFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetDropFeedbackEffect = effect; }  
+    HbFeedback::InstantEffect widgetRepositionFeedbackEffect() const { return mWidgetRepositionFeedbackEffect; }
+    void setWidgetRepositionFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetRepositionFeedbackEffect = effect; } 
+    HbFeedback::InstantEffect widgetOverTrashbinFeedbackEffect() const { return mWidgetOverTrashbinFeedbackEffect; }
+    void setWidgetOverTrashbinFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetOverTrashbinFeedbackEffect = effect; } 
+    HbFeedback::InstantEffect widgetDropToTrashbinFeedbackEffect() const { return mWidgetDropToTrashbinFeedbackEffect; }
+    void setWidgetDropToTrashbinFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetDropToTrashbinFeedbackEffect = effect; } 
+    HbFeedback::InstantEffect shortcutWidgetTapFeedbackEffect() const { return mShortcutWidgetTapFeedbackEffect; }
+    void setShortcutWidgetTapFeedbackEffect(HbFeedback::InstantEffect effect) { mShortcutWidgetTapFeedbackEffect = effect; } 
+    HbFeedback::InstantEffect widgetMoveBlockedFeedbackEffect() const { return mWidgetMoveBlockedFeedbackEffect; }
+    void setWidgetMoveBlockedFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetMoveBlockedFeedbackEffect = effect; } 
+    HbFeedback::InstantEffect clockWidgetTapFeedbackEffect() const { return mClockWidgetTapFeedbackEffect; }
+    void setClockWidgetTapFeedbackEffect(HbFeedback::InstantEffect effect) { mClockWidgetTapFeedbackEffect = effect; } 
+    HbFeedback::InstantEffect widgetSnappingFeedbackEffect() const { return mWidgetSnappingFeedbackEffect; }
+    void setWidgetSnappingFeedbackEffect(HbFeedback::InstantEffect effect) { mWidgetSnappingFeedbackEffect = effect; }
+    bool isSnapEnabled() const { return mIsSnapEnabled; }
+    void setSnapEnabled(bool enabled) { mIsSnapEnabled = enabled; }
+    int snapTimeout() const { return mSnapTimeout; }
+    void setSnapTimeout(int timeout) { mSnapTimeout = timeout; }
+    qreal snapForce() const { return mSnapForce; }
+    void setSnapForce(qreal force) { mSnapForce = force; }  
+    qreal snapGap() const { return mSnapGap; }
+    void setSnapGap(qreal gap) { mSnapGap = gap; }  
+    qreal snapBorderGap() const { return mSnapBorderGap; }
+    void setSnapBorderGap(qreal gap) { mSnapBorderGap = gap; }
+    int snapLineFadeInDuration() const { return mSnapLineFadeInDuration; }
+    void setSnapLineFadeInDuration(int duration) { mSnapLineFadeInDuration = duration; }
+    int snapLineFadeOutDuration() const { return mSnapLineFadeOutDuration; }
+    void setSnapLineFadeOutDuration(int duration) { mSnapLineFadeOutDuration = duration; }
+    bool isSnapEffectsEnabled() const { return mIsSnapEffectsEnabled; }
+    void setSnapEffectsEnabled(bool enabled) { mIsSnapEffectsEnabled = enabled; }
+    SceneType sceneType() const { return mSceneType; }
+    void setSceneType(SceneType type) { mSceneType = type; }
+     
+    QSizeF minimumWidgetSizeInUnits() const;
+    QSizeF maximumWidgetSizeInUnits() const;
+    QSizeF minimumWidgetSizeInPixels() const;
+    QSizeF maximumWidgetSizeInPixels() const;
+    
+    bool load();
+    bool importFromFile(const QString &path);
+    bool exportToFile(const QString &path);
+        
+    static HsConfiguration *instance();
+    static HsConfiguration *takeInstance();
+    static void setInstance(HsConfiguration *instance);
 
 private:
-    static int mBounceEffect;		
-	static qreal mTapAndHoldDistance;
-	static int mWidgetTapAndHoldTimeout;
-	static int mSceneTapAndHoldTimeout;
-    static qreal mPageChangeZoneWidth;
-	static qreal mPageIndicatorSpacing;
-    static int mPageChangeAnimationDuration;
-	static int mPageChangeZoneAnimationDuration;
-    static int mPageChangeZoneReverseAnimationDuration;
-	static int mPageRemovedAnimationDuration;
-	static int mNewPageAddedAnimationDuration;
-	static int mWidgetDragEffectDuration;
-	static int mWidgetDropEffectDuration;
-	static int mBounceFeedbackEffectDistance;
-    static int mDefaultPageId;
-    static int mMaximumPageCount;
-    static qreal mMaximumWidgetHeight;
-    static qreal mMaximumWidgetWidth;
-    static qreal mMinimumWidgetHeight;
-    static qreal mMinimumWidgetWidth;
-    static bool mShortcutLabelsVisible;
-    static qreal mPageChangePanDistance;
-    static int mPageChangePanDistanceInPixels;
+    Q_DISABLE_COPY(HsConfiguration)
+    
+private:
+    int mBounceEffect;
+    int mWidgetTapAndHoldTimeout;
+    int mSceneTapAndHoldTimeout;
+    int mPageChangeAnimationDuration;
+    int mPageChangeZoneAnimationDuration;
+    int mPageChangeZoneReverseAnimationDuration;
+    int mPageRemovedAnimationDuration;
+    int mNewPageAddedAnimationDuration;
+    int mWidgetDragEffectDuration;
+    int mWidgetDropEffectDuration;
+    int mDefaultPageId;
+    int mMaximumPageCount;
+    bool mIsShortcutLabelVisible;
+    qreal mBounceFeedbackEffectDistance;
+    qreal mPageChangePanDistanceInPixels;
+    qreal mTapAndHoldDistance;
+    qreal mPageChangeZoneWidth;
+    qreal mPageIndicatorSpacing;
+    qreal mMaximumWidgetHeight;
+    qreal mMaximumWidgetWidth;
+    qreal mMinimumWidgetHeight;
+    qreal mMinimumWidgetWidth;
+    qreal mPageChangePanDistance;
+    HbFeedback::InstantEffect mPageChangeFeedbackEffect;
+    HbFeedback::InstantEffect mWidgetPickFeedbackEffect;
+    HbFeedback::InstantEffect mWidgetDropFeedbackEffect;
+    HbFeedback::InstantEffect mWidgetRepositionFeedbackEffect;
+    HbFeedback::InstantEffect mWidgetOverTrashbinFeedbackEffect;
+    HbFeedback::InstantEffect mWidgetDropToTrashbinFeedbackEffect;
+    HbFeedback::InstantEffect mShortcutWidgetTapFeedbackEffect;
+    HbFeedback::InstantEffect mWidgetMoveBlockedFeedbackEffect;
+    HbFeedback::InstantEffect mClockWidgetTapFeedbackEffect;
+    HbFeedback::InstantEffect mWidgetSnappingFeedbackEffect;
+    bool mIsSnapEnabled;
+    int mSnapTimeout;
+    qreal mSnapForce;
+    qreal mSnapGap;
+    qreal mSnapBorderGap;
+    int mSnapLineFadeInDuration;
+    int mSnapLineFadeOutDuration;
+    bool mIsSnapEffectsEnabled;
+    SceneType mSceneType;
 
-    static HbFeedback::InstantEffect mPageChangeFeedbackType;
-	static HbFeedback::InstantEffect mWidgetPickFeedbackType;
-	static HbFeedback::InstantEffect mWidgetDropFeedbackType;
-	static HbFeedback::InstantEffect mWidgetRepositionFeedbackType;
-	static HbFeedback::InstantEffect mWidgetOverTrashbinFeedbackType;
-	static HbFeedback::InstantEffect mWidgetDropToTrashbinFeedbackType;
-	static HbFeedback::InstantEffect mShortcutWidgetTapFeedbackType;
-	static HbFeedback::InstantEffect mWidgetMoveBlockedFeedbackType;
-	static HbFeedback::InstantEffect mClockWidgetTapFeedbackType;
-	static HbFeedback::InstantEffect mWidgetSnappingFeedbackType;
+    static HsConfiguration *mInstance;
 
-    static bool mSnapEnabled;
-    static qreal mSnapForce;
-    static qreal mSnapGap;
-    static qreal mSnapBorderGap;
-    static int mSnapTimeout;
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
 };
 
 #endif // HSCONFIGURATION_H
--- a/homescreenapp/hsdomainmodel/inc/hscontentservice.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hscontentservice.h	Wed Jun 23 18:03:36 2010 +0300
@@ -40,11 +40,14 @@
     bool addWidget(const QString &uri, const QVariantHash &preferences);
 
     static HsContentService *instance();
+private slots:
+    void widgetStartFaulted();
+private:
+    Q_DISABLE_COPY(HsContentService)
 
 private:
     static HsContentService *mInstance;
-
-    Q_DISABLE_COPY(HsContentService)
+    bool mWidgetStartFaulted;
 };
 
 Q_DECLARE_METATYPE(HsContentService*)
--- a/homescreenapp/hsdomainmodel/inc/hsdatabase.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsdatabase.h	Wed Jun 23 18:03:36 2010 +0300
@@ -19,20 +19,14 @@
 #define HSDATABASE_H
 
 #include <QObject>
-#include <QScopedPointer>
 #include <QVariantHash>
 
 #include "hsdomainmodel_global.h"
 
-#include <HbFeedback>
-
 class HsSceneData;
 class HsPageData;
 class HsWidgetData;
 class HsWidgetPresentationData;
-class HsGeneralConfiguration;
-class HsFeedbackConfiguration;
-class HsSnapConfiguration;
 
 class HSDOMAINMODEL_EXPORT HsDatabase : public QObject
 {
@@ -57,8 +51,7 @@
     bool commit();
 
     bool scene(HsSceneData &data);
-    bool updateScene(const HsSceneData &data);
-
+    
     bool pages(QList<HsPageData> &data);
     bool page(HsPageData &data);
     bool insertPage(HsPageData &data);
@@ -81,10 +74,8 @@
     bool widgetPreference(int widgetId, const QString &key, QVariant &value);
     bool setWidgetPreferences(int widgetId, const QVariantHash &data);
 
-    bool generalConfiguration(HsGeneralConfiguration &data);
-    bool feedbackConfiguration(HsFeedbackConfiguration &data);
-    bool snapConfiguration(HsSnapConfiguration &data);
-    
+    bool configuration(QVariantHash &configuration);
+
 public:
     static void setInstance(HsDatabase *instance);
     static HsDatabase *instance();
--- a/homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsdomainmodeldatastructures.h	Wed Jun 23 18:03:36 2010 +0300
@@ -18,10 +18,9 @@
 #ifndef HSDOMAINMODELDATASTRUCTURES_H
 #define HSDOMAINMODELDATASTRUCTURES_H
 
-#include <QRectF>
+#include <QPointF>
+
 #include "hsdomainmodel_global.h"
-#include <HbFeedback>
-#include <QMetaEnum>
 
 class HSDOMAINMODEL_EXPORT HsSceneData
 {
@@ -86,72 +85,4 @@
     int     widgetId;
 };
 
-class HSDOMAINMODEL_EXPORT HsGeneralConfiguration
-{	
-public:
-	int bounceEffect; // pixels, bounce effect reservation, half in left side and half in right side of wallpaper 		
-	qreal tapAndHoldDistance; // pixels
-    int widgetTapAndHoldTimeout; // ms, duration of long press before action is triggered on widget
-	int sceneTapAndHoldTimeout; // ms, duration of long press before action is triggered on background
-	qreal pageChangeZoneWidth; // pixels
-	qreal pageIndicatorSpacing; // pixels
-    int pageChangeAnimationDuration; // ms, this is how long page change animation takes
-	int pageChangeZoneAnimationDuration; // ms, this is how long crawling is done before page is actually changed
-    int pageChangeZoneReverseAnimationDuration; // ms, animation duration back to starting position when crawling ends before page is changed
-	int pageRemovedAnimationDuration; // ms
-	int newPageAddedAnimationDuration; // ms
-	int widgetDragEffectDuration; // ms
-	int widgetDropEffectDuration; // ms
-	int boundaryFeedbackEffectDistance; // pixels, when widget is moved within n pixels from first page right border or 
-                                        // n pixels from last page's left border, feedback effect is played
-    int defaultPageId; // id of default page (which cannot be removed)
-    int maximumPageCount; // maximum number of pages
-    qreal maximumWidgetHeight; // px
-    qreal maximumWidgetWidth; // px
-    qreal minimumWidgetHeight; // px
-    qreal minimumWidgetWidth; // px
-    bool shortcutLabelsVisible; // display labels under shortcut widgets
-    qreal pageChangePanDistance; // un, amount of pan needed to change page
-};
-
-class HSDOMAINMODEL_EXPORT HsFeedbackConfiguration
-{
-public: 
-    HbFeedback::InstantEffect feedbackFromString(const QString &feedback)
-    {
-    int index = HbFeedback::staticMetaObject.indexOfEnumerator("InstantEffect");
-    QMetaEnum metaEnum = HbFeedback::staticMetaObject.enumerator(index);
-
-    int intFeedback = metaEnum.keysToValue(feedback.toAscii());
-
-    if (intFeedback < HbFeedback::None || intFeedback > HbFeedback::InstantMaxUser) {
-        return HbFeedback::None;
-    } 
-
-    return static_cast<HbFeedback::InstantEffect>(intFeedback);
-    }
-
-public:
-	HbFeedback::InstantEffect pageChangeFeedbackType;
-	HbFeedback::InstantEffect widgetPickFeedbackType;
-	HbFeedback::InstantEffect widgetDropFeedbackType;
-	HbFeedback::InstantEffect widgetRepositionFeedbackType;
-	HbFeedback::InstantEffect widgetOverTrashbinFeedbackType;
-	HbFeedback::InstantEffect widgetDropToTrashbinFeedbackType;
-	HbFeedback::InstantEffect shortcutWidgetTapFeedbackType;
-	HbFeedback::InstantEffect widgetMoveBlockedFeedbackType;
-	HbFeedback::InstantEffect clockWidgetTapFeedbackType;
-	HbFeedback::InstantEffect widgetSnappingFeedbackType;
-};
-
-class HSDOMAINMODEL_EXPORT HsSnapConfiguration
-{	
-public:
-	bool snappingEnabled; // variable to tell if snapping is enabled or not
-	qreal snapForce; // this is the distance at which the widget starts being attracted to the line
-	qreal snapGap; // the gap at which the objects settle into from each other when they snap
-	qreal borderGap; // (the gap from the border edges when the widget settles on the edges of the page
-	int timeout; // time in milliseconds after which the snapping line will be shown
-};
-
 #endif // HSDOMAINMODELDATASTRUCTURES_H
--- a/homescreenapp/hsdomainmodel/inc/hspage.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hspage.h	Wed Jun 23 18:03:36 2010 +0300
@@ -25,8 +25,9 @@
 
 class HsWidgetHost;
 class HsPageData;
+class HsWallpaper;
 
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 
 class HSDOMAINMODEL_EXPORT HsPage : public HbWidget
 {
@@ -42,12 +43,15 @@
 
     bool load();
 
+    HsWallpaper *wallpaper() const;
+
     bool addExistingWidget(HsWidgetHost *widgetHost);
     bool removeWidget(HsWidgetHost *widgeHost);
 
     QList<HsWidgetHost *> newWidgets();
     bool addNewWidget(HsWidgetHost *widgetHost);
     void layoutNewWidgets();
+    void resetNewWidgets();
     bool deleteFromDatabase();
 
     QList<HsWidgetHost *> widgets() const;
@@ -55,6 +59,7 @@
     bool isRemovable() const;
     void setRemovable(bool removable);
 
+    bool isDefaultPage() const;
     bool isActivePage() const;
     
     static HsPage *createInstance(const HsPageData &pageData);
@@ -84,12 +89,13 @@
 
 private:
     int mDatabaseId;
+    HsWallpaper *mWallpaper;
     bool mRemovable;
     QList<HsWidgetHost*> mWidgets;
     QList<HsWidgetHost*> mNewWidgets;
     QList<HsWidgetHost*> mUnavailableWidgets;
 
-    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
 };
 
 #endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsdomainmodel/inc/hspagenewwidgetlayout.h	Wed Jun 23 18:03:36 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 HSPAGENEWWIDGETLAYOUT_H
+#define HSPAGENEWWIDGETLAYOUT_H
+
+#include <QGraphicsLayout>
+#include "hstest_global.h"
+
+HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+class HsWidgetHost;
+class HsPageNewWidgetLayout : public QGraphicsLayout 
+{
+public: 
+    HsPageNewWidgetLayout(QGraphicsLayoutItem *parent = 0);
+    ~HsPageNewWidgetLayout();
+        
+    int count() const;
+    QGraphicsLayoutItem *itemAt(int i) const;
+    void removeAt(int index);
+    QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
+    void setGeometry(const QRectF &rect);
+    
+    void addItem(HsWidgetHost *item);
+    
+private:
+    QSizeF mSize;
+    QList<HsWidgetHost*> mNewWidgets;
+    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+};
+
+
+#endif
--- a/homescreenapp/hsdomainmodel/inc/hsscene.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsscene.h	Wed Jun 23 18:03:36 2010 +0300
@@ -25,7 +25,7 @@
 #include "hsdomainmodel_global.h"
 #include "hstest_global.h"
 
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest)
 
 class HbMainWindow;
@@ -39,6 +39,7 @@
     Q_OBJECT
 
 public:
+    HsScene(QObject *parent = 0);
     ~HsScene();
 
     int databaseId() const;
@@ -56,11 +57,7 @@
     bool setActivePageIndex(int index);
     HsPage *activePage() const;
     int activePageIndex() const;
-    int maximumPageCount() const;
-    QSizeF maximumWidgetSizeInPixels() const;
-    QSizeF minimumWidgetSizeInPixels() const;
-    QSizeF maximumWidgetSizeInUnits() const;
-    QSizeF minimumWidgetSizeInUnits() const;
+
     void setActiveWidget(HsWidgetHost *widget);
     HsWidgetHost *activeWidget() const;
 
@@ -68,6 +65,8 @@
     bool isOnline() const;
 
     static HsScene *instance();
+    static HsScene *takeInstance();
+    static void setInstance(HsScene *instance);
     static HbMainWindow *mainWindow();
     static Qt::Orientation orientation();
 
@@ -75,26 +74,19 @@
     bool eventFilter(QObject *watched, QEvent *event);
 
 private:
-    HsScene(QObject *parent = 0);
-    void calculateWidgetSizeLimitations();
     Q_DISABLE_COPY(HsScene)
 
 private:
-    int mDatabaseId;    
+    int mDatabaseId;
     HsWallpaper *mWallpaper;
     QList<HsPage *> mPages;
     HsPage *mActivePage;
     HsWidgetHost *mActiveWidget;
     bool mIsOnline;
-    int mMaximumPageCount;
-    QSizeF mMaximumWidgetSizeInPixels;
-    QSizeF mMinimumWidgetSizeInPixels;
-    QSizeF mMaximumWidgetSizeInUnits;
-    QSizeF mMinimumWidgetSizeInUnits;
-    
+
     static HsScene *mInstance;
 
-    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
     HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
 };
 
--- a/homescreenapp/hsdomainmodel/inc/hsshortcutservice.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hsshortcutservice.h	Wed Jun 23 18:03:36 2010 +0300
@@ -26,7 +26,7 @@
 #include "hsdomainmodel_global.h"
 #include "hstest_global.h"
 
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 
 class QStateMachine;
 class HsShortcutServicePrivate;
@@ -50,7 +50,7 @@
 	QScopedPointer<HsShortcutServicePrivate> mD; 	
     static HsShortcutService *mInstance;    
     
-    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
 };
 
 Q_DECLARE_METATYPE(HsShortcutService*)
--- a/homescreenapp/hsdomainmodel/inc/hswallpaper.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hswallpaper.h	Wed Jun 23 18:03:36 2010 +0300
@@ -19,13 +19,13 @@
 #define HSWALLPAPER_H
 
 #include <HbWidget>
-#include <QScopedPointer>
 #include "hsdomainmodel_global.h"
 #include "hstest_global.h"
 
 class HbIconItem;
+class HsWallpaperLoader;
 
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 
 class HSDOMAINMODEL_EXPORT HsWallpaper : public HbWidget
 {
@@ -35,36 +35,89 @@
     HsWallpaper(QGraphicsItem *parent = 0);
     ~HsWallpaper();
 
-    bool setImagesById(const QString &id = "d",
-                       const QString &ext = "png");
+signals:
+    void imageSet();
+    void imageSetFailed();
 
-    bool setImagesByPaths(const QString &landscapeImagePath,
-                          const QString &portraitImagePath);
-
-    void setPortraitImage(const QString &path, bool activate = false);
-    void setLandscapeImage(const QString &path, bool activate = false);
+public slots:
+    void setImage(const QString &path);
+    void setDefaultImage();
+    void remove();
 
-    bool removeImages();
+protected:
+    virtual QString wallpaperDirectory() const = 0;
+    virtual QVariantHash createTargets(const QString &sourcePath) = 0;
 
-    static QString wallpaperDirectory();
-    static QString wallpaperPath(Qt::Orientation orientation,
-                                 const QString &id = "d",
-                                 const QString &ext = "png");
+    bool setExistingImage();
+    QString rootDirectory() const;
 
-private:    
+private:
     Q_DISABLE_COPY(HsWallpaper)
 
 private slots:
-    void onOrientationChanged(Qt::Orientation orientation);
+    void onLoaderFinished();
+    void onLoaderFailed();
+    void updateIconItem(Qt::Orientation orientation);
+
+protected:
+    int mId;
 
 private:
-    QString mLImagePath;
-    QString mPImagePath;
-    Qt::Orientation mOrientation;
+    bool mIsDefaultImage;
+    QString mPortraitImagePath;
+    QString mLandscapeImagePath;
+    HbIconItem *mIconItem;
+    HsWallpaperLoader *mLoader;
+
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
+};
+
+class HsScene;
+class HSDOMAINMODEL_EXPORT HsSceneWallpaper : public HsWallpaper
+{
+    Q_OBJECT
+
+public:
+    HsSceneWallpaper(HsScene *scene, QGraphicsItem *parent = 0);
+    ~HsSceneWallpaper();
+
+    HsScene *scene() const { return mScene; }
+    void setScene(HsScene *scene);
+
+protected:
+    QString wallpaperDirectory() const;
+    QVariantHash createTargets(const QString &sourcePath);
+
+private:
+    Q_DISABLE_COPY(HsSceneWallpaper)
 
-    HbIconItem *mIconItem;
+private:
+    HsScene *mScene;
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
+};
+
+class HsPage;
+class HSDOMAINMODEL_EXPORT HsPageWallpaper : public HsWallpaper
+{
+    Q_OBJECT
+
+public:
+    HsPageWallpaper(HsPage *page, QGraphicsItem *parent = 0);
+    ~HsPageWallpaper();
     
-    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+    HsPage *page() const { return mPage; }
+    void setPage(HsPage *page);
+
+protected:
+    QString wallpaperDirectory() const;
+    QVariantHash createTargets(const QString &sourcePath);
+
+private:
+    Q_DISABLE_COPY(HsPageWallpaper)
+
+private:
+    HsPage *mPage;
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
 };
 
 #endif // HSWALLPAPER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsdomainmodel/inc/hswallpaperloader.h	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef HSWALLPAPERLOADER_H
+#define HSWALLPAPERLOADER_H
+
+#include <QObject>
+#include <QVariantHash>
+
+#include "hsdomainmodel_global.h"
+#include "hstest_global.h"
+
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
+
+class QThread;
+
+class HsWallpaperLoaderThread;
+
+class HSDOMAINMODEL_EXPORT HsWallpaperLoader : public QObject
+{
+    Q_OBJECT
+
+public:
+    HsWallpaperLoader(QObject *parent = 0);
+    ~HsWallpaperLoader();
+
+    void setSourcePath(const QString &path) { mSourcePath = path; }
+    
+    QVariantHash targets() const { return mTargets; }
+    void setTargets(const QVariantHash &targets) { mTargets = targets; }
+    
+    bool isRunning() const { return mIsRunning; }
+
+signals:
+    void finished();
+    void failed();
+
+public slots:
+    void start();
+    void cancel();
+
+private:
+    Q_DISABLE_COPY(HsWallpaperLoader)
+    void cleanup();
+    
+private slots:
+    void onThreadFinished();
+
+private:
+    bool mIsRunning;
+    QString mSourcePath;
+    QVariantHash mTargets;    
+    QList<HsWallpaperLoaderThread *> mThreads;
+    int mNumberOfFinishedThreads;
+    
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
+};
+
+#endif // HSWALLPAPERLOADER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsdomainmodel/inc/hswallpaperloaderthread.h	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef HSWALLPAPERLOADERTHREAD_H
+#define HSWALLPAPERLOADERTHREAD_H
+
+#include <QThread>
+#include <QString>
+#include <QRect>
+#include "hsdomainmodel_global.h"
+#include "hstest_global.h"
+
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
+
+class HSDOMAINMODEL_EXPORT HsWallpaperLoaderThread : public QThread
+{
+    Q_OBJECT
+
+public:
+    HsWallpaperLoaderThread(QObject *parent = 0);
+    ~HsWallpaperLoaderThread();
+
+    void setSourcePath(const QString &path) { mSourcePath = path; }
+    QString sourcePath() const { return mSourcePath; }
+
+    void setTargetPath(const QString &path) { mTargetPath = path; }
+    QString targetPath() const { return mTargetPath; }
+
+    void setTargetSize(const QSize &size) { mTargetSize = size; }
+    QSize targetSize() const { return mTargetSize; }
+
+    bool result() const { return mResult; }
+
+protected:
+    void run();
+
+private:
+    Q_DISABLE_COPY(HsWallpaperLoaderThread)
+
+private:
+    QString mSourcePath;
+    QString mTargetPath;
+    QSize mTargetSize;
+    bool mResult;
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
+};
+
+#endif // HSWALLPAPERLOADERTHREAD_H
--- a/homescreenapp/hsdomainmodel/inc/hswidgetcomponent.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hswidgetcomponent.h	Wed Jun 23 18:03:36 2010 +0300
@@ -24,7 +24,7 @@
 #include "hsdomainmodel_global.h"
 
 #include "hstest_global.h"
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 
 class HSDOMAINMODEL_EXPORT HsWidgetComponent : public QObject
 {
@@ -67,7 +67,7 @@
 	State mState;
 	friend class HsWidgetComponentRegistry;
 
-    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
 };
 
 #endif // HSWIDGETCOMPONENT_H
--- a/homescreenapp/hsdomainmodel/inc/hswidgetcomponentregistry.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hswidgetcomponentregistry.h	Wed Jun 23 18:03:36 2010 +0300
@@ -29,7 +29,7 @@
 #include "cadefs.h"
 
 #include "hstest_global.h"
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 
 class HsWidgetComponent;
 class CaEntry;
@@ -67,7 +67,7 @@
 	QServiceManager mServiceManager;
 	static HsWidgetComponentRegistry *mInstance;
     
-    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
 };
 
 #endif // HSWIDGETCOMPONENTREGISTRY_H
--- a/homescreenapp/hsdomainmodel/inc/hswidgethost.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/inc/hswidgethost.h	Wed Jun 23 18:03:36 2010 +0300
@@ -26,7 +26,7 @@
 #include "hsdomainmodeldatastructures.h"
 
 #include "hstest_global.h"
-HOMESCREEN_TEST_CLASS(TestRuntimeServices)
+HOMESCREEN_TEST_CLASS(TestHsDomainModel)
 
 class QStateMachine;
 
@@ -138,7 +138,7 @@
 	QMetaProperty mRootPathProperty;        
     bool mIsFinishing;
 
-    HOMESCREEN_TEST_FRIEND_CLASS(TestRuntimeServices)
+    HOMESCREEN_TEST_FRIEND_CLASS(TestHsDomainModel)
 };
 
 #endif // HSWIDGETHOST_H
--- a/homescreenapp/hsdomainmodel/src/hsbackuprestoreactivecallback.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsbackuprestoreactivecallback.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -16,20 +16,22 @@
 */
 
 
-// INCLUDE FILES
 #include <bautils.h>
 
 #include "hsbackuprestoreactivecallback.h"
 #include "hsbackuprestoreobserver.h"
 
-//  CONSTANTS
-
-// ======== MEMBER FUNCTIONS ========
+/*!
+    \class CHsBURActiveCallback
+    \ingroup group_hsdomainmodel
+    \brief B&R active callback.
+    Home screen active callback in backup/restore.
+*/
 
-// ---------------------------------------------------------------------------
-// 
-// ---------------------------------------------------------------------------
-//
+/*!
+    Constructor.
+    \a observer Backup restore observer
+*/
 CHsBURActiveCallback* CHsBURActiveCallback::NewL(HsBackupRestoreObserver* observer)
 {
     CHsBURActiveCallback* self =
@@ -41,27 +43,42 @@
     return self;
 }
 
-// ---------------------------------------------------------------------------
-// Destructor
-// ---------------------------------------------------------------------------
-//
+/*!
+    Destructor.
+*/
 CHsBURActiveCallback::~CHsBURActiveCallback()
 {
 }
 
-// ---------------------------------------------------------------------------
-// Inform that all data has been backed up or restored.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method informs the active backup data client that all 
+    snapshots have been supplied. If the client has not
+    received a snapshot then it should perform a base backup.
+    Inform that all data has been backed up or restored.
+*/
 void CHsBURActiveCallback::AllSnapshotsSuppliedL()
 {
     // No implementation needed. Must not leave    
 }
 
-// ---------------------------------------------------------------------------
-// Not supported.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method receives all or part of a snapshot of data to allow 
+    calculation of an incremental backup.  The snapshot is one that
+    was previously supplied by the data owner.  The snapshot data 
+    should be read from the location supplied. The snapshot data may
+    be larger than the location supplied in which case the routine 
+    will be called repeatedly until all data has been supplied.
+
+    Snapshot data will also be supplied as part of a restore operation
+          
+    @param aDrive the drive being backed up
+    @param aBuffer a pointer to the base of the location from whence 
+           data can be copied.
+    @param aLastSection ETrue if this is the last section of snapshot 
+           data, else EFalse.
+    
+    Not supported.
+*/
 void CHsBURActiveCallback::ReceiveSnapshotDataL(
     TDriveNumber /*aDrive*/, TDesC8& /*aBuffer*/, TBool /*aLastSection*/)
 {
@@ -69,10 +86,20 @@
     User::Leave( KErrNotSupported );
 }
 
-// ---------------------------------------------------------------------------
-// Make a guess about data size.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method returns the expected size of backup data that will be
+    supplied. If an incremental backup is underway then this method
+    then this method will not be called until after 
+    ReceiveSnapshotDataL(). The size data will be used for the purpose
+    of tracking progess during a backup. If it is inaccurate then the
+    user may see irregular progress but the actual backup data will 
+    not be affected so it is acceptable to return an estimated value.
+    
+    @param aDrive the drive being backed up.
+    @return the size of the data that will be returned
+	
+	Make a guess about data size.
+*/
 TUint CHsBURActiveCallback::GetExpectedDataSize(
     TDriveNumber /*aDrive*/)
 {
@@ -80,10 +107,26 @@
     return 0;
 }
 
-// ---------------------------------------------------------------------------
-// Not supported.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method returns a snapshot of data to accompany a backup. The 
+    snapshot is expected to contain details on files / data being 
+    backed up. The format of the snapshot is only meaningful to the
+    data owner. The snapshot will be supplied if the data owner is 
+    asked for an incremental backup and for a restore operation. The 
+    snapshot data should be copied to the location supplied.
+    
+    The snapshot data may be larger than the location supplied in 
+    which case the routine will be called repeatedly until all data
+    has been retrieved.
+    
+    @param aDrive the drive being backed up
+    @param aBuffer a pointer to the base of the location where data 
+           can be copied.
+    @param aFinished on return ETrue if all data has been returned 
+           for this drive, else EFalse.
+           
+    Not supported.
+*/
 void CHsBURActiveCallback::GetSnapshotDataL(
     TDriveNumber /*aDrive*/, TPtr8& /*aBuffer*/, TBool& /*aFinished*/)
 {
@@ -91,19 +134,33 @@
     User::Leave( KErrNotSupported );
 }
 
-// ---------------------------------------------------------------------------
-// Initialize for backup.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method prepares the implementor to return backup data. It 
+    will be followed by a sequence of calls to request the actual 
+    data.
+          
+    @param aDrive the drive being backed up.
+	
+    Initialize for backup.
+*/
 void CHsBURActiveCallback::InitialiseGetBackupDataL(
     TDriveNumber /*aDrive*/)
 {
     iObserver->backupRestoreStarted();    
 }
 
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method requests a section of backup data.  
+    InitialiseGetBackupDataL() will have been called previously to
+    specify the drive concerned.  The data returned may be base or
+    incremental depending on the type of backup and the capability of
+    the data owner.
+    
+    @param aBuffer a pointer to the base of the location where data 
+           can be copied.
+    @param aFinished on return ETrue if all data has been returned 
+          for this drive, else EFalse.
+*/
 void CHsBURActiveCallback::GetBackupDataSectionL(
     TPtr8& /*aBuffer*/, TBool& aFinished)
 {
@@ -111,10 +168,15 @@
     aFinished = ETrue;
 }
 
-// ---------------------------------------------------------------------------
-// Initialize restore.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method prepares the implementor to receive base restore data
+    for a drive. It will be followed by a sequence of calls to supply
+    the actual data.
+    
+    @param aDrive the drive being restored.
+	
+	Initialize restore.
+*/
 void CHsBURActiveCallback::InitialiseRestoreBaseDataL(
     TDriveNumber /*aDrive*/ )
 {
@@ -122,11 +184,19 @@
     User::Leave( KErrNotSupported );    
 }
 
-// ---------------------------------------------------------------------------
-// Run state machine for restore. Receive stream from BUR engine and turn it
-// to file(s).
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method receives a section of base restore data.
+    InitialiseRestoreBaseDataL() will have been called previously to 
+    specify the drive concerned.
+    
+    @param aBuffer a pointer to the base of the location whence data
+           can be read.
+    @param aFinished ETrue if all data has been returned for this 
+           drive, else EFalse.
+ 
+    Run state machine for restore. Receive stream from BUR engine and turn it
+    to file(s).
+*/
 void CHsBURActiveCallback::RestoreBaseDataSectionL(
     TDesC8& /*aBuffer*/, TBool /*aFinished*/ )
 {
@@ -134,10 +204,16 @@
     User::Leave( KErrNotSupported );  
 }
 
-// ---------------------------------------------------------------------------
-// Incremental restoration is not supported.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method prepares the implementor to receive incremental 
+    restore data for a drive. It will be followed by a sequence 
+    of calls to supply the actual data.  If multiple increments
+    are supplied then this methid will be called before each increment
+    
+    @param aDrive the drive being restored.
+    
+    Not supported.
+*/
 void CHsBURActiveCallback::InitialiseRestoreIncrementDataL(
     TDriveNumber /*aDrive*/)
 {
@@ -145,10 +221,18 @@
     User::Leave( KErrNotSupported );
 }
 
-// ---------------------------------------------------------------------------
-// Incremental restoration is not supported.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method receives a section of increment restore data.
+    InitialiseRestoreIncrementDataL() will have been called 
+    previously to specify the drive concerned.
+    
+    @param aBuffer a pointer to the base of the location whence data 
+           can be read.
+    @param aFinished ETrue if all data has been returned for this 
+           increment, else EFalse.
+ 
+    Not supported.
+*/
 void CHsBURActiveCallback::RestoreIncrementDataSectionL(
     TDesC8& /*aBuffer*/, TBool /*aFinished*/)
 {
@@ -156,47 +240,56 @@
     User::Leave( KErrNotSupported );
 }
 
-// ---------------------------------------------------------------------------
-// Called when restore is complete - sets data back to initial state.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method is called when all data to be restored has been 
+    supplied.
+    
+    @param aDrive the drive being restored.
+    
+    Called when restore is complete - sets data back to initial state.
+*/
 void CHsBURActiveCallback::RestoreComplete(TDriveNumber /*aDrive*/)
 {
     // No implementation needed
 }
 
-// ---------------------------------------------------------------------------
-// Tidy up when operation is over.
-// ---------------------------------------------------------------------------
-//
+/*!
+    This method is called if copying of data is terminated prematurely 
+    to allow the implementor to tidy up.  The same method applies to 
+    all types of data and to backup and restore.
+    Tidy up when operation is over.
+*/
 void CHsBURActiveCallback::TerminateMultiStageOperation()
 {
     // No implementation needed
 }
 
-// ---------------------------------------------------------------------------
-//
-// ---------------------------------------------------------------------------
-//
+/*!
+    Gets a 32-bit checksum for its private data.
+    This routine is for test purposes.  It must be implemented but an
+    invariant checksum value can be provided.  Some tests may cause 
+    checksum values to be compared.
+    
+    @param aDrive the drive containing data being checksummed
+    @return the 32-bit checksum
+*/
 TUint CHsBURActiveCallback::GetDataChecksum(TDriveNumber /*aDrive*/)
 {
     // No implementation needed
     return 0;
 }
 
-// ---------------------------------------------------------------------------
-// C++ constructor.
-// ---------------------------------------------------------------------------
-//
+/*!
+    C++ constructor.
+*/
 CHsBURActiveCallback::CHsBURActiveCallback(HsBackupRestoreObserver* observer)
 {
 	iObserver = observer;
 }
 
-// ---------------------------------------------------------------------------
-// 2nd phase constructor.
-// ---------------------------------------------------------------------------
-//
+/*!
+    2nd phase constructor.
+*/
 void CHsBURActiveCallback::ConstructL()
 {
 }
--- a/homescreenapp/hsdomainmodel/src/hsbackuprestoreobserver.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsbackuprestoreobserver.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -26,6 +26,12 @@
 #include "hsbackuprestoreobserver_p.h"
 
 /*!
+    \class HsBackupRestoreObserver
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
+/*!
     Constructs a new observer with the given \a parent object.
 */
 HsBackupRestoreObserverPrivate::HsBackupRestoreObserverPrivate(HsBackupRestoreObserver *observer,
@@ -108,7 +114,7 @@
             if ( (mLastType == conn::EBURBackupFull || mLastType == conn::EBURBackupPartial) ||
             	 (mLastType == conn::EBURRestorePartial || mLastType == conn::EBURRestoreFull) )
             {                
-                mQ->backupRestoreComplited();
+                mQ->backupRestoreCompleted();
             }         
             // delete once back to normal.
             delete mCallBack;
@@ -167,10 +173,10 @@
 /*!
     Called when backup/restore is completed.
 */
-void HsBackupRestoreObserver::backupRestoreComplited()
+void HsBackupRestoreObserver::backupRestoreCompleted()
 {
 	mBUROngoing = false;
-	emit event_backupRestoreComplited();
+	emit event_backupRestoreCompleted();
 }
 
 /*!
--- a/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsconfiguration.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -14,115 +14,231 @@
 * Description:
 *
 */
+
+#include <QMetaObject>
+#include <QMetaProperty>
+#include <QTextStream>
+#include <QFile>
+
+#include <HbDeviceProfile>
+
 #include "hsconfiguration.h"
-#include "hsdomainmodeldatastructures.h"
 #include "hsdatabase.h"
 
-#include <HbInstantFeedback>
+/*!
+    \class HsConfiguration
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
 
 /*!
-    Loads configuration data from database.
+
 */
-void HsConfiguration::loadConfiguration()
-{
-    HsDatabase *db = HsDatabase::instance();
+HsConfiguration::HsConfiguration(QObject *parent)
+  : QObject(parent),
+    mBounceEffect(20),
+    mWidgetTapAndHoldTimeout(500),
+    mSceneTapAndHoldTimeout(500),
+    mPageChangeAnimationDuration(200),
+    mPageChangeZoneAnimationDuration(800),
+    mPageChangeZoneReverseAnimationDuration(200),
+    mPageRemovedAnimationDuration(200),
+	mNewPageAddedAnimationDuration(200),
+    mWidgetDragEffectDuration(200),
+	mWidgetDropEffectDuration(200),
+	mDefaultPageId(1),
+    mMaximumPageCount(8),
+    mIsShortcutLabelVisible(true),
+    mBounceFeedbackEffectDistance(3),
+    mPageChangePanDistanceInPixels(120),
+    mTapAndHoldDistance(16),
+    mPageChangeZoneWidth(60),
+    mPageIndicatorSpacing(8),
+    mMaximumWidgetHeight(39),
+    mMaximumWidgetWidth(48),
+    mMinimumWidgetHeight(8.75),
+    mMinimumWidgetWidth(8.75),
+    mPageChangePanDistance(17.91),
+    mPageChangeFeedbackEffect(HbFeedback::Sensitive),
+    mWidgetPickFeedbackEffect(HbFeedback::ItemPick),
+	mWidgetDropFeedbackEffect(HbFeedback::ItemDrop),
+	mWidgetRepositionFeedbackEffect(HbFeedback::BounceEffect),
+	mWidgetOverTrashbinFeedbackEffect(HbFeedback::ItemMoveOver),
+	mWidgetDropToTrashbinFeedbackEffect(HbFeedback::ItemDrop),
+    mShortcutWidgetTapFeedbackEffect(HbFeedback::BasicItem),
+    mWidgetMoveBlockedFeedbackEffect(HbFeedback::Basic),
+    mClockWidgetTapFeedbackEffect(HbFeedback::BasicItem),
+    mWidgetSnappingFeedbackEffect(HbFeedback::ItemMoveOver),
+    mIsSnapEnabled(true),
+    mSnapTimeout(500),
+    mSnapForce(30),
+    mSnapGap(6),
+    mSnapBorderGap(0),
+    mSnapLineFadeInDuration(200),
+    mSnapLineFadeOutDuration(100),
+    mIsSnapEffectsEnabled(true),    
+    mSceneType(PageWallpapers)
+{    
+}
+
+/*!
 
-    HsGeneralConfiguration generalConfiguration;
-    if (db->generalConfiguration(generalConfiguration)) {
-        mBounceEffect = generalConfiguration.bounceEffect;
-        mTapAndHoldDistance = generalConfiguration.tapAndHoldDistance;
-        mWidgetTapAndHoldTimeout = generalConfiguration.widgetTapAndHoldTimeout;
-        mSceneTapAndHoldTimeout = generalConfiguration.sceneTapAndHoldTimeout;
-        mPageChangeZoneWidth = generalConfiguration.pageChangeZoneWidth;
-        mPageIndicatorSpacing = generalConfiguration.pageIndicatorSpacing;
-        mPageChangeAnimationDuration = generalConfiguration.pageChangeAnimationDuration;
-        mPageChangeZoneAnimationDuration = generalConfiguration.pageChangeZoneAnimationDuration;
-        mPageChangeZoneReverseAnimationDuration = generalConfiguration.pageChangeZoneReverseAnimationDuration;
-        mPageRemovedAnimationDuration = generalConfiguration.pageRemovedAnimationDuration;
-        mNewPageAddedAnimationDuration = generalConfiguration.newPageAddedAnimationDuration; 
-        mWidgetDragEffectDuration = generalConfiguration.widgetDragEffectDuration;
-        mWidgetDropEffectDuration = generalConfiguration.widgetDropEffectDuration;
-        mBounceFeedbackEffectDistance = generalConfiguration.boundaryFeedbackEffectDistance;
-        mDefaultPageId = generalConfiguration.defaultPageId;
-        mMaximumPageCount = generalConfiguration.maximumPageCount;
-        mMaximumWidgetHeight = generalConfiguration.maximumWidgetHeight;
-        mMaximumWidgetWidth = generalConfiguration.maximumWidgetWidth;
-        mMinimumWidgetHeight = generalConfiguration.minimumWidgetHeight;
-        mMinimumWidgetWidth = generalConfiguration.minimumWidgetWidth;
-        mShortcutLabelsVisible = generalConfiguration.shortcutLabelsVisible;
-        mPageChangePanDistance = generalConfiguration.pageChangePanDistance;
-        mPageChangePanDistanceInPixels = mPageChangePanDistance * HbDeviceProfile::current().unitValue();
-    } else {
-        Q_ASSERT_X(1, "Configuration", "Homescreen configuration could not be loaded from database");
+*/
+HsConfiguration::~HsConfiguration()
+{
+}
+
+/*!
+
+*/
+QSizeF HsConfiguration::minimumWidgetSizeInUnits() const
+{
+    return QSizeF(mMinimumWidgetWidth, mMinimumWidgetHeight);
+}
+
+/*!
+
+*/
+QSizeF HsConfiguration::maximumWidgetSizeInUnits() const
+{
+    return QSizeF(mMaximumWidgetWidth, mMaximumWidgetHeight);
+}
+
+/*!
+
+*/
+QSizeF HsConfiguration::minimumWidgetSizeInPixels() const
+{
+    HbDeviceProfile profile;
+    qreal factor = profile.unitValue();
+    return factor * minimumWidgetSizeInUnits();
+}
+
+/*!
+
+*/
+QSizeF HsConfiguration::maximumWidgetSizeInPixels() const
+{
+    HbDeviceProfile profile;
+    qreal factor = profile.unitValue();
+    return factor * maximumWidgetSizeInUnits();
+}
+
+/*!
+
+*/
+bool HsConfiguration::load()
+{
+    QVariantHash configuration;
+    
+    HsDatabase *db = HsDatabase::instance();
+    if (!db->configuration(configuration)) {
+        return false;
     }
 
-    HsFeedbackConfiguration feedbackConfiguration;
-    if (db->feedbackConfiguration(feedbackConfiguration)) {
-        mPageChangeFeedbackType = feedbackConfiguration.pageChangeFeedbackType;
-	    mWidgetPickFeedbackType = feedbackConfiguration.widgetPickFeedbackType;
-	    mWidgetDropFeedbackType = feedbackConfiguration.widgetDropFeedbackType;
-	    mWidgetRepositionFeedbackType = feedbackConfiguration.widgetRepositionFeedbackType;
-	    mWidgetOverTrashbinFeedbackType = feedbackConfiguration.widgetOverTrashbinFeedbackType;
-	    mWidgetDropToTrashbinFeedbackType = feedbackConfiguration.widgetDropToTrashbinFeedbackType;
-	    mShortcutWidgetTapFeedbackType = feedbackConfiguration.shortcutWidgetTapFeedbackType;
-	    mWidgetMoveBlockedFeedbackType = feedbackConfiguration.widgetMoveBlockedFeedbackType;
-	    mClockWidgetTapFeedbackType = feedbackConfiguration.clockWidgetTapFeedbackType;
-	    mWidgetSnappingFeedbackType = feedbackConfiguration.widgetSnappingFeedbackType;    
-    } else {
-        Q_ASSERT_X(1, "Configuration", "Homescreen feedback cnfiguration could not be loaded from database");
+    const QMetaObject *mo = metaObject();
+    QHashIterator<QString, QVariant> i(configuration);
+    while (i.hasNext()) {
+        i.next();
+        QByteArray name = i.key().toLatin1();
+        QVariant value = i.value();
+        QMetaProperty mp = mo->property(mo->indexOfProperty(name));
+        if (mp.isEnumType()) {
+            bool ok;
+            value.toString().toInt(&ok);
+            if (ok) {
+                setProperty(name, value.toInt());
+            } else {
+                setProperty(name, mp.enumerator().keyToValue(value.toString().toLatin1()));
+            }
+        } else {
+            setProperty(name, value);
+        }
     }
 
-    HsSnapConfiguration snapConfiguration;
-    if (db->snapConfiguration(snapConfiguration)) {
-        mSnapEnabled = snapConfiguration.snappingEnabled;
-        mSnapForce = snapConfiguration.snapForce;
-        mSnapGap = snapConfiguration.snapGap;
-        mSnapBorderGap = snapConfiguration.borderGap;
-        mSnapTimeout = snapConfiguration.timeout;
-    } else {
-        Q_ASSERT_X(1, "Configuration", "Homescreen snap configuration could not be loaded from database");
+    return true;
+}
+
+/*!
+
+*/
+bool HsConfiguration::importFromFile(const QString &path)
+{
+    QFile file(path);
+    if (!file.open(QIODevice::ReadOnly)) {
+        return false;
     }
+    QTextStream in(&file);    
+    
+    const QMetaObject *mo = metaObject();
+    while (!in.atEnd()) {        
+        QStringList list = in.readLine().split(QLatin1String(" = "));
+        QByteArray name = list.at(0).toLatin1();
+        QByteArray value = list.at(1).toLatin1();
+        QMetaProperty mp = mo->property(mo->indexOfProperty(name));
+        if (mp.isEnumType()) {
+            setProperty(name, mp.enumerator().keyToValue(value));
+        } else {
+            setProperty(name, value);
+        }
+    }
+
+    return true;
 }
 
-// static member variables initilized here, these values will be used if fetching from database fails
-int HsConfiguration::mBounceEffect = 20;
-qreal HsConfiguration::mTapAndHoldDistance = 16.0;
-int HsConfiguration::mWidgetTapAndHoldTimeout = 500;
-int HsConfiguration::mSceneTapAndHoldTimeout = 500;
-qreal HsConfiguration::mPageChangeZoneWidth = 60.0;
-qreal HsConfiguration::mPageIndicatorSpacing = 8.0;
-int HsConfiguration::mPageChangeAnimationDuration = 200;
-int HsConfiguration::mPageChangeZoneAnimationDuration = 800;
-int HsConfiguration::mPageChangeZoneReverseAnimationDuration = 200;
-int HsConfiguration::mPageRemovedAnimationDuration = 200;
-int HsConfiguration::mNewPageAddedAnimationDuration = 700;
-int HsConfiguration::mWidgetDragEffectDuration = 200;
-int HsConfiguration::mWidgetDropEffectDuration = 200;
-int HsConfiguration::mBounceFeedbackEffectDistance = 3;
-int HsConfiguration::mDefaultPageId = 1;
-int HsConfiguration::mMaximumPageCount = 8;
-qreal HsConfiguration::mMaximumWidgetHeight = 39;
-qreal HsConfiguration::mMaximumWidgetWidth = 48;
-qreal HsConfiguration::mMinimumWidgetHeight = 8.75;
-qreal HsConfiguration::mMinimumWidgetWidth = 8.75;
-bool HsConfiguration::mShortcutLabelsVisible = false;
-qreal HsConfiguration::mPageChangePanDistance = 17.91;
-int HsConfiguration::mPageChangePanDistanceInPixels = 120;
+/*!
+
+*/
+bool HsConfiguration::exportToFile(const QString &path)
+{
+    QFile file(path);
+    if (!file.open(QIODevice::WriteOnly)) {
+        return false;
+    }
+    QTextStream out(&file);
+
+    const QMetaObject *mo = this->metaObject();
+    for (int i = mo->propertyOffset(); i < mo->propertyCount(); ++i) {
+        QMetaProperty mp = mo->property(i);
+        out << mp.name() << " = ";        
+        if (mp.isEnumType()) {            
+            out << mp.enumerator().valueToKey(mp.read(this).toInt());            
+        } else {
+            out << mp.read(this).toString();
+        }        
+        out << endl;        
+    }
+
+    return true;
+}
+
+/*!
 
-HbFeedback::InstantEffect HsConfiguration::mPageChangeFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mWidgetPickFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mWidgetDropFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mWidgetRepositionFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mWidgetOverTrashbinFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mWidgetDropToTrashbinFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mShortcutWidgetTapFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mWidgetMoveBlockedFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mClockWidgetTapFeedbackType = HbFeedback::None;
-HbFeedback::InstantEffect HsConfiguration::mWidgetSnappingFeedbackType = HbFeedback::None;
+*/
+HsConfiguration *HsConfiguration::instance()
+{
+    return mInstance;
+}
+ 
+/*!
 
-bool HsConfiguration::mSnapEnabled = false;
-qreal HsConfiguration::mSnapForce = 0;
-qreal HsConfiguration::mSnapGap = 0;
-qreal HsConfiguration::mSnapBorderGap = 0;
-int HsConfiguration::mSnapTimeout = 0;
+*/
+HsConfiguration *HsConfiguration::takeInstance()
+{
+    HsConfiguration *instance = mInstance;
+    mInstance = 0;
+    return instance;
+}
+
+/*!
 
+*/
+void HsConfiguration::setInstance(HsConfiguration *instance)
+{
+    if (mInstance != instance) {
+        delete mInstance;
+        mInstance = instance; 
+    }    
+}
+
+HsConfiguration *HsConfiguration::mInstance(0);
--- a/homescreenapp/hsdomainmodel/src/hscontentservice.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hscontentservice.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -23,26 +23,40 @@
 #include "hswidgethost.h"
 
 
+/*!
+    \class HsContentService
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
+/*!
+
+*/
 HsContentService::HsContentService(QObject *parent)
-    : QObject(parent)
+    : QObject(parent),mWidgetStartFaulted(false)
 {
    
 }
 
+/*!
+
+*/
 HsContentService::~HsContentService()
 {
 }
 
+/*!
 
+*/
 bool HsContentService::createWidget(const QVariantHash &params)
 {
-    HsWidgetHost *widget = createWidgetForPreview(params);
-    if (!widget) {
-        return false;
-    }     
-    return HsScene::instance()->activePage()->addNewWidget(widget);
+    return addWidget(params.value("uri").toString(),params.value("preferences").toHash());
 }
 
+// This method will be removed.
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC SKIP
+#endif //COVERAGE_MEASUREMENT
 HsWidgetHost *HsContentService::createWidgetForPreview(const QVariantHash &params)
 {
     HsWidgetData widgetData;
@@ -51,6 +65,9 @@
     return HsWidgetHost::createInstance(
         widgetData, params.value("preferences").toHash());
 }
+#ifdef COVERAGE_MEASUREMENT
+#pragma CTC ENDSKIP
+#endif //COVERAGE_MEASUREMENT
 
 /*!
 
@@ -70,9 +87,15 @@
         widget->remove();
         return false;
     }
-
-    widget->startWidget();
-    page->layoutNewWidgets();
+    connect(widget,SIGNAL(event_faulted()),SLOT(widgetStartFaulted()));
+    mWidgetStartFaulted = false; 
+    widget->startWidget(); // synchronous operation
+    if (mWidgetStartFaulted) {
+        // page will destroy widget instance
+        return false;
+    }
+    widget->disconnect(this);
+  
     return true;
 }
 
@@ -88,6 +111,14 @@
 }
 
 /*!
+
+*/
+void HsContentService::widgetStartFaulted()
+{
+    mWidgetStartFaulted = true;
+}
+
+/*!
     Points to the content service instance.
 */
 HsContentService *HsContentService::mInstance(0);
--- a/homescreenapp/hsdomainmodel/src/hsdatabase.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsdatabase.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -49,6 +49,13 @@
     }
 }
 
+
+/*!
+    \class HsDatabase
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
 /*!
     Constructs a new database with the given \a parent object.
 */
@@ -185,43 +192,15 @@
     QSqlQuery query(QSqlDatabase::database(mConnectionName));
 
     QString statement =
-        "SELECT id, portraitWallpaper, landscapeWallpaper "
+        "SELECT id "
         "FROM Scene";
     
     if (query.prepare(statement) && query.exec() && query.next()) {        
-        data.id                  = query.value(0).toInt();
-        data.portraitWallpaper   = query.value(1).toString();
-        data.landscapeWallpaper  = query.value(2).toString();
+        data.id = query.value(0).toInt();        
         return true;
     }
     
-    return false;
-}
-
-/*!
-
-*/
-bool HsDatabase::updateScene(const HsSceneData &data)
-{
-    if (!checkConnection()) {
-        return false;
-    }
-
-    QSqlQuery query(QSqlDatabase::database(mConnectionName));
-
-    QString statement =
-        "UPDATE Scene "
-        "SET portraitWallpaper = ?, landscapeWallpaper = ? "
-        "WHERE id = ?";
-
-    if (query.prepare(statement)) {
-        query.addBindValue(data.portraitWallpaper);
-        query.addBindValue(data.landscapeWallpaper);    
-        query.addBindValue(data.id);
-        return  query.exec();
-    }
-    
-    return false;
+    return false;    
 }
 
 /*!
@@ -760,10 +739,7 @@
     return true;
 }
 
-/*!
-
-*/
-bool HsDatabase::generalConfiguration(HsGeneralConfiguration &data)
+bool HsDatabase::configuration(QVariantHash &configuration)
 {
     if (!checkConnection()) {
         return false;
@@ -772,101 +748,18 @@
     QSqlQuery query(QSqlDatabase::database(mConnectionName));
 
     QString statement =
-        "SELECT bounceEffect, tapAndHoldDistance, widgetTapAndHoldTimeout, sceneTapAndHoldTimeout, "
-        "pageChangeZoneWidth, "
-        "pageIndicatorSpacing, pageChangeAnimationDuration, pageChangeZoneAnimationDuration, "
-        "pageChangeZoneReverseAnimationDuration, "
-        "pageRemovedAnimationDuration, newPageAddedAnimationDuration, widgetDragEffectDuration, "
-        "widgetDropEffectDuration, boundaryFeedbackEffectDistance, "
-        "defaultPageId, maximumPageCount, maximumWidgetHeight, maximumWidgetWidth, "
-        "minimumWidgetHeight, minimumWidgetWidth, shortcutLabelsVisible,  "
-        "pageChangePanDistance "
-        "FROM GeneralConfiguration";
+        "SELECT key, value "
+        "FROM Configuration";
 
-    if (query.prepare(statement) && query.exec() && query.next()) {        
-        data.bounceEffect                           = query.value(0).toInt();
-        data.tapAndHoldDistance                     = query.value(1).toReal();
-        data.widgetTapAndHoldTimeout                = query.value(2).toInt();
-        data.sceneTapAndHoldTimeout                 = query.value(3).toInt();
-        data.pageChangeZoneWidth                    = query.value(4).toReal();
-        data.pageIndicatorSpacing                   = query.value(5).toReal();
-        data.pageChangeAnimationDuration            = query.value(6).toInt();
-        data.pageChangeZoneAnimationDuration        = query.value(7).toInt();
-        data.pageChangeZoneReverseAnimationDuration = query.value(8).toInt();
-        data.pageRemovedAnimationDuration           = query.value(9).toInt();
-        data.newPageAddedAnimationDuration          = query.value(10).toInt();
-        data.widgetDragEffectDuration               = query.value(11).toInt();
-        data.widgetDropEffectDuration               = query.value(12).toInt();
-        data.boundaryFeedbackEffectDistance         = query.value(13).toInt();
-        data.defaultPageId                          = query.value(14).toInt();
-        data.maximumPageCount                       = query.value(15).toInt();
-        data.maximumWidgetHeight                    = query.value(16).toReal();
-        data.maximumWidgetWidth                     = query.value(17).toReal();
-        data.minimumWidgetHeight                    = query.value(18).toReal();
-        data.minimumWidgetWidth                     = query.value(19).toReal();
-        data.shortcutLabelsVisible                  = query.value(20).toBool();
-        data.pageChangePanDistance                  = query.value(21).toReal();
+    if (query.prepare(statement) && query.exec()) {
+        configuration.clear();
+        while (query.next()) {
+            configuration.insert(query.value(0).toString(), 
+                                 query.value(1));
+        }
         return true;
     }
-    
-    return false;
-}
 
-/*!
-
-*/
-bool HsDatabase::feedbackConfiguration(HsFeedbackConfiguration &data)
-{
-    if (!checkConnection()) {
-        return false;
-    }
-
-    QSqlQuery query(QSqlDatabase::database(mConnectionName));
-
-    QString statement =
-        "SELECT pageChangeFeedbackType, widgetPickFeedbackType, widgetDropFeedbackType,  "
-        "widgetRepositionFeedbackType, widgetOverTrashbinFeedbackType, widgetDropToTrashbinFeedbackType,  "
-        "shortcutWidgetTapFeedbackType, widgetMoveBlockedFeedbackType, clockWidgetTapFeedbackType, "
-        "widgetSnappingFeedbackType "
-        "FROM FeedbackConfiguration";
-
-    if (query.prepare(statement) && query.exec() && query.next()) {        
-        data.pageChangeFeedbackType           = data.feedbackFromString(query.value(0).toString());
-        data.widgetPickFeedbackType           = data.feedbackFromString(query.value(1).toString());
-        data.widgetDropFeedbackType           = data.feedbackFromString(query.value(2).toString());
-        data.widgetRepositionFeedbackType     = data.feedbackFromString(query.value(3).toString());
-        data.widgetOverTrashbinFeedbackType   = data.feedbackFromString(query.value(4).toString());
-        data.widgetDropToTrashbinFeedbackType = data.feedbackFromString(query.value(5).toString());
-        data.shortcutWidgetTapFeedbackType    = data.feedbackFromString(query.value(6).toString());
-        data.widgetMoveBlockedFeedbackType    = data.feedbackFromString(query.value(7).toString());
-        data.clockWidgetTapFeedbackType       = data.feedbackFromString(query.value(8).toString());
-        data.widgetSnappingFeedbackType       = data.feedbackFromString(query.value(9).toString());
-        return true;
-    }
-    
-    return false;
-}
-
-bool HsDatabase::snapConfiguration(HsSnapConfiguration &data)
-{   
-    if (!checkConnection()) {
-        return false;
-    }
-
-    QSqlQuery query(QSqlDatabase::database(mConnectionName));
-
-    QString statement =
-        "SELECT snappingEnabled, snapForce, snapGap, borderGap, timeout "
-        "FROM SnapConfiguration";
-
-    if (query.prepare(statement) && query.exec() && query.next()) {
-        data.snappingEnabled = query.value(0).toBool();
-        data.snapForce = query.value(1).toReal();
-        data.snapGap   = query.value(2).toReal();
-        data.borderGap = query.value(3).toReal();
-        data.timeout   = query.value(4).toInt();
-        return true;
-    }
     return false;
 }
 
--- a/homescreenapp/hsdomainmodel/src/hsgui.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsgui.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -22,7 +22,7 @@
 
 /*!
     \class HsGui
-    \ingroup group_hsutils
+    \ingroup group_hsdomainmodel
     \brief Represents a view in the framework.
     HsGui includes common UI components for Home screen.
 */
--- a/homescreenapp/hsdomainmodel/src/hspage.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hspage.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -22,17 +22,19 @@
 
 #include "hsdomainmodeldatastructures.h"
 #include "hspage.h"
+#include "hspagenewwidgetlayout.h"
 #include "hsscene.h"
 #include "hsdatabase.h"
 #include "hswidgethost.h"
 #include "hswallpaper.h"
 #include "hswidgetpositioningonwidgetadd.h"
 #include "hswidgetpositioningonorientationchange.h"
+#include "hsconfiguration.h"
 
 
 /*!
     \class HsPage
-    \ingroup group_hsutils
+    \ingroup group_hsdomainmodel
     \brief Represents a page in the framework.
     HsPage is a parent for a group of widgets. HsPage can have a wallpaper.
 */
@@ -46,6 +48,7 @@
 HsPage::HsPage(QGraphicsItem* parent)
     : HbWidget(parent),
       mDatabaseId(-1),
+      mWallpaper(0),
       mRemovable(true)
 {
     setFlag(QGraphicsItem::ItemHasNoContents);
@@ -58,6 +61,7 @@
 */
 HsPage::~HsPage()
 {
+    delete mWallpaper;
 }
 
 /*!
@@ -92,13 +96,17 @@
         return false;
     }
 
+    if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) {
+        mWallpaper = new HsPageWallpaper(this);
+    }
+
     foreach (HsWidgetData data, datas) {
         HsWidgetHost *widget = new HsWidgetHost(data.id);
         mWidgets.append(widget);
         connectWidget(widget);
         widget->setPage(this);
         widget->setParentItem(this);
-        widget->startWidget();
+        widget->startWidget(isDefaultPage());
     }
 
     connect(HsScene::mainWindow(),
@@ -108,6 +116,14 @@
     return true;
 }
 
+/*!
+    Return wallpaper. 
+*/
+HsWallpaper *HsPage::wallpaper() const
+{
+    return mWallpaper;
+}
+
 bool HsPage::addExistingWidget(HsWidgetHost *widgetHost)
 {
     if (!widgetHost) {
@@ -199,15 +215,24 @@
 
     HsWidgetPositioningOnWidgetAdd *algorithm =
         HsWidgetPositioningOnWidgetAdd::instance();
+        
+    QRectF pageRect = HsScene::mainWindow()->layoutRect();
+    // chrome needs to be removed from the rect.
+    pageRect.adjust( (qreal)0,(qreal)64,(qreal)0,(qreal)0);
 
     QList<QRectF> calculatedRects =
-        algorithm->convert(HsScene::mainWindow()->layoutRect(), rects, QPointF());
-
+        algorithm->convert(pageRect, rects, QPointF());
+    
+    HsPageNewWidgetLayout *newWidgetLayout = static_cast<HsPageNewWidgetLayout *>(layout());
+    if (!newWidgetLayout) {
+        newWidgetLayout = new HsPageNewWidgetLayout();
+        setLayout(newWidgetLayout);
+    }    
     updateZValues();
-
     HsWidgetHost *widget = 0;
     for (int i = 0; i < mNewWidgets.count(); ++i) {
         widget = mNewWidgets.at(i);
+        newWidgetLayout->addItem(widget);
         widget->setGeometry(calculatedRects.at(i));
         widget->savePresentation();
         widget->setPage(this);
@@ -226,7 +251,7 @@
         widget->remove();
     }
     mWidgets.clear();
-    
+
     foreach (HsWidgetHost *widget, mNewWidgets) {
         widget->remove();
     }
@@ -262,6 +287,11 @@
     mRemovable = removable;
 }
 
+bool HsPage::isDefaultPage() const
+{
+    return mDatabaseId == HSCONFIGURATION_GET(defaultPageId);
+}
+
 bool HsPage::isActivePage() const
 {
     return this == HsScene::instance()->activePage();
@@ -390,31 +420,27 @@
 }
 
 /*!
-    Calculates new widget position on page when widget size changes
+    Calculates new widget position on page when widget size changes. If page has layout then there are new widgets
+    and we use layout to calculate new widget positions.
 */
 void HsPage::onWidgetResized()
 {
-    HsWidgetHost *widget = qobject_cast<HsWidgetHost *>(sender());
-
-    QRectF widgetRect = widget->geometry();
-
-    QRectF pageRect = HsScene::mainWindow()->layoutRect();
-
-    qreal lowerBoundX = 0;
-
-    qreal upperBoundX = pageRect.width() - widgetRect.width() / 2 - 10;
-    upperBoundX = pageRect.width() - widgetRect.width();
-
-    qreal widgetX = qBound(lowerBoundX, widgetRect.x(), upperBoundX);
-    qreal widgetY = qBound(qreal(64), widgetRect.y(), pageRect.height() - widgetRect.height());
-
-    widget->setPos(widgetX, widgetY);
+    if ( !layout() ) {
+        HsWidgetHost *widget = qobject_cast<HsWidgetHost *>(sender());
+        QRectF widgetRect = widget->geometry();
+        QRectF pageRect = HsScene::mainWindow()->layoutRect();
+        qreal widgetX = qBound(qreal(0), widgetRect.x(), pageRect.width() - widgetRect.width());
+        qreal widgetY = qBound(qreal(64), widgetRect.y(), pageRect.height() - widgetRect.height());
+        widget->setPos(widgetX, widgetY);
+    } else {
+        layout()->invalidate();
+    }
 }
 
 void HsPage::onWidgetAvailable()
 {
     HsWidgetHost *widget = qobject_cast<HsWidgetHost *>(sender());
-    
+
     mUnavailableWidgets.removeOne(widget);
     mWidgets.append(widget);
 
@@ -422,7 +448,7 @@
     widget->startWidget(isActivePage());
     widget->show();
 }
- 
+
 void HsPage::onWidgetUnavailable()
 {
     HsWidgetHost *widget = qobject_cast<HsWidgetHost *>(sender());
@@ -443,8 +469,8 @@
 
 void HsPage::onOrientationChanged(Qt::Orientation orientation)
 {
-    QRectF rect = HsScene::mainWindow()->layoutRect();    
-    
+    QRectF rect = HsScene::mainWindow()->layoutRect();
+
     HsWidgetPositioningOnOrientationChange *converter =
         HsWidgetPositioningOnOrientationChange::instance();
 
@@ -465,5 +491,16 @@
             widget->setPos(presentation.pos());
             widget->setZValue(presentation.zValue);
         }
-    }   
+    }
 }
+
+/*!
+    Clears new widgets list and resets layout.
+*/
+void HsPage::resetNewWidgets()
+{
+    mNewWidgets.clear();
+    setLayout(0);
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsdomainmodel/src/hspagenewwidgetlayout.cpp	Wed Jun 23 18:03:36 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 <QPainter>
+#include <QRectF>
+#include <QGraphicsLinearLayout>
+#include <HbInstance>
+#include <QGraphicsSceneResizeEvent>
+#include <QGraphicsAnchorLayout>
+
+#include "hsdomainmodeldatastructures.h"
+#include "hspagenewwidgetlayout.h"
+#include "hsscene.h"
+#include "hsdatabase.h"
+#include "hswidgethost.h"
+#include "hswallpaper.h"
+#include "hswidgetpositioningonwidgetadd.h"
+#include "hswidgetpositioningonorientationchange.h"
+#include "hsconfiguration.h"
+
+
+/*!
+    \class HsPageNewWidgetLayout
+    \ingroup group_hsdomainmodel
+    \brief Represents a page in the framework.
+    HsPage is a parent for a group of widgets. HsPage can have a wallpaper.
+*/
+
+/*!
+    Constructor.
+
+    \a parent Owner.
+*/
+HsPageNewWidgetLayout::HsPageNewWidgetLayout(QGraphicsLayoutItem *parent) :
+    QGraphicsLayout(parent)
+{
+    mSize = HsScene::mainWindow()->layoutRect().size();
+}
+
+/*!
+    Destructor.
+*/
+HsPageNewWidgetLayout::~HsPageNewWidgetLayout()
+{
+}
+
+/*!
+    Returns children count.
+*/
+int HsPageNewWidgetLayout::count() const
+{
+    return mNewWidgets.count();
+}
+
+/*!
+    Returns item index of \a i.
+*/
+QGraphicsLayoutItem *HsPageNewWidgetLayout::itemAt(int i) const
+{
+    return mNewWidgets.at(i);
+}
+
+/*!
+    Removes item \a index.
+*/
+void HsPageNewWidgetLayout::removeAt(int index)
+{
+    mNewWidgets.removeAt(index);
+}
+
+/*!
+    Size hint.
+*/
+QSizeF HsPageNewWidgetLayout::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
+{
+     switch (which) {
+     case Qt::MinimumSize:
+     case Qt::PreferredSize:
+         return mSize;
+     case Qt::MaximumSize:
+         return mSize;
+     default:
+         break;
+     }
+     return constraint;
+}
+
+/*!
+    Recalculates children positions.
+*/
+void HsPageNewWidgetLayout::setGeometry(const QRectF &rect)
+{
+    QGraphicsLayout::setGeometry(rect);
+   
+    QList<QRectF> rects;
+    foreach (HsWidgetHost *newWidget, mNewWidgets) {
+        rects << QRectF(QPointF(), newWidget->preferredSize());
+    }
+   HsWidgetPositioningOnWidgetAdd *algorithm =
+        HsWidgetPositioningOnWidgetAdd::instance();
+    QRectF pageRect = HsScene::mainWindow()->layoutRect();
+    pageRect.adjust( (qreal)0,(qreal)64,(qreal)0,(qreal)0);
+    QList<QRectF> calculatedRects =
+        algorithm->convert(pageRect, rects, QPointF());
+
+    for ( int i=0; i<mNewWidgets.count(); i++) {
+        mNewWidgets.at(i)->setGeometry(calculatedRects.at(i));
+    }
+}
+
+/*!
+    Adds item to layout.
+*/
+void HsPageNewWidgetLayout::addItem(HsWidgetHost *item)
+{
+    mNewWidgets.append(item);
+}
--- a/homescreenapp/hsdomainmodel/src/hsscene.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsscene.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -19,7 +19,6 @@
 
 #include <HbInstance>
 #include <HbMainWindow>
-#include <HbDeviceProfile>
 
 #include "hsdomainmodeldatastructures.h"
 #include "hsscene.h"
@@ -29,6 +28,14 @@
 #include "hswallpaper.h"
 #include "hsconfiguration.h"
 
+
+/*!
+    \class HsScene
+    \ingroup group_hsdomainmodel
+    \brief Represents a scene in the framework.
+    HsScene can have a wallpaper.
+*/
+
 /*!
     Destructor.
 */
@@ -58,23 +65,17 @@
         return false;
     }
 
-    mMaximumPageCount = HsConfiguration::maximumPageCount();
-
-    calculateWidgetSizeLimitations();
-
-    if (sceneData.portraitWallpaper.isEmpty()) {
-        mWallpaper->setImagesById();
-    } else {
-        mWallpaper->setImagesByPaths(
-            sceneData.landscapeWallpaper, 
-            sceneData.portraitWallpaper);
-    }
+    mDatabaseId = sceneData.id;
 
     QList<HsPageData> pageDatas;
     if (!db->pages(pageDatas) || pageDatas.empty()) {
         return false;
     }
     
+    if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) {
+        mWallpaper = new HsSceneWallpaper(this);
+    }
+
     foreach (HsPageData pageData, pageDatas) {
         HsPage *page = new HsPage;
         page->setDatabaseId(pageData.id);
@@ -84,35 +85,17 @@
             delete page;
             continue;
         }
-        if (pageData.id == HsConfiguration::defaultPageId()) {
+        if (pageData.id == HSCONFIGURATION_GET(defaultPageId)) {
             mActivePage = page;
             mActivePage->setRemovable(false);
         }
     }
-
-    QApplication::instance()->installEventFilter(this);
-
+    
 	return true;
 }
 
 /*!
-    Calculate maximum and minimum widget sizes 
-*/
-void HsScene::calculateWidgetSizeLimitations()
-{
-    // 1un = 6.7px = 2mm
-    mMaximumWidgetSizeInUnits = QSizeF(HsConfiguration::maximumWidgetWidth(),
-                                       HsConfiguration::maximumWidgetHeight());
-    mMinimumWidgetSizeInUnits = QSizeF(HsConfiguration::minimumWidgetWidth(),
-                                       HsConfiguration::minimumWidgetHeight());
-    HbDeviceProfile profile;
-    qreal unitToPixelFactor = profile.unitValue();
-    mMaximumWidgetSizeInPixels = unitToPixelFactor * mMaximumWidgetSizeInUnits;
-    mMinimumWidgetSizeInPixels = unitToPixelFactor * mMinimumWidgetSizeInUnits;
-}
-
-/*!
-    Return wallpaper. 
+    Return wallpaper.
 */
 HsWallpaper *HsScene::wallpaper() const
 {
@@ -126,7 +109,7 @@
 {
     return mPages;
 }
-    
+
 /*!
     Add page \a page.
 */
@@ -135,13 +118,13 @@
     if (!page) {
         return false;
     }
-   
+
     if (mPages.contains(page)) {
         return true;
     }
 
     HsDatabase *db = HsDatabase::instance();
-    
+
     HsPageData data;
     data.id = page->databaseId();
     if (!db->page(data)) {
@@ -160,13 +143,13 @@
             return false;
         }
     }
-    
+
     db->commit();
-    
+
     mPages.insert(addPosition, page);
     return true;
 }
-    
+
 /*!
     Removes page \a page.
 */
@@ -205,7 +188,7 @@
     mPages.removeOne(page);
     return true;
 }
- 
+
 /*!
     Set active page \a page.
 */
@@ -214,7 +197,7 @@
     if (!page) {
         return false;
     }
-   
+
     if (!mPages.contains(page)) {
         return false;
     }
@@ -264,53 +247,13 @@
 }
 
 /*!
-    Return maximum number of pages.
-*/
-int HsScene::maximumPageCount() const
-{
-    return mMaximumPageCount;
-}
-
-/*!
-    Return maximum widget size in pixels.
-*/
-QSizeF HsScene::maximumWidgetSizeInPixels() const
-{
-    return mMaximumWidgetSizeInPixels;
-}
-
-/*!
-    Return minimum widget size in pixels.
-*/
-QSizeF HsScene::minimumWidgetSizeInPixels() const
-{
-    return mMinimumWidgetSizeInPixels;
-}
-
-/*!
-    Return maximum widget size in units.
-*/
-QSizeF HsScene::maximumWidgetSizeInUnits() const
-{
-    return mMaximumWidgetSizeInUnits;
-}
-
-/*!
-    Return minimum widget size in units.
-*/
-QSizeF HsScene::minimumWidgetSizeInUnits() const
-{
-    return mMinimumWidgetSizeInUnits;
-}
-
-/*!
     Set active widget \a widget.
 */
 void HsScene::setActiveWidget(HsWidgetHost *widget)
 {
     mActiveWidget = widget;
 }
- 
+
 /*!
    Return active widget.
 */
@@ -319,7 +262,7 @@
     return mActiveWidget;
 }
 /*!
-    Toggle application online state. Defaults 
+    Toggle application online state. Defaults
     to true.
 */
 void HsScene::setOnline(bool online)
@@ -339,17 +282,28 @@
 }
 
 /*!
-    Singleton. 
+    Singleton.
 */
 HsScene *HsScene::instance()
 {
-    if (!mInstance) {
-        mInstance = new HsScene;
-        mInstance->setParent(HsScene::mainWindow());
-    }
     return mInstance;
 }
 
+HsScene *HsScene::takeInstance()
+{
+    HsScene *instance = mInstance;
+    mInstance = 0;
+    return instance;
+}
+ 
+void HsScene::setInstance(HsScene *instance)
+{
+    if (mInstance != instance) {
+        delete mInstance;
+        mInstance = instance; 
+    }    
+}
+
 /*!
     Return main window.
 */
@@ -389,18 +343,12 @@
 */
 HsScene::HsScene(QObject *parent)
   : QObject(parent),
-    mDatabaseId(-1),    
-    mWallpaper(0),    
+    mDatabaseId(-1),
+    mWallpaper(0),
     mActivePage(0),
     mActiveWidget(0),
-    mIsOnline(true),
-    mMaximumPageCount(1),
-    mMaximumWidgetSizeInPixels(321.6, 261.3),
-    mMinimumWidgetSizeInPixels(58.625, 58.625),
-    mMaximumWidgetSizeInUnits(48, 39),
-    mMinimumWidgetSizeInUnits(8.75, 8.75)
+    mIsOnline(true)
 {
-    mWallpaper = new HsWallpaper;
 }
 
 /*!
--- a/homescreenapp/hsdomainmodel/src/hsshortcutservice.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hsshortcutservice.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -28,17 +28,33 @@
     const char gShortcutWidgetUri[] = "hsshortcutwidgetplugin";
 }
 
+
+/*!
+    \class HsShortcutService
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
+/*!
+
+*/
 HsShortcutServicePrivate::HsShortcutServicePrivate(QStateMachine *stateMachine, QObject *parent)
     : QObject(parent),
 	  mStateMachine(stateMachine)
 {
 }
 
+/*!
+
+*/
 HsShortcutServicePrivate::~HsShortcutServicePrivate()
 {
 
 }
 
+/*!
+
+*/
 void HsShortcutServicePrivate::executeCollectionAction(
         int shortcutId, const QString& collectionType)
 {
@@ -47,6 +63,9 @@
 	mStateMachine->postEvent(menuEvent);
 }
 
+/*!
+
+*/
 bool HsShortcutServicePrivate::isItemShortcutWidget(int itemId)
 {
     HsDatabase *db = HsDatabase::instance();
@@ -65,6 +84,9 @@
 	return false;
 }
 
+/*!
+
+*/
 HsShortcutService *HsShortcutService::instance(QStateMachine *stateMachine)
 {
     if (!mInstance && stateMachine) {
@@ -73,21 +95,34 @@
     return mInstance;
 }
 
+/*!
+
+*/
 HsShortcutService::~HsShortcutService()
 {
+    
 }
 
+/*!
+
+*/
 void HsShortcutService::executeCollectionAction(
         int shortcutId, const QString& collectionType)
 {
     mD->executeCollectionAction(shortcutId, collectionType);
 }
 
+/*!
+
+*/
 bool HsShortcutService::isItemShortcutWidget(int itemId)
 {
     return mD->isItemShortcutWidget(itemId);
 }
 
+/*!
+
+*/
 HsShortcutService::HsShortcutService(QStateMachine *stateMachine, QObject *parent)
     : QObject(parent)
 {
--- a/homescreenapp/hsdomainmodel/src/hswallpaper.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hswallpaper.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -16,112 +16,313 @@
 */
 
 #include <QDir>
+#include <QFile>
+#include <QVariantHash>
 #include <QGraphicsLinearLayout>
+
+#include <HbMainWindow>
 #include <HbIconItem>
-#include <HbMainWindow>
+
 #include "hswallpaper.h"
 #include "hsscene.h"
+#include "hspage.h"
+#include "hswallpaperloader.h"
+#include "hsconfiguration.h"
 
+/*!
+    \class HsWallpaper
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
+/*!
+
+*/
 HsWallpaper::HsWallpaper(QGraphicsItem *parent)
   : HbWidget(parent),
-    mOrientation(Qt::Vertical),
-    mIconItem(0)
+    mId(-1),
+    mIsDefaultImage(false),
+    mIconItem(0),
+    mLoader(0)
 {
+    setFlag(ItemHasNoContents);
+    setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored);
+
+    mLoader = new HsWallpaperLoader(this);
+    connect(mLoader, SIGNAL(finished()), SLOT(onLoaderFinished()), Qt::UniqueConnection);
+    connect(mLoader, SIGNAL(failed()), SLOT(onLoaderFailed()), Qt::UniqueConnection);
+
     mIconItem = new HbIconItem();
-    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout();
+    QGraphicsLinearLayout *layout = new QGraphicsLinearLayout;
     layout->setContentsMargins(0, 0, 0, 0);
     layout->addItem(mIconItem);
     setLayout(layout);
 
     connect(HsScene::mainWindow(),
         SIGNAL(orientationChanged(Qt::Orientation)),
-        SLOT(onOrientationChanged(Qt::Orientation)));
+        SLOT(updateIconItem(Qt::Orientation)));
 }
 
+/*!
+
+*/
 HsWallpaper::~HsWallpaper()
 {
 }
 
-bool HsWallpaper::setImagesById(const QString &id,
-                                const QString &ext)
-{
-    return setImagesByPaths(
-        wallpaperPath(Qt::Horizontal, id, ext),
-        wallpaperPath(Qt::Vertical, id, ext));
-}
+/*!
 
-bool HsWallpaper::setImagesByPaths(const QString &landscapeImagePath,
-                                   const QString &portraitImagePath)
+*/
+void HsWallpaper::setImage(const QString &path)
 {
-    mLImagePath = landscapeImagePath;
-    mPImagePath = portraitImagePath;
-    mOrientation = HsScene::orientation();
-
-    if (mOrientation == Qt::Horizontal) {
-        setLandscapeImage(mLImagePath, true);
+    if (!path.isEmpty()) {
+        if(mLoader->isRunning()) {
+            mLoader->cancel();
+        }
+    
+        mLoader->setSourcePath(path);
+        mLoader->setTargets(createTargets(path));
+        mLoader->start();
     } else {
-        setPortraitImage(mPImagePath, true);
-    }
-    return true;
-}
-
-void HsWallpaper::setPortraitImage(const QString &path, bool activate)
-{
-    mPImagePath = path;
-    if (activate) {
-        mIconItem->setIcon(HbIcon(QIcon(path)));
-    }
-}
-
-void HsWallpaper::setLandscapeImage(const QString &path, bool activate)
-{
-    mLImagePath = path;
-    if (activate) {
-        mIconItem->setIcon(HbIcon(QIcon(path)));
+        emit imageSetFailed();
     }
 }
 
-bool HsWallpaper::removeImages()
+/*!
+
+*/
+void HsWallpaper::setDefaultImage()
+{
+    if (mIsDefaultImage) {
+        return;
+    }
+
+    QDir dir(wallpaperDirectory());
+    QStringList filters;
+    filters << "default_portrait.*";
+    filters << "default_landscape.*";
+    QFileInfoList infos = dir.entryInfoList(
+        filters, QDir::Files, QDir::Name | QDir::IgnoreCase);
+
+    Q_ASSERT(infos.count() == 2);
+
+    mIsDefaultImage = true;
+    mLandscapeImagePath = infos.first().absoluteFilePath();
+    mPortraitImagePath = infos.last().absoluteFilePath();
+
+    updateIconItem(HsScene::orientation());
+}
+
+/*!
+
+*/
+void HsWallpaper::remove()
 {
-    if (mLImagePath != wallpaperPath(Qt::Horizontal)) {
-        QFile::remove(mLImagePath);
-        mLImagePath.clear();
+    if (mIsDefaultImage) {
+        mIsDefaultImage = false;
+    } else {
+        QFile::remove(mPortraitImagePath);
+        QFile::remove(mLandscapeImagePath);
     }
-    if (mPImagePath != wallpaperPath(Qt::Vertical)) {
-        QFile::remove(mPImagePath);
-        mPImagePath.clear();
+    mPortraitImagePath.clear();
+    mLandscapeImagePath.clear();
+}
+
+/*!
+
+*/
+bool HsWallpaper::setExistingImage()
+{
+    QDir dir(wallpaperDirectory());
+    QStringList filters;
+    filters << QString("%1_portrait.*").arg(mId);
+    filters << QString("%1_landscape.*").arg(mId);
+    QFileInfoList infos = dir.entryInfoList(
+        filters, QDir::Files, QDir::Name | QDir::IgnoreCase);
+
+    Q_ASSERT(infos.isEmpty() || infos.count() == 2);
+
+    if (infos.isEmpty()) {
+        return false;
     }
+
+    mIsDefaultImage = false;
+    mLandscapeImagePath = infos.first().absoluteFilePath();
+    mPortraitImagePath = infos.last().absoluteFilePath();
+
+    updateIconItem(HsScene::orientation());
     return true;
 }
 
-QString HsWallpaper::wallpaperDirectory()
+QString HsWallpaper::rootDirectory() const
 {
 #ifdef Q_OS_SYMBIAN
-    static QString directory =
-        QDir::toNativeSeparators("c:/private/20022f35/wallpapers/");
+    QString directory("c:/private/20022f35/wallpapers/");
 #else
-    static QString directory =
-        QDir::toNativeSeparators(QDir::currentPath() + "/private/20022f35/wallpapers/");
+    QString directory(QDir::currentPath() + "/private/20022f35/wallpapers/");
 #endif
 
+#ifdef HSDOMAINMODEL_TEST
+    directory = QDir::currentPath() + "/wallpapers/";
+#endif
     return directory;
 }
 
-QString HsWallpaper::wallpaperPath(Qt::Orientation orientation,
-                                   const QString &id,
-                                   const QString &ext)
+/*!
+
+*/
+void HsWallpaper::onLoaderFinished()
+{
+    if (mIsDefaultImage) {
+        mIsDefaultImage = false;
+    } else {
+        QFile::remove(mPortraitImagePath);
+        QFile::remove(mLandscapeImagePath);
+    }
+    foreach (QString path, mLoader->targets().keys()) {
+        QString newName = path; newName.remove("temp");
+        QFile::rename(path, newName);
+    }
+    setExistingImage();
+    emit imageSet();
+}
+
+/*!
+
+*/
+void HsWallpaper::onLoaderFailed()
+{
+    foreach (QString path, mLoader->targets().keys()) {
+        QFile::remove(path);
+    }
+    emit imageSetFailed();
+}
+
+/*!
+
+*/
+void HsWallpaper::updateIconItem(Qt::Orientation orientation)
 {
-    QString orientationString = orientation == Qt::Horizontal ?
-        "_landscape." : "_portrait.";
-    return wallpaperDirectory() + id +
-           orientationString + ext;
+    if (orientation == Qt::Vertical) {
+        mIconItem->setIcon(HbIcon(QIcon(mPortraitImagePath)));
+    } else {
+        mIconItem->setIcon(HbIcon(QIcon(mLandscapeImagePath)));
+    }
+}
+
+/*!
+
+*/
+HsSceneWallpaper::HsSceneWallpaper(HsScene *scene, QGraphicsItem *parent)
+  : HsWallpaper(parent),
+    mScene(0)
+{
+    setScene(scene);
+}
+
+/*!
+
+*/
+HsSceneWallpaper::~HsSceneWallpaper()
+{
+}
+
+/*!
+
+*/
+void HsSceneWallpaper::setScene(HsScene *scene)
+{
+    if (!scene) {
+        return;
+    }
+
+    mScene = scene;
+    mId = scene->databaseId();
+    if (!setExistingImage()) {
+        setDefaultImage();
+    }
 }
 
-void HsWallpaper::onOrientationChanged(Qt::Orientation orientation)
+/*!
+
+*/
+QString HsSceneWallpaper::wallpaperDirectory() const
+{
+    return QDir::toNativeSeparators(rootDirectory() + "scene/");
+}
+
+/*!
+
+*/
+QVariantHash HsSceneWallpaper::createTargets(const QString &sourcePath)
 {
-    if (orientation == Qt::Horizontal) {
-        mIconItem->setIcon(HbIcon(QIcon(mLImagePath)));
-    } else {
-        mIconItem->setIcon(HbIcon(QIcon(mPImagePath)));
+    QVariantHash targets;
+
+    QString path = wallpaperDirectory()
+                   + QString("temp%1_").arg(mId)
+                   + QString("%1.")
+                   + QFileInfo(sourcePath).suffix();
+
+    targets.insert(path.arg("portrait"), QSize((2 * 360) + HSCONFIGURATION_GET(bounceEffect), 640));
+    targets.insert(path.arg("landscape"), QSize((2 * 640) + HSCONFIGURATION_GET(bounceEffect), 360));
+    return targets;
+}
+
+/*!
+ PAGE
+*/
+HsPageWallpaper::HsPageWallpaper(HsPage *page, QGraphicsItem *parent)
+  : HsWallpaper(parent),
+    mPage(0)
+{
+    setPage(page);
+}
+
+/*!
+
+*/
+HsPageWallpaper::~HsPageWallpaper()
+{
+}
+
+/*!
+
+*/
+void HsPageWallpaper::setPage(HsPage *page)
+{
+    if (!page) {
+        return;
+    }
+
+    mPage = page;
+    mId = page->databaseId();
+    if (!setExistingImage()) {
+        setDefaultImage();
     }
 }
+
+/*!
+
+*/
+QString HsPageWallpaper::wallpaperDirectory() const
+{
+    return QDir::toNativeSeparators(rootDirectory() + "page/");
+}
+
+/*!
+
+*/
+QVariantHash HsPageWallpaper::createTargets(const QString &sourcePath)
+{
+    QVariantHash targets;
+
+    QString path = wallpaperDirectory()
+                   + QString("temp%1_").arg(mId)
+                   + QString("%1.")
+                   + QFileInfo(sourcePath).suffix();
+
+    targets.insert(path.arg("portrait"), QSize(360, 640));
+    targets.insert(path.arg("landscape"), QSize(640, 360));
+    return targets;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsdomainmodel/src/hswallpaperloader.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QFileInfo>
+#include <QVariantHash>
+
+#include "hswallpaperloader.h"
+#include "hswallpaperloaderthread.h"
+
+/*!
+    \class HsWallpaperLoader
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
+/*!
+
+*/
+HsWallpaperLoader::HsWallpaperLoader(QObject *parent)
+  : QObject(parent),
+    mIsRunning(false),
+    mNumberOfFinishedThreads(0)
+{
+}
+
+/*!
+
+*/
+HsWallpaperLoader::~HsWallpaperLoader()
+{
+}
+
+/*!
+
+*/
+void HsWallpaperLoader::start()
+{
+    if (mTargets.isEmpty()) {
+        emit finished();
+        return;
+    }
+
+    mNumberOfFinishedThreads = 0;
+    
+    HsWallpaperLoaderThread *thread = 0;
+    QHashIterator<QString, QVariant> i(mTargets);
+    while (i.hasNext()) {
+        i.next();
+        thread = new HsWallpaperLoaderThread;
+        mThreads.append(thread);
+        thread->setSourcePath(mSourcePath);
+        thread->setTargetPath(i.key());
+        thread->setTargetSize(i.value().toSize());
+        connect(thread, SIGNAL(finished()), SLOT(onThreadFinished()));
+        thread->start();
+    }
+
+    mIsRunning = true;
+}
+
+/*!
+
+*/
+void HsWallpaperLoader::cancel()
+{
+    foreach (QThread *thread, mThreads) {
+        thread->disconnect(this);
+        thread->wait();
+    }
+    cleanup();
+}
+
+/*!
+
+*/
+void HsWallpaperLoader::onThreadFinished()
+{
+    ++mNumberOfFinishedThreads;
+    if (mNumberOfFinishedThreads == mThreads.count()) {
+        bool ok = true;
+        foreach (HsWallpaperLoaderThread *thread, mThreads) {
+            if (!thread->result()) {
+                ok = false;
+                break;
+            }
+        }
+        if (ok) {
+            emit finished();
+        } else {            
+            emit failed();
+        }
+        cleanup();
+    }
+}
+
+/*!
+
+*/
+void HsWallpaperLoader::cleanup()
+{
+    mIsRunning = false;
+    mNumberOfFinishedThreads = 0;
+    qDeleteAll(mThreads);
+    mThreads.clear();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsdomainmodel/src/hswallpaperloaderthread.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,75 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <QImageReader>
+#include <QRect>
+
+#include "hswallpaperloaderthread.h"
+
+
+/*!
+    \class HsWallpaperLoaderThread
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
+/*!
+
+*/
+HsWallpaperLoaderThread::HsWallpaperLoaderThread(QObject *parent)
+  : QThread(parent),
+    mResult(false)
+{
+}
+
+/*!
+
+*/
+HsWallpaperLoaderThread::~HsWallpaperLoaderThread()
+{
+}
+
+/*!
+    \internal
+    Scales and crops source image using target rect.
+    Centers target rect automatically.
+    Saves scaled and cropped image as given target.
+    Result can be read when finished by using result().
+*/
+void HsWallpaperLoaderThread::run() 
+{
+    mResult = true;
+    QImageReader imageReader(mSourcePath);
+    QRect clipRect(QPoint(), mTargetSize);
+    
+    if (imageReader.canRead()) {
+        QSize sourceSize = imageReader.size();
+        
+        //Scale image's size to target's dimensions
+        sourceSize.scale(clipRect.width(), clipRect.height(),
+                         Qt::KeepAspectRatioByExpanding);
+        imageReader.setScaledSize(sourceSize);
+
+        //Crop center part of the scaled image as a target image
+        clipRect.moveCenter(QPoint(sourceSize.width() / 2, sourceSize.height() / 2));
+        imageReader.setScaledClipRect(clipRect);
+
+        mResult = imageReader.read().save(mTargetPath);
+    } else {
+        mResult = false;
+    }
+}
--- a/homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hswidgetcomponent.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -25,6 +25,12 @@
 
 
 /*!
+    \class HsWidgetComponent
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
+/*!
 
 */
 HsWidgetComponent::~HsWidgetComponent()
--- a/homescreenapp/hsdomainmodel/src/hswidgethost.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsdomainmodel/src/hswidgethost.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -50,6 +50,16 @@
 
 QTM_USE_NAMESPACE
 
+
+/*!
+    \class HsWidgetHost
+    \ingroup group_hsdomainmodel
+    \brief 
+*/
+
+/*!
+
+*/
 HsWidgetHost::HsWidgetHost(int databaseId, QGraphicsItem *parent)
   : HbWidget(parent),
     mDatabaseId(databaseId),
@@ -253,7 +263,7 @@
     QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup();
 
     QPropertyAnimation *animation = new QPropertyAnimation(this, "scale");
-    animation->setDuration(HsConfiguration::widgetDragEffectDuration());
+    animation->setDuration(HSCONFIGURATION_GET(widgetDragEffectDuration));
     animation->setEndValue(1.1);
     animationGroup->addAnimation(animation);
 
@@ -278,7 +288,7 @@
     QParallelAnimationGroup *animationGroup = new QParallelAnimationGroup;
 
     QPropertyAnimation *animation = new QPropertyAnimation(this, "scale");
-    animation->setDuration(HsConfiguration::widgetDropEffectDuration());
+    animation->setDuration(HSCONFIGURATION_GET(widgetDropEffectDuration));
     animation->setEndValue(1);
     animationGroup->addAnimation(animation);
 
@@ -527,10 +537,9 @@
 
     mWidget->installEventFilter(this);
 
-    HsScene *scene = HsScene::instance();
-    setMaximumSize(scene->maximumWidgetSizeInPixels());
-    setMinimumSize(scene->minimumWidgetSizeInPixels());
-
+    setMinimumSize(HSCONFIGURATION_GET(minimumWidgetSizeInPixels));
+    setMaximumSize(HSCONFIGURATION_GET(maximumWidgetSizeInPixels));
+    
     loadPresentation();
 
     mWidget->setParentItem(this);
--- a/homescreenapp/hshomescreenclientplugin/src/hshomescreenclient.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hshomescreenclientplugin/src/hshomescreenclient.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -19,7 +19,7 @@
 #include <xqrequestinfo.h>
 #include <QEventLoop>
 
-const char INTERFACE_NAME[] = "com.nokia.services.hsapplication.IHomeScreenClient";
+const char INTERFACE_NAME[] = "com.nokia.symbian.IHomeScreenClient";
 
 
 /*!
--- a/homescreenapp/hsmenuclientplugin/inc/hsmenuclient.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsmenuclientplugin/inc/hsmenuclient.h	Wed Jun 23 18:03:36 2010 +0300
@@ -26,12 +26,17 @@
 
 //mandatory keys
 const QString hsItemName("item:name");
+// or for localized name
+const QString hsItemLocName("item:locname");
+
 const QString hsitemLaunchUri("item:launchuri");
 const QString hsitemPublisherId("item:publisherId");
 
 //not mandatory
 const QString hsItemWidgetUri("widget:uri");
 const QString hsItemDescription("item:description");
+// or for localized name
+const QString hsItemLocDescription("item:locdescription");
 
 //for icon - not mandatory
 const QString hsIconFileName("icon:filename");//to display specific icon from file
--- a/homescreenapp/hsmenuclientplugin/src/hsmenuclient.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsmenuclientplugin/src/hsmenuclient.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -106,9 +106,23 @@
         {
             QSharedPointer<CaEntry> update_entry = CaService::instance()->getEntry(pref.take(hsItemId).toInt());
             
-            update_entry->setText(pref.take(hsItemName).toString());
+            if(pref.contains(hsItemLocName))
+                {
+                update_entry->setText(pref.take(hsItemLocName).toString(),true);
+                }
+            else
+                {
+                update_entry->setText(pref.take(hsItemName).toString());   
+                }
             
-            update_entry->setDescription(pref.take(hsItemDescription).toString());
+            if(pref.contains(hsItemLocDescription))
+                {
+                update_entry->setDescription(pref.take(hsItemLocDescription).toString(), true);
+                }
+            else
+                {
+                update_entry->setDescription(pref.take(hsItemDescription).toString());
+                }                                             
             
             iconDesc.setFilename(pref.take(hsIconFileName).toString());
             iconDesc.setSkinId(pref.take(hsIconName).toString());
@@ -122,19 +136,33 @@
             
             result = CaService::instance()->updateEntry(*update_entry);
         }
-    else if (pref.contains(hsItemName) && pref.contains(hsitemLaunchUri) && pref.contains(hsitemPublisherId))
+    else if ((pref.contains(hsItemName) || pref.contains(hsItemLocName)) && pref.contains(hsitemLaunchUri) && pref.contains(hsitemPublisherId))
         {
             CaEntry add_entry(ItemEntryRole);
             add_entry.setEntryTypeName(templatedApplicationTypeName());
             // mandatory values
-            add_entry.setText(pref.take(hsItemName).toString());
+            if(pref.contains(hsItemLocName))
+                {
+                add_entry.setText(pref.take(hsItemLocName).toString(),true);
+                }
+            else
+                {
+                add_entry.setText(pref.take(hsItemName).toString());
+                }
             
             iconDesc.setFilename(pref.take(hsIconFileName).toString());
             iconDesc.setSkinId(pref.take(hsIconName).toString());
             iconDesc.setApplicationId(pref.take(hsIconApplicationId).toString());            
             add_entry.setIconDescription(iconDesc);  
             
-            add_entry.setDescription(pref.take(hsItemDescription).toString());
+            if(pref.contains(hsItemLocDescription))
+                {
+                add_entry.setDescription(pref.take(hsItemLocDescription).toString(), true);
+                }
+            else
+                {
+                add_entry.setDescription(pref.take(hsItemDescription).toString());
+                }  
             QMapIterator<QString, QVariant> k(pref);
             while (k.hasNext()) {
                 k.next();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsutils/inc/hsspinnerdialog.h	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*    Spinner dialog shown when setting new background image
+*
+*/
+
+#ifndef __SPINNERDIALOG_H
+#define __SPINNERDIALOG_H
+
+#include <HbDialog>
+#include "hsutils_global.h"
+#include "hstest_global.h"
+class HbIconItem;
+HOMESCREEN_TEST_CLASS(t_hsUtils)
+
+class HSUTILS_EXPORT HsSpinnerDialog : public HbDialog
+{
+    Q_OBJECT
+    
+public: 
+    HsSpinnerDialog(QGraphicsItem *parent=0);
+    ~HsSpinnerDialog();
+    
+public slots:
+    void start();
+    void stop();
+    
+private:    
+    HOMESCREEN_TEST_FRIEND_CLASS(t_hsUtils)
+};
+
+#endif // __SPINNERDIALOG_H
--- a/homescreenapp/hsutils/inc/hswallpaperhelper.h	Fri Jun 11 13:30:16 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:  Homescreen wallpaper helper class.
-*
-*/
-
-#ifndef HSWALLPAPERHELPER_H
-#define HSWALLPAPERHELPER_H
-
-#include "hsutils_global.h"
-#include "hstest_global.h"
-
-HOMESCREEN_TEST_CLASS(t_hsUtils)
-
-class HSUTILS_EXPORT HsWallpaperHelper
-{	
-public:
-    static QImage processImage(const QString &sourcePath, 
-    						   const QRect &targetRect,
-    						   const QRect &sourceRect,
-    						   bool centerTarget = true);
-    
-private:  
-    HOMESCREEN_TEST_FRIEND_CLASS(t_hsUtils)
-};
-
-#endif // HSWALLPAPERHELPER_H
--- a/homescreenapp/hsutils/inc/hswallpaperimagereader.h	Fri Jun 11 13:30:16 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#ifndef HSWALLPAPERIMAGEREADER_H
-#define HSWALLPAPERIMAGEREADER_H
-
-#include <QThread>
-#include <QImage>
-
-#include "hsutils_global.h"
-
-#include "hstest_global.h"
-HOMESCREEN_TEST_CLASS(t_hsUtils)
-
-class HSUTILS_EXPORT HsWallpaperImageReader : public QThread
-{
-    Q_OBJECT
-
-public:    
-    HsWallpaperImageReader(QObject *parent = 0);
-    ~HsWallpaperImageReader();
-
-    void setSourcePath(const QString &sourcePath);
-    QString sourcePath() const;
-    void setSourceRect(const QRect &sourceRect);
-    QRect sourceRect() const;
-    void setTargetRect(const QRect &targetRect);
-    QRect targetRect() const;
-    void setCenterTarget(bool center);
-    bool centerTarget();
-    QImage processedImage() const;
-    
-signals:
-    void processingFinished();
-
-protected:
-    void run();
-
-private:
-    Q_DISABLE_COPY(HsWallpaperImageReader)
-
-private:
-    QString mSourcePath;
-    QRect mSourceRect;
-    QRect mTargetRect;
-    bool mCenterTarget;
-    QString mKey;
-    QImage mProcessedImage;
-
-    HOMESCREEN_TEST_FRIEND_CLASS(t_hsUtils)
-};
-
-#endif // HSWALLPAPERIMAGEREADER_H
--- a/homescreenapp/hsutils/inc/xqaiwcommon.h	Fri Jun 11 13:30:16 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 XQAIWCOMMON_H_
-#define XQAIWCOMMON_H_
-
-const QString KIAWGetImageServiceName = "com.nokia.services.mediafetcher.Image";
-
-enum XQAIWMultimediaFlags {
-    SelectionSingle,
-    SelectionMultiple
-};
-
-#endif /* XQAIWCOMMON_H_ */
--- a/homescreenapp/hsutils/inc/xqaiwgetimageclient.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/inc/xqaiwgetimageclient.h	Wed Jun 23 18:03:36 2010 +0300
@@ -29,8 +29,6 @@
 #include <QPointer>
 #include <QStringList>
 #include "hsutils_global.h"
-#include "xqaiwcommon.h"
-
 
 class HbAction;
 class HsImageGridWidget;
@@ -43,7 +41,7 @@
     ~XQAIWGetImageClient();
     
 public slots:
-    void fetch( QVariantMap filter, XQAIWMultimediaFlags flag);
+    void fetch();
     
 private slots: 
     void imageSelected(const QString&);
@@ -51,8 +49,8 @@
     void imageSelectionCancelled();
 
 signals:
-    void fetchComplete( QStringList filesList);
-    void fetchFailed( int errorCode );
+    void fetchCompleted(const QString&);
+    void fetchFailed(int, const QString&);
 
 private:
     void findImages(const QString &aDir, const QStringList &aFilters, QStringList &aFoundImages);
--- a/homescreenapp/hsutils/src/hsdeviceinfolistener.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/src/hsdeviceinfolistener.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -22,6 +22,13 @@
 #include <e32property.h>
 #include <startupdomainpskeys.h>
 #endif
+
+/*!
+    \class HsDeviceInfoListener
+    \ingroup group_hsutils
+    \brief 
+*/
+
 /*!
 
 */
--- a/homescreenapp/hsutils/src/hsimagefetcherclient.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/src/hsimagefetcherclient.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -23,18 +23,20 @@
 #include <QVariant>
 #ifdef Q_OS_SYMBIAN
 #include <xqaiwinterfacedescriptor.h>
+#include <xqaiwdecl.h>
 #endif // Q_OS_SYMBIAN
 
-namespace
-{
-    const char gFetcherInterface[] = "image";
-    const char gFetcherOperation[] = "fetch(QVariantMap,QVariant)";
-}
-
 #ifdef COVERAGE_MEASUREMENT
 #pragma CTC SKIP
 #endif //COVERAGE_MEASUREMENT
 
+
+/*!
+    \class HsImageFetcherClient
+    \ingroup group_hsutils
+    \brief 
+*/
+
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
@@ -74,13 +76,8 @@
         mReq = 0;
     }
 
-    mReq = mAppMgr.create(gFetcherInterface, gFetcherOperation, false);
-    if (mReq) {
-        QList<QVariant> args;
-        args << QVariantMap();
-        args << QVariant();
-        mReq->setArguments(args);
-        // Connect signals once
+    mReq = mAppMgr.create(XQI_IMAGE_FETCH, XQOP_IMAGE_FETCH, false);
+    if (mReq) {        
         connect(mReq, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
         connect(mReq, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&)));
     } else {
--- a/homescreenapp/hsutils/src/hspageindicator.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/src/hspageindicator.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -20,6 +20,13 @@
 #include "hspageindicator.h"
 #include "hspageindicatoritem.h"
 
+
+/*!
+    \class HsPageIndicator
+    \ingroup group_hsutils
+    \brief 
+*/
+
 /*!
 
 */
--- a/homescreenapp/hsutils/src/hspageindicatoritem.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/src/hspageindicatoritem.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -29,6 +29,13 @@
     const char gHighlightIconName[] = "qtg_graf_hspage_highlight";
 }
 
+
+/*!
+    \class HsPageIndicatorItem
+    \ingroup group_hsutils
+    \brief 
+*/
+
 /*!
 
 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/hsutils/src/hsspinnerdialog.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,85 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*    Spinner dialog shown when setting new background image
+*
+*/
+
+#include <HbIconItem>
+#include <HbDialog>
+#include <HbInstance>
+#include <HbDeviceProfile>
+
+#include "hsspinnerdialog.h"
+
+/*!
+    \internal
+    \class HsSpinnerDialog
+    \ingroup group_hsutils
+    \brief Spinner dialog, used when background image is changed. By default dialog is created with Qt::WA_DeleteOnClose attribute so dialog
+    is automatically deleted when closed.    
+    
+*/
+
+/*!
+    \internal
+    Constructor.
+    
+    \a parent Owner.
+*/
+HsSpinnerDialog::HsSpinnerDialog(QGraphicsItem *parent)
+: HbDialog(parent)
+{
+    setAttribute(Qt::WA_DeleteOnClose);
+    setModal(true);
+    setBackgroundFaded(true);
+    setTimeout(HbPopup::NoTimeout);
+    setBackgroundItem(0);
+    setDismissPolicy(HbPopup::NoDismiss);
+    HbIconItem* spinnerAnimation = new HbIconItem("qtg_anim_loading");
+    HbDeviceProfile profile;
+    qreal factor = profile.unitValue();
+    spinnerAnimation->setPreferredSize(factor*10,factor*10);
+    spinnerAnimation->setParentItem(this);
+    setContentWidget(spinnerAnimation);
+}
+
+/*!
+    \internal
+    Destructor.    
+*/
+HsSpinnerDialog::~HsSpinnerDialog()
+{
+}
+
+/*!
+    \internal
+    Starts spinner animation.
+*/
+void HsSpinnerDialog::start()
+{
+    HbInstance::instance()->allMainWindows().first()->setInteractive(false);
+    show();
+}
+
+/*!
+    \internal
+    Stops spinner animation, dialog is deleted after it is closed.
+*/
+void HsSpinnerDialog::stop()
+{
+    HbInstance::instance()->allMainWindows().first()->setInteractive(true);
+    close();
+}
+
--- a/homescreenapp/hsutils/src/hstitleresolver.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/src/hstitleresolver.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -32,6 +32,13 @@
     const char hsLocTextId_Title_NoService[] = "txt_homescreen_title_no_service";
 }
 
+
+/*!
+    \class HsTitleResolver
+    \ingroup group_hsutils
+    \brief 
+*/
+
 /*!
 
 */
--- a/homescreenapp/hsutils/src/hswallpaperhelper.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Homescreen wallpaper helper class.
-*
-*/
-
-#include <QString>
-#include <QImageReader>
-
-#include "hswallpaperhelper.h"
-
-
-/*!
-    \class HsWallpaperHelper
-    \ingroup group_hsapplication
-    \brief Homescreen wallpaper helper class.
-    Implements image scaling and cropping services. 
-*/
-
-/*!
-    \internal
-    Scales and crops (if needed) \a sourcePath image using \a targetRect. 
-    Centers target rect automatically if a\ centerTarget is true.
-    Pass empty a\ sourceRect to use full size source image as starting point. 
-    Returns processed image or null image if operation fails.
-*/
-QImage HsWallpaperHelper::processImage(const QString &sourcePath,
-                                       const QRect &targetRect,
-                                       const QRect &sourceRect,
-                                       bool centerTarget) 
-{
-    QImageReader imageReader(sourcePath);
-    
-    QRect tempTargetRect = targetRect;
-    QRect tempSourceRect = sourceRect;
-    
-    if (imageReader.canRead()) {
-        QSize sourceSize = imageReader.size();
-        if (tempSourceRect.isEmpty()) {
-            // If sourceRect not defined, uses full size image as source.
-            tempSourceRect.setRect(0, 0, sourceSize.width(), sourceSize.height());
-        }
-        sourceSize.scale(tempTargetRect.width(), tempTargetRect.height(), 
-            Qt::KeepAspectRatioByExpanding);
-        imageReader.setScaledSize(sourceSize);
-
-        if (centerTarget) {
-            tempTargetRect.moveCenter(QPoint(sourceSize.width() / 2, sourceSize.height() / 2));
-        }
-        imageReader.setScaledClipRect(tempTargetRect);
-        
-        return imageReader.read();
-    }
-    return QImage(); // returns null QImage
-}
--- a/homescreenapp/hsutils/src/hswallpaperimagereader.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#include <QImageReader>
-#include <QTime>
-
-#include "hswallpaperimagereader.h"
-
-/*!
-    Constructor.         
-*/
-HsWallpaperImageReader::HsWallpaperImageReader(QObject *parent):
-    QThread(parent),
-    mCenterTarget(false)
-{
-
-}
-
-/*!
-    Destructor.
-*/
-HsWallpaperImageReader::~HsWallpaperImageReader()
-{
-
-}
-
-/*!
-    Saves image source path
-*/
-void HsWallpaperImageReader::setSourcePath(const QString &sourcePath)
-{
-    mSourcePath = sourcePath;
-}
-
-/*!
-    Returns image source path
-*/
-QString HsWallpaperImageReader::sourcePath() const
-{
-    return mSourcePath;
-}
-
-/*!
-    Saves image source rect
-*/
-void HsWallpaperImageReader::setSourceRect(const QRect &sourceRect)
-{
-    mSourceRect = sourceRect;
-}
-
-/*!
-    Returns source rect
-*/
-QRect HsWallpaperImageReader::sourceRect() const
-{
-    return mSourceRect;
-}
-
-/*!
-    Saves image target rect
-*/
-void HsWallpaperImageReader::setTargetRect(const QRect &targetRect)
-{
-    mTargetRect = targetRect;
-}
-
-/*!
-    Returns target rect
-*/
-QRect HsWallpaperImageReader::targetRect() const
-{
-    return mTargetRect;
-}
-
-/*!
-    Centers image target rect
-*/
-void HsWallpaperImageReader::setCenterTarget(bool center)
-{
-    mCenterTarget = center;
-}
-
-/*!
-    Returns target centering
-*/
-bool HsWallpaperImageReader::centerTarget()
-{
-    return mCenterTarget;
-}
-
-/*!
-    Returns processed image
-*/
-QImage HsWallpaperImageReader::processedImage() const
-{
-    return mProcessedImage;
-}
-
-/*!
-    \internal
-    Scales and crops (if needed) image using target rect. 
-    Centers target rect automatically if mCenterTarget is true.
-    Pass empty set sourceRect to empty to use full size source image as starting point. 
-    Returns processed image or null image if operation fails.
-*/
-void HsWallpaperImageReader::run() 
-{
-    QImageReader imageReader(mSourcePath);
-
-    QRect tempTargetRect = mTargetRect;
-    QRect tempSourceRect = mSourceRect;
-    
-    if (imageReader.canRead()) {
-        QSize sourceSize = imageReader.size();
-        if (tempSourceRect.isEmpty()) {
-            // If sourceRect not defined, uses full size image as source.
-            tempSourceRect.setRect(0, 0, sourceSize.width(), sourceSize.height());
-        }
-        sourceSize.scale(tempTargetRect.width(), tempTargetRect.height(),
-                         Qt::KeepAspectRatioByExpanding);
-        imageReader.setScaledSize(sourceSize);
-
-        if (mCenterTarget) {
-            tempTargetRect.moveCenter(QPoint(sourceSize.width() / 2, sourceSize.height() / 2));
-        }
-        imageReader.setScaledClipRect(tempTargetRect);
-        mProcessedImage = imageReader.read();
-    } else {
-        mProcessedImage = QImage();
-    }
-}
--- a/homescreenapp/hsutils/src/hswidgetpositioningonorientationchange.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/src/hswidgetpositioningonorientationchange.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -18,8 +18,11 @@
 #include <QtGlobal>
 #include "hswidgetpositioningonorientationchange.h"
 
+
+
 /*!
     \class HsWidgetPositioningOnOrientationChange
+    \ingroup group_hsutils
     \brief Defines widget positioning on orientation change.
 
     Widget positioning on orientation change sets positions for
--- a/homescreenapp/hsutils/src/hswidgetpositioningonwidgetadd.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/src/hswidgetpositioningonwidgetadd.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -22,6 +22,13 @@
 
 const qreal offset = 40; //TODO: Implement this as configurable parameter
 
+
+/*!
+    \class HsWidgetPositioningOnWidgetAdd
+    \ingroup group_hsutils
+    \brief 
+*/
+
 /*!
     \class HsWidgetPositioningOnWidgetAdd
     \brief Defines widget positioning on widget add.
--- a/homescreenapp/hsutils/src/xqaiwgetimageclient.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hsutils/src/xqaiwgetimageclient.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -33,6 +33,12 @@
 #endif //COVERAGE_MEASUREMENT
 
 
+/*!
+    \class XQAIWGetImageClient
+    \ingroup group_hsutils
+    \brief 
+*/
+
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
@@ -56,11 +62,8 @@
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
-void XQAIWGetImageClient::fetch( QVariantMap filter, XQAIWMultimediaFlags flag)
+void XQAIWGetImageClient::fetch()
 {
-    Q_UNUSED(filter)
-    Q_UNUSED(flag)
-
     QStringList imageDirNames;
     QStringList imageDirs;
 
@@ -124,14 +127,11 @@
 {
     Q_UNUSED(val)
     mImageGrid->disconnect(this);
-    QStringList list;
-
-    list << val;
 
     HbMainWindow *window = HbInstance::instance()->allMainWindows().first();
     window->removeView(mImageGrid);
     
-    emit fetchComplete(list);
+    emit fetchCompleted(val);
     QStringList images;
     mImageGrid->setContent(images);
 }
@@ -151,7 +151,8 @@
     HbMainWindow *window = HbInstance::instance()->allMainWindows().first();
     window->removeView(mImageGrid);
     
-    emit fetchFailed(-1);//KErrNotFound
+    emit fetchFailed(-1, QString("")); //KErrNotFound
+
     QStringList images;
     mImageGrid->setContent(images);
 }
--- a/homescreenapp/hswidgetuninstaller/hswidgetuninstaller.pro	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hswidgetuninstaller/hswidgetuninstaller.pro	Wed Jun 23 18:03:36 2010 +0300
@@ -45,4 +45,5 @@
     RSS_RULES += hidden launch datatypelist 
     LIBS += -lxqservice
     LIBS += -lxqserviceutil
+    LIBS += -lapparc
 }
--- a/homescreenapp/hswidgetuninstaller/src/hswidgetinstallersender.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/hswidgetuninstaller/src/hswidgetinstallersender.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -20,10 +20,16 @@
 
 #include <QDebug>
 #include <QFile>
+#include <QVariantHash>
+#ifdef HOMESCREEN_TEST
+#include "xqrequestinfo_mock.h"
+#include "xqservicerequest_mock.h"
+#else
 #include <xqrequestinfo.h>
 #include <xqservicerequest.h>
+#endif
 
-const char INTERFACE_NAME[] = "com.nokia.services.hsapplication.IHomeScreenClient";
+const char INTERFACE_NAME[] = "com.nokia.symbian.IHomeScreenClient";
 
 /*!
     \class HsWidgetInstallerSender
--- a/homescreenapp/inc/hsapp_defs.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/inc/hsapp_defs.h	Wed Jun 23 18:03:36 2010 +0300
@@ -46,6 +46,7 @@
 inline const QString appSettingsPlugin();
 inline const QString groupNameAttributeName();
 inline const QString componentIdAttributeName();
+inline const QString entryShortName();
 
 // Sort attribute
 enum HsSortAttribute {
--- a/homescreenapp/inc/hsapp_defs.inl	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/inc/hsapp_defs.inl	Wed Jun 23 18:03:36 2010 +0300
@@ -289,4 +289,15 @@
     return key;
 }
 
+/*!
+    \return entry short name
+*/
+inline const QString entryShortName()
+{
+    static const QString key("short_name");
+    return key;
+}
+
+
+
 #endif
--- a/homescreenapp/rom/homescreenapp_core.iby	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/rom/homescreenapp_core.iby	Wed Jun 23 18:03:36 2010 +0300
@@ -20,12 +20,20 @@
 
 // ---- hsapplication --------------------------------------------
 
-file=ABI_DIR\BUILD_DIR\hsapplication.exe                  PROGRAMS_DIR\hsapplication.exe
-data=ZPRIVATE\10003a3f\import\apps\hsapplication_reg.rsc  private\10003a3f\import\apps\hsapplication_reg.rsc
-data=\epoc32\data\z\resource\apps\hsapplication.mif       resource\apps\hsapplication.mif
-data=ZPRIVATE\20022f35\homescreen.db                      private\20022f35\homescreen.db
-data=ZPRIVATE\20022f35\wallpapers\d_portrait.png          private\20022f35\wallpapers\d_portrait.png
-data=ZPRIVATE\20022f35\wallpapers\d_landscape.png         private\20022f35\wallpapers\d_landscape.png
+file=ABI_DIR\BUILD_DIR\hsapplication.exe                        PROGRAMS_DIR\hsapplication.exe
+data=ZPRIVATE\10003a3f\import\apps\hsapplication_reg.rsc        private\10003a3f\import\apps\hsapplication_reg.rsc
+data=\epoc32\data\z\resource\apps\hsapplication.mif             resource\apps\hsapplication.mif
+data=ZPRIVATE\20022f35\homescreen.db                            private\20022f35\homescreen.db
+data=ZPRIVATE\20022f35\wallpapers\scene\default_portrait.png    private\20022f35\wallpapers\scene\default_portrait.png
+data=ZPRIVATE\20022f35\wallpapers\scene\default_landscape.png   private\20022f35\wallpapers\scene\default_landscape.png
+data=ZPRIVATE\20022f35\wallpapers\page\default_portrait.png     private\20022f35\wallpapers\page\default_portrait.png
+data=ZPRIVATE\20022f35\wallpapers\page\default_landscape.png    private\20022f35\wallpapers\page\default_landscape.png
+data=ZPRIVATE\20022f35\wallpapers\page\1_portrait.png           private\20022f35\wallpapers\page\1_portrait.png
+data=ZPRIVATE\20022f35\wallpapers\page\1_landscape.png          private\20022f35\wallpapers\page\1_landscape.png
+data=ZPRIVATE\20022f35\wallpapers\page\2_portrait.png           private\20022f35\wallpapers\page\2_portrait.png
+data=ZPRIVATE\20022f35\wallpapers\page\2_landscape.png          private\20022f35\wallpapers\page\2_landscape.png
+data=ZPRIVATE\20022f35\wallpapers\page\3_portrait.png           private\20022f35\wallpapers\page\3_portrait.png
+data=ZPRIVATE\20022f35\wallpapers\page\3_landscape.png          private\20022f35\wallpapers\page\3_landscape.png
 
 // ---- hswidgetuninstaller --------------------------------------------
 file=ABI_DIR\BUILD_DIR\hswidgetuninstaller.exe            PROGRAMS_DIR\hswidgetuninstaller.exe
--- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/inc/hsdefaultruntime.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/inc/hsdefaultruntime.h	Wed Jun 23 18:03:36 2010 +0300
@@ -59,6 +59,7 @@
 private:
     Q_DISABLE_COPY(HsDefaultRuntime)
 
+    void registerAnimations();
     void createStatePublisher();
     void createContentServiceParts();
     void createStates();
--- a/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/src/hsdefaultruntime.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/runtimeplugins/hsdefaultruntimeplugin/src/hsdefaultruntime.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -42,8 +42,8 @@
 #include "hsmenueventtransition.h"
 #include "hswidgetpositioningonorientationchange.h"
 #include "hswidgetpositioningonwidgetadd.h"
+#include "hsconfiguration.h"
 #include "hstest_global.h"
-#include "hsconfiguration.h"
 
 QTM_USE_NAMESPACE
 #define hbApp qobject_cast<HbApplication*>(qApp)
@@ -101,20 +101,26 @@
     db->open();
     HsDatabase::setInstance(db);
 
-    HsConfiguration::loadConfiguration();
-
+    HsConfiguration::setInstance(new HsConfiguration);
+    HsConfiguration::instance()->load();
+            
     HsWidgetPositioningOnOrientationChange::setInstance(
         new HsAdvancedWidgetPositioningOnOrientationChange);
 
     HsWidgetPositioningOnWidgetAdd::setInstance(
         new HsAnchorPointInBottomRight);
 
+    registerAnimations();
+
     createStatePublisher();
     createContentServiceParts();
     createStates();
     assignServices();
     
-	QCoreApplication::instance()->installEventFilter(this);
+    // create the instance so that singleton is accessible from elsewhere
+    HsShortcutService::instance(this);
+	
+    QCoreApplication::instance()->installEventFilter(this);
 
     if (hbApp) { // Qt test framework uses QApplication.
 	    connect(hbApp->activityManager(), SIGNAL(activityRequested(QString)), 
@@ -175,6 +181,16 @@
 	return result;
 }
 
+
+/*!
+    Registers framework animations.
+*/
+void HsDefaultRuntime::registerAnimations()
+{
+    HbIconAnimationManager *manager = HbIconAnimationManager::global();
+    manager->addDefinitionFile(QLatin1String("qtg_anim_loading.axml"));
+}
+
 /*!
     Creates Home screen state publisher.
 */
--- a/homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/hsmenuserviceprovider.pro	Wed Jun 23 18:03:36 2010 +0300
@@ -21,8 +21,9 @@
 HEADERS += ./inc/*.h
 SOURCES += ./src/*.cpp
 
+DEFINES += MENUSERVICE_LIB
 
-DEFINES += MENUSERVICE_LIB
 LIBS += -lcaclient
+
 symbian::TARGET.UID3 = 0x20026FA9
 win32:exportResources(./resource/*.png, resource)
--- a/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/serviceproviders/hsmenuserviceprovider/src/hsmenuservice.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -92,7 +92,7 @@
 HsMenuItemModel *HsMenuService::getInstalledModel(
     HsSortAttribute sortAttribute)
 {
-    //TODO get proper items 
+    //TODO get proper items
     qDebug() << "HsMenuService::getInstalledModel" << "sortAttribute:"
              << sortAttribute;
     HSMENUTEST_FUNC_ENTRY("HsMenuService::getInstalledModel");
@@ -191,8 +191,30 @@
 {
     qDebug() << "HsMenuService::executeAction entryId:" << entryId
              << "actionName:" << actionName;
+    bool ret = CaService::instance()->executeCommand(entryId, actionName);
 
-    return CaService::instance()->executeCommand(entryId, actionName);
+    // if its remove action we need to mark all items 
+    // that are being uninstalled
+    if (actionName ==  caCmdRemove && ret) {
+        QSharedPointer<CaEntry> entry(
+                CaService::instance()->getEntry(entryId));
+        if (!entry.isNull()) {
+            QString componentId = entry->attribute(
+                    componentIdAttributeName());
+            
+            CaQuery query;
+            query.setAttribute(componentIdAttributeName(), componentId);
+            QList< QSharedPointer<CaEntry> > entries 
+                    = CaService::instance()->getEntries(query);
+            
+            for (int i = 0; i < entries.count(); i++) {
+                entries[i]->setFlags(
+                        entries.first()->flags()| UninstallEntryFlag);
+                CaService::instance()->updateEntry(*entries[i]);
+            }
+        }
+    }
+    return ret;
 }
 
 /*!
@@ -397,8 +419,8 @@
     QScopedPointer<CaEntry> tsEntry(new CaEntry);
     tsEntry->setEntryTypeName(applicationTypeName());
     tsEntry->setAttribute(
-            applicationUidEntryKey(), QString::number(softwareUpdateApplicationUid)); 
-    int retval = CaService::instance()->executeCommand(*tsEntry, 
+            applicationUidEntryKey(), QString::number(softwareUpdateApplicationUid));
+    int retval = CaService::instance()->executeCommand(*tsEntry,
             openActionIdentifier());
     return retval;
 }
--- a/homescreenapp/sis/homescreenapp_ut_hs.pkg	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/sis/homescreenapp_ut_hs.pkg	Wed Jun 23 18:03:36 2010 +0300
@@ -51,8 +51,10 @@
 
 
 "../hsdomainmodel/tsrc/t_hsdomainmodel/hsdomainmodeltest.db"    - "c:/private/20022F59/hsdomainmodeltest.db"
-"../hsdomainmodel/tsrc/t_hsdomainmodel/d_landscape.png"         - "c:/private/20022F59/d_landscape.png"
-"../hsdomainmodel/tsrc/t_hsdomainmodel/d_portrait.png"           - "c:/private/20022F59/d_portrait.png"
+"../hsdomainmodel/tsrc/t_hsdomainmodel/resource/default_portrait.png"       - "c:/private/20022F59/wallpapers/scene/default_landscape.png"
+"../hsdomainmodel/tsrc/t_hsdomainmodel/resource/default_landscape.png"  - "c:/private/20022F59/wallpapers/scene/default_portrait.png"
+"../hsdomainmodel/tsrc/t_hsdomainmodel/resource/default_portrait.png"       - "c:/private/20022F59/wallpapers/page/default_landscape.png"
+"../hsdomainmodel/tsrc/t_hsdomainmodel/resource/default_landscape.png"  - "c:/private/20022F59/wallpapers/page/default_portrait.png"
 
 "/epoc32/release/armv5/urel/mockwidgetplugin.dll"                                               - "c:/sys/bin/mockwidgetplugin.dll"
 "/epoc32/data/z/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.qtplugin"   - "c:/private/20022F59/hsresources/plugins/widgetplugins/mockwidgetplugin.qtplugin"
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/hsapplibrarystateplugin.qrc	Wed Jun 23 18:03:36 2010 +0300
@@ -5,4 +5,8 @@
     <qresource prefix="/css">
         <file alias="hsapplibrarystateplugin.css">resource/hsapplibrarystateplugin.css</file>
     </qresource>
+    <qresource prefix="/layout">
+        <file alias="hslistviewitem.css">resource/hslistviewitem.css</file>
+        <file alias="hslistviewitem.widgetml">resource/hslistviewitem.widgetml</file>
+    </qresource>
 </RCC>
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hscollectionstate.h	Wed Jun 23 18:03:36 2010 +0300
@@ -58,7 +58,7 @@
     bool openTaskSwitcher();
     void listItemActivated(const QModelIndex &index);
     void listItemLongPressed(HbAbstractViewItem *item, const QPointF &coords);
-    void addAppsAction();
+    void addAppsAction(bool addApps = true);
     void addCollectionShortcutToHomeScreenAction();
     void renameAction();
     void deleteAction();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/inc/hslistviewitem.h	Wed Jun 23 18:03:36 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: List View Item.
+ *
+ */
+
+#ifndef CUSTOMLISTVIEWITEM_H
+#define CUSTOMLISTVIEWITEM_H
+
+#include <hblistviewitem.h>
+
+#include "hsmenustates_global.h"
+
+class HbProgressBar;
+
+HS_STATES_TEST_CLASS(MenuStatesTest)
+
+class HsListViewItem : public HbListViewItem
+{
+    Q_OBJECT
+    public:
+                
+        explicit HsListViewItem(QGraphicsItem* parent=0);
+        virtual ~HsListViewItem();
+        
+        virtual HbAbstractViewItem* createItem();
+        virtual void updateChildItems();
+    
+	    virtual void polish(HbStyleParameters& params);
+
+    private:
+
+        HbProgressBar *progress;
+        bool isProgress;
+    HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
+};
+
+#endif // CUSTOMLISTVIEWITEM_H
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/applibrary.docml	Wed Jun 23 18:03:36 2010 +0300
@@ -38,9 +38,6 @@
         <widget name="allAppsView" type="HbView">
             <widget name="allAppsContainer" role="HbView:widget" type="HbWidget">
                 <widget name="allAppsListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="LargeIcon"/>
-                    </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
@@ -75,9 +72,6 @@
                     <bool name="visible" value="FALSE"/>
                 </widget>
                 <widget name="allAppsSearchListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="LargeIcon"/>
-                    </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
@@ -98,9 +92,6 @@
         <widget name="allCollectionsView" type="HbView">
             <widget name="allCollectionsContainer" role="HbView:widget" type="HbWidget">
                 <widget name="allCollectionsListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="LargeIcon"/>
-                    </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
@@ -136,9 +127,6 @@
                     <bool name="visible" value="FALSE"/>
                 </widget>
                 <widget name="allCollectionsSearchListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="LargeIcon"/>
-                    </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
@@ -166,9 +154,6 @@
                     <integer name="groupBoxType" value="1"/>
                 </widget>
                 <widget name="installedAppsListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="LargeIcon"/>
-                    </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
@@ -217,9 +202,6 @@
                     <bool name="visible" value="FALSE"/>
                 </widget>
                 <widget name="installedAppsSearchListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="LargeIcon"/>
-                    </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
@@ -303,9 +285,6 @@
                     <integer name="groupBoxType" value="1"/>
                 </widget>
                 <widget name="collectionListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="LargeIcon"/>
-                    </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
@@ -357,9 +336,6 @@
                     <bool name="visible" value="FALSE"/>
                 </widget>
                 <widget name="collectionSearchListView" type="HbListView">
-                    <widget name="listViewItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem">
-                        <enums name="graphicsSize" value="LargeIcon"/>
-                    </widget>
                     <bool name="itemRecycling" value="TRUE"/>
                     <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
                     <sizehint height="100un" type="MAXIMUM" width="100un"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.css	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,37 @@
+/*
+HsListViewItem[layoutName="default"][!text-2][!progress] { 
+	layout:applib_text1;
+}
+
+HsListViewItem[layoutName="default"][text-2][!progress]{
+	layout:applib_text2;
+}*/
+
+HsListViewItem[layoutName="default"][progress] {
+	layout:applib_progress;
+}
+
+/*
+HsListViewItem::text-1{
+
+	font-variant: primary;
+	pref-width:-1;
+	text-align: left;
+}
+
+HsListViewItem::text-2 {
+
+	font-variant: secondary;
+	pref-width:-1;
+	text-align: left top;	 
+}
+*/
+HsListViewItem::progress {
+
+}
+/*
+HsListViewItem::icon-1{
+	fixed-height: 63px;
+	fixed-width: 63px; 
+}*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/resource/hslistviewitem.widgetml	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,104 @@
+<hbwidget version="0.1" type="listviewitem">
+    <layout name="applib_text1" type="mesh">
+
+      <meshitem src="icon-1" srcEdge="LEFT" dst="" dstEdge="LEFT"  spacing="-6px"/>
+      <meshitem src="icon-1" srcEdge="TOP" dst="" dstEdge="TOP"  spacing="-5px" />
+      <meshitem src="icon-1" srcEdge="RIGHT" dst="text-1" dstEdge="LEFT" spacing="15px"/>
+      <meshitem src="icon-1" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"  spacing="6px" />
+
+      <meshitem src="text-1" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
+      <meshitem src="text-1" srcEdge="CENTERV" dst="icon-1" dstEdge="CENTERV" />      
+         
+      <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+      <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
+      <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+      <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+  
+      <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+      <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP" />
+      <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+      <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+  </layout>
+
+  <layout name="applib_text2" type="mesh">
+    
+    <meshitem src="icon-1" srcEdge="LEFT" dst="" dstEdge="LEFT"  spacing="-6px" />
+    <meshitem src="icon-1" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-5px"/>
+    <meshitem src="icon-1" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"  spacing="6px" />
+    <meshitem src="icon-1" srcEdge="RIGHT" dst="text-1" dstEdge="LEFT" spacing="15px"/>
+
+    <meshitem src="text-1" srcEdge="BOTTOM" dst="icon-1" dstEdge="CENTERV" />    
+    <meshitem src="text-1" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
+    
+    <meshitem src="text-2" srcEdge="LEFT" dst="text-1" dstEdge="LEFT" />
+    <meshitem src="text-2" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
+    <meshitem src="text-2" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="8px" />
+
+    <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+
+    <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+  </layout>
+
+
+  <!--layout name="applib_progress" type="mesh">
+
+    <meshitem src="icon-1" srcEdge="LEFT" dst="" dstEdge="LEFT"  spacing="-6px" />
+    <meshitem src="icon-1" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-5px"/>
+    <meshitem src="icon-1" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"  spacing="6px" />
+    <meshitem src="icon-1" srcEdge="RIGHT" dst="text-1" dstEdge="LEFT" spacing="15px"/>
+
+    <meshitem src="text-1" srcEdge="BOTTOM" dst="icon-1" dstEdge="CENTERV" />
+    <meshitem src="text-1" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
+
+    <meshitem src="progress" srcEdge="LEFT" dst="text-1" dstEdge="LEFT" />
+    <meshitem src="progress" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="15px" />
+    <meshitem src="progress" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="8px" />    
+
+    <meshitem src="background" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="background" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="background" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="background" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+
+    <meshitem src="frame" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="frame" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="frame" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="frame" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+  </layout-->
+
+  <layout name="applib_progress" type="mesh">
+
+    <meshitem src="icon-1" srcEdge="LEFT" dst="" dstEdge="LEFT"  spacing="-var(hb-param-margin-gene-left)" />
+    <meshitem src="icon-1" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
+    <meshitem src="icon-1" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM"  spacing="var(hb-param-margin-gene-bottom)" />
+    <meshitem src="icon-1" srcEdge="RIGHT" dst="text-1" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)"/>
+
+    <meshitem src="selection-icon" srcEdge="LEFT" dst="icon-1" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-middle-horizontal)"/>
+    <meshitem src="selection-icon" srcEdge="TOP" dst="icon-1" dstEdge="TOP" spacing="-var(hb-param-margin-gene-middle-vertical)"/>
+    <meshitem src="selection-icon" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacer="spacer1" />
+    <meshitem src="selection-icon" srcEdge="TOP" dst="" dstEdge="TOP" spacer="spacer2" />
+
+    <meshitem src="text-1" srcEdge="BOTTOM" dst="icon-1" dstEdge="CENTERV" spacing="expr((1/2)*var(hb-param-margin-gene-middle-vertical))"/>
+    <meshitem src="text-1" srcEdge="RIGHT" dst="icon-2" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)"/>
+
+    <meshitem src="progress" srcEdge="LEFT" dst="text-1" dstEdge="LEFT" />
+    <meshitem src="progress" srcEdge="TOP" dst="icon-1" dstEdge="CENTERV" spacing="-expr((1/2)*var(hb-param-margin-gene-middle-vertical))"/>
+    <meshitem src="progress" srcEdge="RIGHT" dst="text-3" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" />
+
+    <meshitem src="icon-2" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
+    <meshitem src="icon-2" srcEdge="CENTERV" dst="text-1" dstEdge="CENTERV" />
+
+    <meshitem src="text-3" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
+    <meshitem src="text-3" srcEdge="BOTTOM" dst="text-2" dstEdge="BOTTOM" spacing="0.0un" />
+
+    <meshitem src="multiselection-toucharea" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="multiselection-toucharea" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="multiselection-toucharea" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+  </layout>
+
+</hbwidget>
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsallappsstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -293,21 +293,25 @@
     HSMENUTEST_FUNC_ENTRY("HsAllAppsState::listItemActivated");
 
     QSharedPointer<const CaEntry> entry = mAllAppsModel->entry(index);
-
+    
     if (entry->entryTypeName() == widgetTypeName()) {
-        machine()->postEvent(
-            HsMenuEventFactory::createPreviewHSWidgetEvent(
-                entry->id(), entry->entryTypeName(), entry->attribute(
-                    widgetUriAttributeName()), entry->attribute(
-                    widgetLibraryAttributeName())));
+        EntryFlags flags = index.data(CaItemModel::FlagsRole).value<
+                               EntryFlags> ();
+        if (!(flags & UninstallEntryFlag)) {
+            machine()->postEvent(
+                HsMenuEventFactory::createPreviewHSWidgetEvent(
+                    entry->id(), entry->entryTypeName(), entry->attribute(
+                        widgetUriAttributeName()), entry->attribute(
+                        widgetLibraryAttributeName())));
 
-        const int itemId = index.data(CaItemModel::IdRole).toInt();
-        HsMenuService::touch(itemId);
+            const int itemId = index.data(CaItemModel::IdRole).toInt();
+            HsMenuService::touch(itemId);
+        }
     } else {
         QVariant data = mAllAppsModel->data(index, CaItemModel::IdRole);
         HsMenuService::executeAction(data.toInt());
     }
-
+    
     mMenuView.setSearchPanelVisible(false);
 
     HSMENUTEST_FUNC_EXIT("HsAllAppsState::listItemActivated");
@@ -334,50 +338,51 @@
 {
     HSMENUTEST_FUNC_ENTRY("HsAllAppsState::listItemLongPressed");
 
-
-    // create context menu
-    mContextMenu = new HbMenu;
-
-    HbAction *addToHomeScreenAction = mContextMenu->addAction(hbTrId(
-                                          "txt_applib_menu_add_to_home_screen"));
-    addToHomeScreenAction->setData(AddToHomeScreenContextAction);
-
-    HbAction *addToCollectionAction = mContextMenu->addAction(hbTrId(
-                                          "txt_applib_menu_add_to_collection"));
-    addToCollectionAction->setData(AddToCollectionContextAction);
-
-    HbAction *uninstallAction = mContextMenu->addAction(hbTrId(
-                                    "txt_common_menu_delete"));
-    uninstallAction->setData(UninstallContextAction);
-    HbAction *appSettingsAction(NULL);
-    HbAction *appDetailsAction(NULL);
-
-    // check conditions and hide irrelevant menu items
-
-    QSharedPointer<const CaEntry> entry = mAllAppsModel->entry(item->modelIndex());
     EntryFlags flags = item->modelIndex().data(
                            CaItemModel::FlagsRole).value<EntryFlags> ();
 
-    if (!(entry->attribute(appSettingsPlugin()).isEmpty())) {
-        appSettingsAction = mContextMenu->addAction(hbTrId(
-                                                "txt_common_menu_settings"));
-        appSettingsAction->setData(AppSettingContextAction);
+    if (!(flags & UninstallEntryFlag)) {
+        // create context menu
+        mContextMenu = new HbMenu;
+
+        HbAction *addToHomeScreenAction = mContextMenu->addAction(
+            hbTrId("txt_applib_menu_add_to_home_screen"));
+        addToHomeScreenAction->setData(AddToHomeScreenContextAction);
+
+        HbAction *addToCollectionAction = mContextMenu->addAction(
+            hbTrId("txt_applib_menu_add_to_collection"));
+        addToCollectionAction->setData(AddToCollectionContextAction);
+
+        HbAction *uninstallAction = mContextMenu->addAction(
+            hbTrId("txt_common_menu_delete"));
+        uninstallAction->setData(UninstallContextAction);
+        HbAction *appSettingsAction(NULL);
+        HbAction *appDetailsAction(NULL);
+
+        // check conditions and hide irrelevant menu items
+        QSharedPointer<const CaEntry> entry = mAllAppsModel->entry(item->modelIndex());
+
+        if (!(entry->attribute(appSettingsPlugin()).isEmpty())) {
+            appSettingsAction = mContextMenu->addAction(
+                hbTrId("txt_common_menu_settings"));
+            appSettingsAction->setData(AppSettingContextAction);
+        }
+        if (!(entry->attribute(componentIdAttributeName()).isEmpty()) &&
+                (flags & RemovableEntryFlag) ) {
+            appDetailsAction = mContextMenu->addAction(
+                hbTrId("txt_common_menu_details"));
+            appDetailsAction->setData(AppDetailsContextAction);
+        }
+
+        if (!(flags & RemovableEntryFlag)) {
+            uninstallAction->setVisible(false);
+        }
+
+        mContextModelIndex = item->modelIndex();
+        mContextMenu->setPreferredPos(coords);
+        mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
+        mContextMenu->open(this, SLOT(contextMenuAction(HbAction*)));
     }
-    if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && 
-            (flags & RemovableEntryFlag) ) {
-        appDetailsAction = mContextMenu->addAction(hbTrId(
-                                                "txt_common_menu_details"));
-        appDetailsAction->setData(AppDetailsContextAction);
-    }        
-
-    if (!(flags & RemovableEntryFlag)) {
-        uninstallAction->setVisible(false);
-    }
-
-    mContextModelIndex = item->modelIndex();
-    mContextMenu->setPreferredPos(coords);
-    mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
-    mContextMenu->open(this, SLOT(contextMenuAction(HbAction*)));
 
 
     HSMENUTEST_FUNC_EXIT("HsAllAppsState::listItemLongPressed");
@@ -406,8 +411,7 @@
             break;
         case UninstallContextAction:
             machine()->postEvent(
-                HsMenuEventFactory::createUninstallApplicationEvent(
-                    itemId));
+                HsMenuEventFactory::createUninstallApplicationEvent(itemId));
             break;
         case AppSettingContextAction: 
             machine()->postEvent(
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hscollectionstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -148,7 +148,8 @@
 
     connect(this, SIGNAL(entered()),SLOT(stateEntered()));
     connect(this, SIGNAL(exited()),SLOT(stateExited()));
-
+    
+    mMenuView.collectionButton()->setCheckable(true);   
     makeConnect();
     mMenuView.view()->setNavigationAction(mSecondarySoftkeyAction);
 
@@ -163,8 +164,7 @@
     makeDisconnect();
     mMenuView.inactivate();
     mMenuView.setModel(NULL);
-    mMenuView.view()->
-    setNavigationAction(NULL);
+    mMenuView.view()->setNavigationAction(NULL);
     delete mCollectionModel;
 }
 
@@ -332,8 +332,7 @@
             SIGNAL(longPressed(HbAbstractViewItem *, QPointF)),
             SLOT(listItemLongPressed(HbAbstractViewItem *, QPointF)));
     connect(mMenuView.collectionButton(),
-            SIGNAL(released()), this, SLOT(addAppsAction()));
-
+            SIGNAL(toggled(bool)), this, SLOT(addAppsAction(bool)));
 }
 
 /*!
@@ -342,7 +341,7 @@
 void HsCollectionState::makeDisconnect()
 {
     disconnect(mMenuView.collectionButton(),
-            SIGNAL(pressed()), this, SLOT(addAppsAction()));
+            SIGNAL(toggled(bool)), this, SLOT(addAppsAction(bool)));
 
     disconnect(mSecondarySoftkeyAction, SIGNAL(triggered()),
                this, SLOT(backSteppingAction()));
@@ -376,14 +375,18 @@
     QSharedPointer<const CaEntry> entry = mCollectionModel->entry(index);
 
     if (entry->entryTypeName() == widgetTypeName()) {
-        machine()->postEvent(
-            HsMenuEventFactory::createPreviewHSWidgetEvent(
-                entry->id(), entry->entryTypeName(), entry->attribute(
-                    widgetUriAttributeName()), entry->attribute(
-                    widgetLibraryAttributeName())));
+        EntryFlags flags = index.data(CaItemModel::FlagsRole).value<
+                               EntryFlags> ();
+        if (!(flags & UninstallEntryFlag)) {
+            machine()->postEvent(
+                HsMenuEventFactory::createPreviewHSWidgetEvent(
+                    entry->id(), entry->entryTypeName(), entry->attribute(
+                        widgetUriAttributeName()), entry->attribute(
+                        widgetLibraryAttributeName())));
 
-        const int itemId = index.data(CaItemModel::IdRole).toInt();
-        HsMenuService::touch(itemId);
+            const int itemId = index.data(CaItemModel::IdRole).toInt();
+            HsMenuService::touch(itemId);
+        }
     } else {
         QVariant data = mCollectionModel->data(index, CaItemModel::IdRole);
         HsMenuService::executeAction(data.toInt());
@@ -402,59 +405,60 @@
 void HsCollectionState::listItemLongPressed(HbAbstractViewItem *item,
         const QPointF &coords)
 {
-    Q_UNUSED(item);
     HSMENUTEST_FUNC_ENTRY("HsCollectionState::listItemLongPressed");
-    // create context menu
-    mContextMenu = new HbMenu();
-
-    HbAction *addShortcutAction = mContextMenu->addAction(hbTrId(
-                                      "txt_applib_menu_add_to_home_screen"));
-    addShortcutAction->setData(AddToHomeScreenContextAction);
-    HbAction *addToCollection = mContextMenu->addAction(hbTrId(
-                                    "txt_applib_menu_add_to_collection"));
-    addToCollection->setData(AddToCollectionContextAction);
-    HbAction *removeAction(NULL);
-    HbAction *uninstallAction(NULL);
-    HbAction *appSettingsAction(NULL);
-    HbAction *appDetailsAction(NULL);
-    // we do not add remove option in locked collection
-    // check conditions and hide irrelevant menu items
-    EntryFlags rootFlags =
-        mCollectionModel->root().data(CaItemModel::FlagsRole).value<
-        EntryFlags> ();
-
-    if (rootFlags & RemovableEntryFlag) {
-        removeAction = mContextMenu->addAction(
-                           hbTrId("txt_applib_menu_remove_from_collection"));
-        removeAction->setData(RemoveFromCollectionContextAction);
-    }
 
     EntryFlags flags = item->modelIndex().data(CaItemModel::FlagsRole).value<
                        EntryFlags> ();
 
-    if ((flags & RemovableEntryFlag)) {
-        uninstallAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete"));
-        uninstallAction->setData(UninstallContextAction);
-    }
-    QSharedPointer<const CaEntry> entry = mCollectionModel->entry(item->modelIndex());
+    if (!(flags & UninstallEntryFlag)) {
+        // create context menu
+        mContextMenu = new HbMenu();
 
-    if (!(entry->attribute(appSettingsPlugin()).isEmpty())) {
-        appSettingsAction = mContextMenu->addAction(hbTrId(
-                                                "txt_common_menu_settings"));
-        appSettingsAction->setData(AppSettingContextAction);
-    }
+        HbAction *addShortcutAction = mContextMenu->addAction(hbTrId(
+                                          "txt_applib_menu_add_to_home_screen"));
+        addShortcutAction->setData(AddToHomeScreenContextAction);
+        HbAction *addToCollection = mContextMenu->addAction(hbTrId(
+                                        "txt_applib_menu_add_to_collection"));
+        addToCollection->setData(AddToCollectionContextAction);
+        HbAction *removeAction(NULL);
+        HbAction *uninstallAction(NULL);
+        HbAction *appSettingsAction(NULL);
+        HbAction *appDetailsAction(NULL);
+        // we do not add remove option in locked collection
+        // check conditions and hide irrelevant menu items
+        EntryFlags rootFlags =
+            mCollectionModel->root().data(CaItemModel::FlagsRole).value<
+            EntryFlags> ();
+
+        if (rootFlags & RemovableEntryFlag) {
+            removeAction = mContextMenu->addAction(
+                               hbTrId("txt_applib_menu_remove_from_collection"));
+            removeAction->setData(RemoveFromCollectionContextAction);
+        }
+
+        if ((flags & RemovableEntryFlag)) {
+            uninstallAction = mContextMenu->addAction(hbTrId("txt_common_menu_delete"));
+            uninstallAction->setData(UninstallContextAction);
+        }
+        QSharedPointer<const CaEntry> entry = mCollectionModel->entry(item->modelIndex());
+
+        if (!(entry->attribute(appSettingsPlugin()).isEmpty())) {
+            appSettingsAction = mContextMenu->addAction(hbTrId(
+                                                    "txt_common_menu_settings"));
+            appSettingsAction->setData(AppSettingContextAction);
+        }
     
-    if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && 
-            (flags & RemovableEntryFlag) ) {
-        appDetailsAction = mContextMenu->addAction(hbTrId(
-                                                "txt_common_menu_details"));
-        appDetailsAction->setData(AppDetailsContextAction);
-    }        
-    mContextModelIndex = item->modelIndex();
-    mContextMenu->setPreferredPos(coords);
-    mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
-    mContextMenu->open(this, SLOT(contextMenuAction(HbAction*)));
-
+        if (!(entry->attribute(componentIdAttributeName()).isEmpty()) &&
+                (flags & RemovableEntryFlag) ) {
+            appDetailsAction = mContextMenu->addAction(hbTrId(
+                                                    "txt_common_menu_details"));
+            appDetailsAction->setData(AppDetailsContextAction);
+        }
+        mContextModelIndex = item->modelIndex();
+        mContextMenu->setPreferredPos(coords);
+        mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
+        mContextMenu->open(this, SLOT(contextMenuAction(HbAction*)));
+    }
 
     HSMENUTEST_FUNC_EXIT("HsCollectionState::listItemLongPressed");
 }
@@ -505,6 +509,7 @@
 
 /*!
  Handles button visibility
+  \param empty if true set empty text label or button to add entries to collection
  */
 void HsCollectionState::handleEmptyChange(bool empty)
 {
@@ -526,6 +531,7 @@
 
 /*!
  Handles lock serch button
+  \param lock if true lock search button
  */
 void HsCollectionState::lockSearchButton(bool lock)
 {
@@ -535,13 +541,17 @@
 
 /*!
  Menu add applications action slot
+   \param addApps if true create event for add enties to collection. Parametr use by toggled from HbPushButton
  */
-void HsCollectionState::addAppsAction()
+void HsCollectionState::addAppsAction(bool addApps)
 {
     // Add applications
-    machine()->postEvent(
-        HsMenuEventFactory::createAddAppsFromCallectionViewEvent(
-            mCollectionId));
+    if (addApps) {
+        mMenuView.collectionButton()->setChecked(false);
+        machine()->postEvent(
+            HsMenuEventFactory::createAddAppsFromCallectionViewEvent(
+                mCollectionId));
+    }    
 }
 
 /*!
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsinstalledappsstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -250,29 +250,31 @@
 {
     HSMENUTEST_FUNC_ENTRY("HsInstalledAppsState::listItemLongPressed");
 
-    // create context menu
-    mContextMenu = new HbMenu();
-
-    HbAction *uninstallAction = mContextMenu->addAction(
-                                    hbTrId("txt_common_menu_delete"));
-    HbAction *appDetailsAction(NULL);
-    uninstallAction->setData(UninstallContextAction);
-    
-    QSharedPointer<const CaEntry> entry = mInstalledAppsModel->entry(item->modelIndex());
     EntryFlags flags = item->modelIndex().data(
                            CaItemModel::FlagsRole).value<EntryFlags> ();
+    if (!(flags & UninstallEntryFlag)) {
+        // create context menu
+        mContextMenu = new HbMenu();
+
+        HbAction *uninstallAction = mContextMenu->addAction(
+                                    hbTrId("txt_common_menu_delete"));
+        HbAction *appDetailsAction(NULL);
+        uninstallAction->setData(UninstallContextAction);
     
-    if (!(entry->attribute(componentIdAttributeName()).isEmpty()) && 
-            (flags & RemovableEntryFlag) ) {
-        appDetailsAction = mContextMenu->addAction(hbTrId(
-                                                "txt_common_menu_details"));
-        appDetailsAction->setData(AppDetailsContextAction);
-    }      
+        QSharedPointer<const CaEntry> entry = mInstalledAppsModel->entry(item->modelIndex());
+    
+        if (!(entry->attribute(componentIdAttributeName()).isEmpty()) &&
+                (flags & RemovableEntryFlag) ) {
+            appDetailsAction = mContextMenu->addAction(hbTrId(
+                                                    "txt_common_menu_details"));
+            appDetailsAction->setData(AppDetailsContextAction);
+        }
 
-    mContextModelIndex = item->modelIndex();
-    mContextMenu->setPreferredPos(coords);
-    mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
-    mContextMenu->open(this, SLOT(contextMenuAction(HbAction*)));
+        mContextModelIndex = item->modelIndex();
+        mContextMenu->setPreferredPos(coords);
+        mContextMenu->setAttribute(Qt::WA_DeleteOnClose);
+        mContextMenu->open(this, SLOT(contextMenuAction(HbAction*)));
+    }
     
     
     HSMENUTEST_FUNC_EXIT("HsInstalledAppsState::listItemLongPressed");
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hslistviewitem.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description: List View Item.
+ *
+ */
+
+#include <hbnamespace.h>
+#include <HbProgressBar>
+
+#include <HbStyleLoader>
+#include <caitemmodel.h>
+#include "hsmenuitemmodel.h"
+
+#include "hslistviewitem.h"
+
+HsListViewItem::HsListViewItem(QGraphicsItem* parent) : 
+    HbListViewItem(parent), progress(0), isProgress(false)
+{   
+    setGraphicsSize(LargeIcon);
+    HbStyleLoader::registerFilePath(":/layout/hslistviewitem.css");
+    HbStyleLoader::registerFilePath(":/layout/hslistviewitem.widgetml");
+}
+
+HsListViewItem::~HsListViewItem()
+{
+    if (this == prototype()) {
+        HbStyleLoader::unregisterFilePath(":/layout/hslistviewitem.css");
+        HbStyleLoader::unregisterFilePath(":/layout/hslistviewitem.widgetml");
+    }
+}
+
+void HsListViewItem::updateChildItems()
+{
+    HbListViewItem::updateChildItems();
+
+    // DisplayRoles
+    QVariant displayRole = modelIndex().data(Qt::DisplayRole);
+    QStringList stringList;
+    if (displayRole.isValid()) {
+        if (displayRole.canConvert<QString>()) {
+            stringList.append(displayRole.toString());
+        } else if (displayRole.canConvert<QStringList>()) {
+            stringList = displayRole.toStringList();
+        }
+    }
+    EntryFlags flags = modelIndex().data(
+        CaItemModel::FlagsRole).value<EntryFlags> ();
+    isProgress = false;
+    if (flags & UninstallEntryFlag) {
+        isProgress = true;
+        if (!progress) {
+            progress = new HbProgressBar(this);
+            progress->setRange(0, 100);
+            repolish();
+        }
+        int progresVal = modelIndex().data(
+                CaItemModel::UninstalRole).toInt();
+        progress->setProgressValue(progresVal);
+        HbStyle::setItemName(progress, "progress");         
+    } else if (progress) {       
+        HbStyle::setItemName(progress, "");
+        delete progress;
+        progress = 0;
+        repolish();
+    }
+    // hide text-2 if we have to 
+    foreach (QGraphicsItem * item, this->childItems()) {
+        if (HbStyle::itemName(item) == "text-2") {
+            item->setVisible(!isProgress);            
+            break;
+        } 
+    }
+}
+
+HbAbstractViewItem*  HsListViewItem::createItem()
+{
+    return new HsListViewItem(*this);
+}
+
+
+void HsListViewItem::polish(HbStyleParameters& params)
+{       
+    HbListViewItem::setProperty("progress", isProgress);
+    HbListViewItem::polish(params);   
+}
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -49,11 +49,6 @@
     if (!hbW->views().contains(view)) {
         hbW->addView(view);
     }
-    if (hbW->currentView() && !hbW->currentView()->isContentFullScreen()) {
-        // quick trick to know if we are not comming from IDLE
-        hbW->setCurrentView(view, true, Hb::ViewSwitchUseAltEvent);
-    } else {
-        hbW->setCurrentView(view);
-    }    
+    hbW->setCurrentView(view);
 }
 
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuview.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -35,6 +35,7 @@
 #include "hscollectionstate.h"
 #include "hsmenuitemmodel.h"
 #include "hsmenuview.h"
+#include "hslistviewitem.h"
 
 /*!
     \class HsMenuView
@@ -73,6 +74,7 @@
 
     mView = mBuilder.currentView();
     mListView = mBuilder.currentListView();
+
     mViewLabel= mBuilder.currentViewLabel();
 
     mCollectionButton = mBuilder.collectionButton();
@@ -119,7 +121,7 @@
                    SLOT(scrollToRow(int, QAbstractItemView::ScrollHint)));
     }
     mListView->setModel(model);
-
+    mListView->setItemPrototype(new HsListViewItem());
     if (mListView->model()) {
         connect(mListView->model(),
                 SIGNAL(scrollTo(int, QAbstractItemView::ScrollHint)),
@@ -410,6 +412,8 @@
     mProxyModel->setFilterRegExp(QRegExp(QString(".*"), Qt::CaseInsensitive,
                                          QRegExp::RegExp));
     mSearchListView->setModel(mProxyModel);
+    mSearchListView->setItemPrototype(new HsListViewItem());
+    
     mSearchListView->scrollTo(
         mProxyModel->mapFromSource(mSearchViewInitialIndex),
         HbAbstractItemView::PositionAtTop);
--- a/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmenuviewbuilder.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -324,8 +324,7 @@
 
     foreach(QGraphicsItem *obj, currentSearchPanel()->childItems()) {
 
-        QGraphicsWidget *const widget =
-            static_cast<QGraphicsWidget *>(obj);
+        QGraphicsWidget *const widget = static_cast<QGraphicsWidget *>(obj);
 
         if (widget != NULL) {
 
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h	Wed Jun 23 18:03:36 2010 +0300
@@ -55,7 +55,7 @@
     void event_moveWidget();
     void event_moveScene();
     void event_sceneMenu();
-    void event_selectSceneWallpaper();
+    void event_selectWallpaper();
     void event_addPage();
     void event_removePage();
     void event_toggleConnection();
@@ -72,11 +72,11 @@
     bool isInPageChangeZone();
     bool isInLeftPageChangeZone();
     bool isInRightPageChangeZone();
-    void addPageToScene(int pageIndex);
-    qreal parallaxFactor() const;
+    void addPageToScene(int pageIndex);    
     void updateZoneAnimation();
     void showTrashBin();
     void removeActivePage();
+    void deleteZoneAnimation();
 
 private slots:
     void action_disableUserInteraction();
@@ -93,6 +93,7 @@
     void action_waitInput_connectMouseEventHandlers();
     void action_waitInput_publishIdleKey();
     void action_waitInput_disconnectMouseEventHandlers();
+    void action_waitInput_resetNewWidgets();
     void action_widgetInteraction_connectMouseEventHandlers();
     void action_widgetInteraction_connectGestureTimers();
     void action_widgetInteraction_disconnectMouseEventHandlers();
@@ -107,6 +108,7 @@
     void action_moveWidget_reparentToPage();
     void action_moveWidget_startWidgetDropEffect();
     void action_moveWidget_disconnectMouseEventHandlers();
+    void action_moveWidget_preventZoneAnimation();
     void action_moveScene_connectMouseEventHandlers();
     void action_moveScene_moveToNearestPage();
     void action_moveScene_disconnectMouseEventHandlers();
@@ -142,6 +144,7 @@
     void onAddContentActionTriggered();
     bool openTaskSwitcher();
     void zoneAnimationFinished();
+    void pageChangeAnimationFinished();
     void onSceneMenuTriggered(HbAction *action);
     void onRemovePageConfirmationOk();
     void onSceneMenuAboutToClose();
@@ -155,11 +158,13 @@
     QPointF mTouchScenePos;
     HsTitleResolver *mTitleResolver;
     QPropertyAnimation *mZoneAnimation;
-    bool mPageChanged;
     bool mAllowZoneAnimation;
-    QParallelAnimationGroup *mPageChangeAnimation;
+    QPropertyAnimation *mPageChangeAnimation;
     HbContinuousFeedback *mContinuousFeedback;
     bool mTrashBinFeedbackAlreadyPlayed;
+    // TODO: remove
+    bool mParallaxEnabled;
+    bool mPageWallpaperEnabled;
 
     qreal mDeltaX;
     QPointer<HbMenu> mSceneMenu;
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlewidget.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlewidget.h	Wed Jun 23 18:03:36 2010 +0300
@@ -31,11 +31,15 @@
 class HsIdleWidget : public HbWidget
 {
     Q_OBJECT
+    Q_PROPERTY(qreal sceneX READ sceneX WRITE setSceneX)
 
 public:
     HsIdleWidget(QGraphicsItem *parent = 0);
 	~HsIdleWidget();
 
+    qreal sceneX() const;
+    void setSceneX(qreal x);
+
     void setGeometry(const QRectF &rect);
 
     void captureDelayedPress(QGraphicsSceneMouseEvent *event);
@@ -48,11 +52,14 @@
 
     HbWidget *controlLayer() const { return mControlLayer; }
     HbWidget *pageLayer() const { return mPageLayer; }
+    HbWidget *pageWallpaperLayer() const { return mPageWallpaperLayer; }
     HbWidget *sceneLayer() const { return mSceneLayer; }
 
     HsTrashBinWidget *trashBin() const { return mTrashBin; }
     HsPageIndicator *pageIndicator() const { return mPageIndicator; }
 
+    qreal parallaxFactor() const;
+
 signals:    
     void mousePressed(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
     void mouseMoved(QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
@@ -70,12 +77,11 @@
 private:
     Q_DISABLE_COPY(HsIdleWidget)
     void loadControlLayer();
-    void setItemsUnfocusable(QGraphicsSceneMouseEvent *event);
-    void setItemsFocusable();
-
+        
 private:
     HbWidget *mControlLayer;
     HbWidget *mPageLayer;
+    HbWidget *mPageWallpaperLayer;
     HbWidget *mSceneLayer;
 
     QMouseEvent *mDelayedPressEvent;
@@ -83,8 +89,6 @@
     HsTrashBinWidget *mTrashBin;
     HsPageIndicator *mPageIndicator;
 
-    QList<QGraphicsItem *> mFocusableItems;
-
     HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
 };
 
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsselectbackgroundstate.h	Fri Jun 11 13:30:16 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef HSSELECTBACKGROUNDSTATESTATE_H
-#define HSSELECTBACKGROUNDSTATESTATE_H
-
-#include <QState>
-#include <QStringList>
-
-#include "hstest_global.h"
-#include "hswallpaperimagereader.h"
-
-HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest)
-
-class HbProgressDialog;
-class HbView;
-#ifdef Q_OS_SYMBIAN
-class HsImageFetcherClient;
-#else
-class XQAIWGetImageClient;
-#endif
-
-class HsSelectBackgroundState : public QState
-{
-    Q_OBJECT
-
-public:
-    HsSelectBackgroundState(QState *parent = 0);
-    ~HsSelectBackgroundState();
-
-private:
-    Q_DISABLE_COPY(HsSelectBackgroundState)
-
-signals:
-    void event_waitInput();
-    void handleError();
-
-private slots:
-    void action_selectWallpaper();
-    void action_disconnectImageFetcher();
-   
-    void onFetchComplete(QStringList imageStringList);
-    void onFetchFailed(int error);
-    void onImageProcessed();
-    void onShowAnimation();
-    void onHandleError();
-
-    // for S60 API
-#ifdef Q_OS_SYMBIAN
-    void fetchCompleted(const QString&);
-    void fetchFailed(int, const QString&);    
-#endif
-
-private:
-    
-#ifdef Q_OS_SYMBIAN
-    HsImageFetcherClient *mImageFetcher;
-#else
-    XQAIWGetImageClient *mImageFetcher;
-#endif
-    
-    HbView *mSourceView;
-    HsWallpaperImageReader *mPortraitWallpaperImageReader;
-    HsWallpaperImageReader *mLandscapeWallpaperImageReader;
-    HbProgressDialog *mProgressDialog;
-    int mRunningThreadAmount;
-    bool mShowAnimation;
-
-    HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
-};
-
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hswallpaperselectionstate.h	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef HSWALLPAPERSELECTIONSTATE_H
+#define HSWALLPAPERSELECTIONSTATE_H
+
+#include <QState>
+
+#include "hstest_global.h"
+HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest)
+
+class HsWallpaper;
+class HsSpinnerDialog;
+
+#ifdef Q_OS_SYMBIAN
+class HsImageFetcherClient;
+#else
+class XQAIWGetImageClient;
+#endif
+
+class HsWallpaperSelectionState : public QState
+{
+    Q_OBJECT
+
+public:
+    HsWallpaperSelectionState(QState *parent = 0);
+    ~HsWallpaperSelectionState();
+
+signals:
+    void event_assignImage();
+    void event_error();
+    void event_waitInput();
+    
+private:
+    Q_DISABLE_COPY(HsWallpaperSelectionState)        
+    void setupStates();
+
+private slots:    
+    void action_selectingImage_start();
+    void action_selectingImage_cleanup();
+    void action_assigningImage_showWaitDialog();
+    void action_assigningImage_start();
+    void action_assigningImage_cleanup();
+    void action_assigningImage_hideWaitDialog();
+    void action_errorMessage_show();
+
+    void onFetchCompleted(const QString &imagePath);
+    void onFetchFailed(int errorCode, const QString &errorMessage);
+    void onImageSet();
+    void onImageSetFailed();
+
+private:    
+#ifdef Q_OS_SYMBIAN
+    HsImageFetcherClient *mImageFetcher;
+#else
+    XQAIWGetImageClient *mImageFetcher;
+#endif
+    QString mImagePath;
+    HsWallpaper *mWallpaper;    
+    HsSpinnerDialog *mWaitDialog;
+    
+    HOMESCREEN_TEST_FRIEND_CLASS(HomeScreenStatePluginTest)
+};
+
+#endif // HSWALLPAPERSELECTIONSTATE_H
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsbackuprestorestate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsbackuprestorestate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -61,7 +61,7 @@
         HsBackupRestoreObserver::instance();
     
     connect(backupRestoreObserver, 
-            SIGNAL(event_backupRestoreComplited()),
+            SIGNAL(event_backupRestoreCompleted()),
             SIGNAL(event_loadScene()));
     
     // Close database
@@ -71,9 +71,8 @@
     deleteIdleView();        
 
     // Delete scene
-    HsScene *scene = HsScene::instance();    
-    delete scene;
-
+    HsScene::setInstance(0);
+    
     backupRestoreObserver->readyForBUR();
 }
 
@@ -99,7 +98,9 @@
     QScopedPointer<HbView> idleView(HsGui::takeIdleView());
 
     if (idleView){
+        HbAction *navigationAction(idleView->navigationAction());
         idleView->setNavigationAction(0);
+        delete navigationAction;
         HsScene::mainWindow()->removeView(idleView.data());
     }
 }
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsdocumentloader.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsdocumentloader.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -51,7 +51,7 @@
 QObject *HsDocumentLoader::createObject(const QString &type, const QString &name)
 {
     if (type == HsPageIndicator::staticMetaObject.className()) {
-        QObject *object = new HsPageIndicator(HsConfiguration::pageIndicatorSpacing());
+        QObject *object = new HsPageIndicator(HSCONFIGURATION_GET(pageIndicatorSpacing));
         object->setObjectName(name);
         return object;
     }
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlestate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -43,7 +43,7 @@
 #include "hspage.h"
 #include "hswidgethost.h"
 #include "hswallpaper.h"
-#include "hsselectbackgroundstate.h"
+#include "hswallpaperselectionstate.h"
 #include "hstrashbinwidget.h"
 #include "hspageindicator.h"
 #include "hsmenueventfactory.h"
@@ -114,7 +114,7 @@
     Controls the home screen idle state execution. See the
     state chart below for the state structure.
 
-    \image html hsidlestate_statechart.png
+    \imageDEPRECATED html hsidlestate_statechart.png
 */
 
 /*!
@@ -125,8 +125,7 @@
     mNavigationAction(0), mUiWidget(0),
     mTitleResolver(0),
     mZoneAnimation(0),
-    mPageChanged(false),
-    mAllowZoneAnimation(true),
+    mAllowZoneAnimation(false),
     mPageChangeAnimation(0),
     mContinuousFeedback(0),
     mTrashBinFeedbackAlreadyPlayed(false),
@@ -139,7 +138,7 @@
     setupStates();
     mTimer.setSingleShot(true);
     mTitleResolver = new HsTitleResolver(this);
-
+	
     // TODO: Uncomment when updated API available
     //mContinuousFeedback = new HbContinuousFeedback;
     //mContinuousFeedback->setContinuousEffect(HbFeedback::ContinuousSmooth);
@@ -218,7 +217,7 @@
 */
 
 /*!
-    \fn HsIdleState::event_selectSceneWallpaper()
+    \fn HsIdleState::event_selectWallpaper()
 
     This signal initiates a transition to the selectSceneWallpaper state.
 */
@@ -256,8 +255,8 @@
     QState *state_moveWidget = new QState(this);
     QState *state_moveScene = new QState(this);
     QState *state_sceneMenu = new QState(this);
-    HsSelectBackgroundState *state_selectSceneWallpaper =
-        new HsSelectBackgroundState(this);
+    HsWallpaperSelectionState *state_wallpaperSelectionState =
+        new HsWallpaperSelectionState(this);
     QState *state_addPage = new QState(this);
     QState *state_removePage = new QState(this);
     QState *state_toggleConnection = new QState(this);
@@ -275,7 +274,7 @@
     state_waitInput->addTransition(
         this, SIGNAL(event_toggleConnection()), state_toggleConnection);
     state_waitInput->addTransition(
-        this, SIGNAL(event_selectSceneWallpaper()), state_selectSceneWallpaper);
+        this, SIGNAL(event_selectWallpaper()), state_wallpaperSelectionState);
 
     state_widgetInteraction->addTransition(
         this, SIGNAL(event_waitInput()), state_waitInput);
@@ -300,12 +299,12 @@
     state_sceneMenu->addTransition(
         this, SIGNAL(event_waitInput()), state_waitInput);
     state_sceneMenu->addTransition(
-        this, SIGNAL(event_selectSceneWallpaper()), state_selectSceneWallpaper);
+        this, SIGNAL(event_selectWallpaper()), state_wallpaperSelectionState);
     state_sceneMenu->addTransition(
         this, SIGNAL(event_addPage()), state_addPage);
 
-    state_selectSceneWallpaper->addTransition(
-        state_selectSceneWallpaper, SIGNAL(event_waitInput()), state_waitInput);
+    state_wallpaperSelectionState->addTransition(
+        state_wallpaperSelectionState, SIGNAL(event_waitInput()), state_waitInput);
 
     state_addPage->addTransition(state_waitInput);
 
@@ -330,6 +329,7 @@
     ENTRY_ACTION(state_waitInput, action_waitInput_connectMouseEventHandlers)
     ENTRY_ACTION(state_waitInput, action_waitInput_publishIdleKey)
     EXIT_ACTION(state_waitInput, action_waitInput_disconnectMouseEventHandlers)
+    EXIT_ACTION(state_waitInput, action_waitInput_resetNewWidgets)
 
     ENTRY_ACTION(state_widgetInteraction, action_widgetInteraction_connectMouseEventHandlers)
     ENTRY_ACTION(state_widgetInteraction, action_widgetInteraction_connectGestureTimers)
@@ -348,6 +348,7 @@
     EXIT_ACTION(state_moveWidget, action_moveWidget_reparentToPage)
     EXIT_ACTION(state_moveWidget, action_moveWidget_startWidgetDropEffect)
     EXIT_ACTION(state_moveWidget, action_moveWidget_disconnectMouseEventHandlers)
+    EXIT_ACTION(state_moveWidget, action_moveWidget_preventZoneAnimation)
 
     ENTRY_ACTION(state_moveScene, action_moveScene_connectMouseEventHandlers)
     EXIT_ACTION(state_moveScene, action_moveScene_moveToNearestPage)
@@ -373,7 +374,7 @@
 */
 qreal HsIdleState::pageLayerXPos(int pageIndex) const
 {
-    return -pageIndex * HsScene::mainWindow()->layoutRect().width() - 0.5;
+    return -pageIndex * HsScene::mainWindow()->layoutRect().width();
 }
 
 /*!
@@ -383,33 +384,21 @@
 void HsIdleState::startPageChangeAnimation(int targetPageIndex, int duration)
 {
     if (!mPageChangeAnimation) {
-        mPageChangeAnimation = new QParallelAnimationGroup(this);
-
-        QPropertyAnimation *animation = new QPropertyAnimation(mUiWidget->pageLayer(), "x");
-        animation->setEndValue(pageLayerXPos(targetPageIndex));
-        animation->setDuration(duration);
-        mPageChangeAnimation->addAnimation(animation);
-
-        animation = new QPropertyAnimation(mUiWidget->sceneLayer(), "x");
-        animation->setEndValue((parallaxFactor() * pageLayerXPos(targetPageIndex)) - HsConfiguration::bounceEffect() / 2);
-        animation->setDuration(duration);
-        mPageChangeAnimation->addAnimation(animation);
+        mPageChangeAnimation = new QPropertyAnimation(mUiWidget, "sceneX");        
     }
-    else {
-        if (QAbstractAnimation::Stopped != mPageChangeAnimation->state()) {
-            mPageChangeAnimation->stop();
-        }
-        QAbstractAnimation *animation = mPageChangeAnimation->animationAt(0);
-
-        qobject_cast<QPropertyAnimation*>(animation)->setEndValue(pageLayerXPos(targetPageIndex));
-        qobject_cast<QPropertyAnimation*>(animation)->setDuration(duration);
-
-        animation = mPageChangeAnimation->animationAt(1);
-        qobject_cast<QPropertyAnimation*>(animation)->setEndValue((parallaxFactor() * pageLayerXPos(targetPageIndex)) - HsConfiguration::bounceEffect() / 2);
-        qobject_cast<QPropertyAnimation*>(animation)->setDuration(duration);
-    }
+    else if (mPageChangeAnimation->state() != QAbstractAnimation::Stopped) {
+        mPageChangeAnimation->stop();
+    }        
+    
+    mPageChangeAnimation->setEndValue(pageLayerXPos(targetPageIndex));
+    mPageChangeAnimation->setDuration(duration);
+    connect(mPageChangeAnimation,
+            SIGNAL(finished()),
+            SLOT(pageChangeAnimationFinished()));
     mPageChangeAnimation->start();
-    HbInstantFeedback::play(HsConfiguration::pageChangeFeedbackType());
+    
+    HbInstantFeedback::play(HSCONFIGURATION_GET(pageChangeFeedbackEffect));
+    
     mUiWidget->showPageIndicator();
     mUiWidget->setActivePage(targetPageIndex);
 }
@@ -426,29 +415,26 @@
     if (isInLeftPageChangeZone() && 0 < targetPageIndex) {
         --targetPageIndex;
     } else if (isInRightPageChangeZone() &&
-        targetPageIndex < scene->maximumPageCount()-1) {
+        targetPageIndex < HSCONFIGURATION_GET(maximumPageCount) - 1) {
         ++targetPageIndex;
     } else {
-        mAllowZoneAnimation = true;
         return;
     }
 
-    if (targetPageIndex == scene->pages().count()
-        && scene->pages().last()->widgets().isEmpty()) {
-        mAllowZoneAnimation = true;
+    if (targetPageIndex >= HSCONFIGURATION_GET(maximumPageCount)){
         return;
     }
 
     if (!mZoneAnimation) {
-        mZoneAnimation = new QPropertyAnimation(mUiWidget->sceneLayer(), "x");
+        mZoneAnimation = new QPropertyAnimation(mUiWidget, "sceneX");
     }
 
-    int bounceEffect = HsConfiguration::bounceEffect();
+    int bounceEffect = HSCONFIGURATION_GET(bounceEffect);
 
     if (isInLeftPageChangeZone()) {
-        mZoneAnimation->setEndValue(((parallaxFactor() * pageLayerXPos(scene->activePageIndex()))-bounceEffect/2)+bounceEffect/2);
+        mZoneAnimation->setEndValue(pageLayerXPos(scene->activePageIndex()) + bounceEffect);
     } else {
-        mZoneAnimation->setEndValue(((parallaxFactor() * pageLayerXPos(scene->activePageIndex()))-bounceEffect/2)-bounceEffect/2);
+        mZoneAnimation->setEndValue(pageLayerXPos(scene->activePageIndex()) - bounceEffect);
     }
     mZoneAnimation->setDuration(duration);
     mZoneAnimation->setDirection(QAbstractAnimation::Forward);
@@ -457,7 +443,6 @@
             SIGNAL(finished()),
             SLOT(zoneAnimationFinished()));
     mZoneAnimation->start();
-    mPageChanged = true;
 }
 
 /*!
@@ -476,7 +461,7 @@
 */
 bool HsIdleState::isInLeftPageChangeZone()
 {
-    return mTouchScenePos.x() < HsConfiguration::pageChangeZoneWidth();
+    return mTouchScenePos.x() < HSCONFIGURATION_GET(pageChangeZoneWidth);
 }
 
 /*!
@@ -486,7 +471,7 @@
 bool HsIdleState::isInRightPageChangeZone()
 {
     qreal pageWidth = HsScene::mainWindow()->layoutRect().width();
-    return mTouchScenePos.x() > pageWidth - HsConfiguration::pageChangeZoneWidth();;
+    return mTouchScenePos.x() > pageWidth - HSCONFIGURATION_GET(pageChangeZoneWidth);
 }
 
 /*!
@@ -503,53 +488,33 @@
 }
 
 /*!
-    Computes the parallax factor based on the current scene and
-    page layer widths, and page count.
-*/
-qreal HsIdleState::parallaxFactor() const
-{
-    qreal clw = mUiWidget->controlLayer()->size().width();
-    qreal slw = mUiWidget->sceneLayer()->size().width() - HsConfiguration::bounceEffect();
-    int n = HsScene::instance()->pages().count();
-    if (n < 2) {
-        return 1;
-    } else {
-        return (slw - clw) / ((n - 1) * clw);
-    }
-}
-
-/*!
     Checks if page change zone animation needs to be started or stopped
 */
 void HsIdleState::updateZoneAnimation()
 {
     if (isInPageChangeZone() && mAllowZoneAnimation) {
-        if (!mZoneAnimation) {
-            /* We don't want to create another animation
-               before previous is finished */
-            mAllowZoneAnimation = false;
-            startPageChangeZoneAnimation(HsConfiguration::pageChangeZoneAnimationDuration());
+        if (!mZoneAnimation
+            && ( !mPageChangeAnimation
+                 || mPageChangeAnimation->state() == QAbstractAnimation::Stopped )) {
+            startPageChangeZoneAnimation(HSCONFIGURATION_GET(pageChangeZoneAnimationDuration));
         }
     }
     else if (mZoneAnimation && !isInPageChangeZone()) {
         if (mZoneAnimation->state() == QAbstractAnimation::Running) {
             if (mZoneAnimation->direction() == QAbstractAnimation::Forward) {
-                    mPageChanged = false;
-                    mZoneAnimation->setDuration(HsConfiguration::pageChangeZoneReverseAnimationDuration());
+                    mZoneAnimation->setDuration(HSCONFIGURATION_GET(pageChangeZoneReverseAnimationDuration));
                     mZoneAnimation->setDirection(QAbstractAnimation::Backward);
             }
         }
         else {
             // Out of the page change zone. Delete animation.
-            delete mZoneAnimation;
-            mZoneAnimation = NULL;
-            mAllowZoneAnimation = true;
+            deleteZoneAnimation();
         }
     }
     else if (!isInPageChangeZone()) {
-        /* Zone animation finished and deleted.
-           New animation can be launched. */
-        mAllowZoneAnimation = true;
+        if (mZoneAnimation) {
+            mZoneAnimation->stop();
+        }
     }
 }
 
@@ -560,7 +525,7 @@
 {
     if (mUiWidget->trashBin()->isUnderMouse()) {
         if (!mTrashBinFeedbackAlreadyPlayed) {
-            HbInstantFeedback::play(HsConfiguration::widgetOverTrashbinFeedbackType());
+            HbInstantFeedback::play(HSCONFIGURATION_GET(widgetOverTrashbinFeedbackEffect));
             mTrashBinFeedbackAlreadyPlayed = true;
         }
         mUiWidget->trashBin()->activate();
@@ -586,12 +551,16 @@
 
     mUiWidget->removePage(pageIndex);
     scene->removePage(page);
+    
+    if (page->wallpaper()) {
+        page->wallpaper()->remove();        
+    }
     delete page;
 
     pageIndex = pageIndex == 0 ? 0 : pageIndex - 1;
     scene->setActivePageIndex(pageIndex);
 
-    startPageChangeAnimation(pageIndex, HsConfiguration::pageRemovedAnimationDuration());
+    startPageChangeAnimation(pageIndex, HSCONFIGURATION_GET(pageRemovedAnimationDuration));
 
     mUiWidget->pageIndicator()->removeItem(pageIndex);
     mUiWidget->setActivePage(pageIndex);
@@ -599,6 +568,15 @@
 }
 
 /*!
+    Deletes page change zone animation.
+*/
+void HsIdleState::deleteZoneAnimation()
+{
+    delete mZoneAnimation;
+    mZoneAnimation = NULL;
+}
+
+/*!
     Disables the main window user interaction.
 */
 void HsIdleState::action_disableUserInteraction()
@@ -631,7 +609,7 @@
         mNavigationAction->setIcon(HbIcon(gApplicationLibraryIconName));
         connect(mNavigationAction, SIGNAL(triggered()), SIGNAL(event_applicationLibrary()));
         idleView->setNavigationAction(mNavigationAction);
-        
+
         HsGui::setIdleView(idleView);
 
         if (mPageChangeAnimation) {
@@ -709,10 +687,12 @@
     page is shown.
 */
 void HsIdleState::action_idle_showActivePage()
-{
-    qreal x = pageLayerXPos(HsScene::instance()->activePageIndex());
-    mUiWidget->pageLayer()->setX(x);
-    mUiWidget->sceneLayer()->setX((parallaxFactor() * x) - HsConfiguration::bounceEffect() / 2);
+{    
+    HsScene *scene = HsScene::instance();
+    QApplication::instance()->installEventFilter(scene);
+    scene->activePage()->showWidgets();
+    qreal x = pageLayerXPos(scene->activePageIndex());
+    mUiWidget->setSceneX(x);
 }
 
 /*!
@@ -758,6 +738,10 @@
 */
 void HsIdleState::action_idle_cleanupView()
 {
+    HsScene *scene = HsScene::instance();
+    QApplication::instance()->removeEventFilter(scene);
+    scene->activePage()->hideWidgets();
+
     if (mUiWidget) {
         mUiWidget->clearDelayedPress();
     }
@@ -808,14 +792,14 @@
         this, SLOT(onAddContentActionTriggered()));
 
     // Add page
-    if (scene->pages().count() < scene->maximumPageCount()) {
+    if (scene->pages().count() < HSCONFIGURATION_GET(maximumPageCount)) {
         menu->addAction(hbTrId(hsLocTextId_OptionsMenu_AddPage),
             this, SIGNAL(event_addPage()));
     }
 
     // Change wallpaper
     menu->addAction(hbTrId(hsLocTextId_ContextMenu_ChangeWallpaper),
-        this, SIGNAL(event_selectSceneWallpaper()));
+        this, SIGNAL(event_selectWallpaper()));
 
     // Remove page
     if (scene->activePage()->isRemovable()) {
@@ -852,6 +836,14 @@
 }
 
 /*!
+    Resets new widget layout.
+*/
+void HsIdleState::action_waitInput_resetNewWidgets()
+{
+    HsScene::instance()->activePage()->resetNewWidgets();
+}
+
+/*!
     Connects the widgetInteraction state's mouse event handlers.
 */
 void HsIdleState::action_widgetInteraction_connectMouseEventHandlers()
@@ -865,7 +857,7 @@
 */
 void HsIdleState::action_widgetInteraction_connectGestureTimers()
 {
-    mTimer.setInterval(HsConfiguration::widgetTapAndHoldTimeout());
+    mTimer.setInterval(HSCONFIGURATION_GET(widgetTapAndHoldTimeout));
     connect(&mTimer, SIGNAL(timeout()),
         SLOT(widgetInteraction_onTapAndHoldTimeout()));
     mTimer.start();
@@ -903,7 +895,7 @@
 */
 void HsIdleState::action_sceneInteraction_connectGestureTimers()
 {
-    mTimer.setInterval(HsConfiguration::sceneTapAndHoldTimeout());
+    mTimer.setInterval(HSCONFIGURATION_GET(sceneTapAndHoldTimeout));
     connect(&mTimer, SIGNAL(timeout()),
         SLOT(sceneInteraction_onTapAndHoldTimeout()));
     mTimer.start();
@@ -947,6 +939,7 @@
     HsWidgetHost *widget = HsScene::instance()->activeWidget();
     Q_ASSERT(widget);
     widget->startDragEffect();
+    mAllowZoneAnimation = true;
 }
 
 /*!
@@ -968,8 +961,7 @@
     if (mZoneAnimation
         && mZoneAnimation->state() == QAbstractAnimation::Running
         && mZoneAnimation->direction() == QAbstractAnimation::Forward) {
-        mPageChanged = false;
-        mZoneAnimation->setDuration(HsConfiguration::pageChangeZoneReverseAnimationDuration());
+        mZoneAnimation->setDuration(HSCONFIGURATION_GET(pageChangeZoneReverseAnimationDuration));
         mZoneAnimation->setDirection(QAbstractAnimation::Backward);
     }
 
@@ -978,7 +970,7 @@
     HsWidgetHost *widget = scene->activeWidget();
 
     if (mUiWidget->trashBin()->isUnderMouse()) {
-        HbInstantFeedback::play(HsConfiguration::widgetDropToTrashbinFeedbackType());
+        HbInstantFeedback::play(HSCONFIGURATION_GET(widgetDropToTrashbinFeedbackEffect));
         widget->page()->removeWidget(widget);
         widget->remove();
         scene->setActiveWidget(0);
@@ -1000,14 +992,13 @@
 
         // play feedback effect if user drops widget between pages and it needs to be repositioned back to original page
         if( widgetX != widgetRect.x() || widgetY != widgetRect.y()) {
-            HbInstantFeedback::play(HsConfiguration::widgetRepositionFeedbackType());
+            HbInstantFeedback::play(HSCONFIGURATION_GET(widgetRepositionFeedbackEffect));
         }
         widget->setPos(widgetX, widgetY);
 
         widget->savePresentation();
         page->updateZValues();
     }
-    mAllowZoneAnimation = true;
 
     widget->setParentItem(HsScene::instance()->activePage());
 
@@ -1035,6 +1026,14 @@
 }
 
 /*!
+    Prevents page change zone animation.
+*/
+void HsIdleState::action_moveWidget_preventZoneAnimation()
+{
+    mAllowZoneAnimation = false;
+}
+
+/*!
     Connects the moveScene state's mouse event handlers.
 */
 void HsIdleState::action_moveScene_connectMouseEventHandlers()
@@ -1053,15 +1052,15 @@
 
     int pageIndex = HsScene::instance()->activePageIndex();
 
-    if (mDeltaX < -HsConfiguration::pageChangePanDistanceInPixels()) {
+    if (mDeltaX < -HSCONFIGURATION_GET(pageChangePanDistanceInPixels)) {
         pageIndex = qMin(pageIndex + 1, pages.count() - 1);
-    } else if (HsConfiguration::pageChangePanDistanceInPixels() < mDeltaX) {
+    } else if (HSCONFIGURATION_GET(pageChangePanDistanceInPixels) < mDeltaX) {
         pageIndex = qMax(pageIndex - 1, 0);
     }
 
     HsScene::instance()->setActivePageIndex(pageIndex);
 
-    startPageChangeAnimation(pageIndex, HsConfiguration::pageChangeAnimationDuration());
+    startPageChangeAnimation(pageIndex, HSCONFIGURATION_GET(pageChangeAnimationDuration));
 }
 
 /*!
@@ -1090,11 +1089,11 @@
     mSceneMenu->addAction(hbTrId(hsLocTextId_ContextMenu_AddContent), this, SLOT(onAddContentActionTriggered()));
 
     HsScene *scene = HsScene::instance();
-    if (scene->pages().count() < scene->maximumPageCount()) {
+    if (scene->pages().count() < HSCONFIGURATION_GET(maximumPageCount)) {
         mSceneMenu->addAction(hbTrId(hsLocTextId_OptionsMenu_AddPage), this, SIGNAL(event_addPage()));
     }
 
-    mSceneMenu->addAction(hbTrId(hsLocTextId_ContextMenu_ChangeWallpaper), this, SIGNAL(event_selectSceneWallpaper()));
+    mSceneMenu->addAction(hbTrId(hsLocTextId_ContextMenu_ChangeWallpaper), this, SIGNAL(event_selectWallpaper()));
     mSceneMenu->setPreferredPos(mTouchScenePos);
     mSceneMenu->open(this, SLOT(onSceneMenuTriggered(HbAction *)));
 }
@@ -1108,10 +1107,10 @@
 void HsIdleState::action_addPage_addPage()
 {
     HsScene *scene = HsScene::instance();
-	  int pageIndex = scene->activePageIndex() + 1;
+	int pageIndex = scene->activePageIndex() + 1;
     addPageToScene(pageIndex);
     scene->setActivePageIndex(pageIndex);
-    startPageChangeAnimation(pageIndex, HsConfiguration::newPageAddedAnimationDuration());
+    startPageChangeAnimation(pageIndex, HSCONFIGURATION_GET(newPageAddedAnimationDuration));
     mUiWidget->pageIndicator()->addItem(pageIndex);
     mUiWidget->showPageIndicator();
 }
@@ -1132,7 +1131,7 @@
         box->setHeadingWidget(new HbLabel
                                 (hbTrId(hsLocTextId_Title_RemovePage)));
         box->setText(hbTrId(hsLocTextId_Confirmation_RemovePage));
-        
+
         QAction *buttonOk = box->actions().at(0);
         //We are keen only from OK button. Cancel is not connected to any slot.
         connect(buttonOk, SIGNAL(triggered()), SLOT(onRemovePageConfirmationOk()));
@@ -1211,7 +1210,7 @@
 
     QPointF point =
         event->scenePos() - event->buttonDownScenePos(Qt::LeftButton);
-    if (HsConfiguration::tapAndHoldDistance() < point.manhattanLength()) {
+    if (HSCONFIGURATION_GET(tapAndHoldDistance) < point.manhattanLength()) {
         // Threshold area for tap exceeded. This is pan or swipe
         mTimer.stop();
         if (HsScene::instance()->activeWidget()->isPannable(event)) {
@@ -1223,7 +1222,6 @@
             emit event_moveScene();
         }
     }
-
 }
 
 /*!
@@ -1272,7 +1270,7 @@
 
     QPointF point =
         event->scenePos() - event->buttonDownScenePos(Qt::LeftButton);
-    if (HsConfiguration::tapAndHoldDistance() < point.manhattanLength()) {
+    if (HSCONFIGURATION_GET(tapAndHoldDistance) < point.manhattanLength()) {
         mTimer.stop();
         mUiWidget->clearDelayedPress();
         emit event_moveScene();
@@ -1341,14 +1339,14 @@
     */
     widget->setGeometry(widgetX, widgetY, widgetRect.width(), widgetRect.height());
 
-    int bounceFeedbackEffectDistance = HsConfiguration::bounceFeedbackEffectDistance();
+    int bounceFeedbackEffectDistance = HSCONFIGURATION_GET(bounceFeedbackEffectDistance);
     //Handle effects:
     //User is indicated by a tactile feedback if he/she is trying to move
     //widget over the first or the last page.
     if( (page == scene->pages().first() && mTouchScenePos.x() < bounceFeedbackEffectDistance ) ||
-        (page == scene->pages().last() && scene->pages().count() == scene->maximumPageCount()
+        (page == scene->pages().last() && scene->pages().count() == HSCONFIGURATION_GET(maximumPageCount)
          && mTouchScenePos.x() > pageRect.width() - bounceFeedbackEffectDistance)) {
-             HbInstantFeedback::play(HsConfiguration::widgetMoveBlockedFeedbackType());
+             HbInstantFeedback::play(HSCONFIGURATION_GET(widgetMoveBlockedFeedbackEffect));
             // TODO: use code below when Orbit has updated ContinuousFeedback API
             //if (!mContinuousFeedback->isPlaying()) {
             //    mContinuousFeedback->play();
@@ -1397,14 +1395,13 @@
     HsScene *scene = HsScene::instance();
     mDeltaX = event->scenePos().x() - event->buttonDownScenePos(Qt::LeftButton).x();
 
-    int bounceEffect = HsConfiguration::bounceEffect();
+    int bounceEffect = HSCONFIGURATION_GET(bounceEffect);
 
-    qreal x = qBound(pageLayerXPos(scene->pages().count() - 1) - bounceEffect / 2 / parallaxFactor(),
+    qreal x = qBound(pageLayerXPos(scene->pages().count() - 1) - bounceEffect / 2 / mUiWidget->parallaxFactor(),
                      pageLayerXPos(scene->activePageIndex()) + mDeltaX,
-                     pageLayerXPos(0) + (bounceEffect / 2 / parallaxFactor()) - qreal(0.5));
+                     pageLayerXPos(0) + (bounceEffect / 2 / mUiWidget->parallaxFactor()));
 
-    mUiWidget->pageLayer()->setX(x);
-    mUiWidget->sceneLayer()->setX((parallaxFactor() * x) - bounceEffect / 2);
+    mUiWidget->setSceneX(x);
 }
 
 /*!
@@ -1467,7 +1464,7 @@
     HsScene *scene = HsScene::instance();
     int pageIndex = scene->activePageIndex();
 
-    if (mPageChanged) {
+    if (mZoneAnimation->direction() == QAbstractAnimation::Forward) {
         if (isInLeftPageChangeZone() &&
             0 < pageIndex) {
             --pageIndex;
@@ -1476,43 +1473,30 @@
             pageIndex < scene->pages().count()) {
             ++pageIndex;
         }
-        else {
-            delete mZoneAnimation;
-            mZoneAnimation = NULL;
-            mAllowZoneAnimation = true;
-            return;
-        }
 
         if (pageIndex == scene->pages().count()) {
-            if (scene->pages().last()->widgets().isEmpty()) {
-                delete mZoneAnimation;
-                mZoneAnimation = NULL;
-                mAllowZoneAnimation = true;
-                return;
-            }
-            else if (scene->pages().count() < scene->maximumPageCount()) {
+            if (pageIndex < HSCONFIGURATION_GET(maximumPageCount)) {
                 addPageToScene(pageIndex);
                 mUiWidget->showPageIndicator();
                 mUiWidget->pageIndicator()->addItem(pageIndex);
             }
-            else {
-                delete mZoneAnimation;
-                mZoneAnimation = NULL;
-                mAllowZoneAnimation = true;
-                return;
-            }
         }
         scene->setActivePageIndex(pageIndex);
-        startPageChangeAnimation(pageIndex, HsConfiguration::pageChangeAnimationDuration());
+        startPageChangeAnimation(pageIndex, HSCONFIGURATION_GET(pageChangeAnimationDuration));
     }
     else {
         scene->setActivePageIndex(pageIndex);
         mUiWidget->setActivePage(pageIndex);
-        mAllowZoneAnimation = true;
     }
+    deleteZoneAnimation();
+}
 
-    delete mZoneAnimation;
-    mZoneAnimation = NULL;
+/*!
+    Page change animation has been finished.
+ */
+void HsIdleState::pageChangeAnimationFinished()
+{
+    updateZoneAnimation();
 }
 
 /*!
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlewidget.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsidlewidget.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -46,8 +46,8 @@
     \ingroup group_hshomescreenstateplugin
     \brief View part of the home screen idle state.
 
-    Maintains the idle view ui layers and takes care of 
-    receiving user input and communicating it to the idle 
+    Maintains the idle view ui layers and takes care of
+    receiving user input and communicating it to the idle
     state for further processing.
 */
 
@@ -56,12 +56,12 @@
 */
 HsIdleWidget::HsIdleWidget(QGraphicsItem *parent)
   : HbWidget(parent),
-    mControlLayer(0), mPageLayer(0), mSceneLayer(0),
-    mDelayedPressEvent(0),
+    mControlLayer(0), mPageLayer(0), mPageWallpaperLayer(0),
+    mSceneLayer(0), mDelayedPressEvent(0),
     mTrashBin(0), mPageIndicator(0)
 {
     setFlag(ItemHasNoContents);
-    
+
     loadControlLayer();
 
     QGraphicsLinearLayout *linearLayout = 0;
@@ -71,7 +71,14 @@
     linearLayout->setSpacing(0);
     mPageLayer = new HbWidget(this);
     mPageLayer->setLayout(linearLayout);
-    mPageLayer->setZValue(1);
+    mPageLayer->setZValue(2);
+    
+    linearLayout = new QGraphicsLinearLayout(Qt::Horizontal);
+    linearLayout->setContentsMargins(0, 0, 0, 0);
+    linearLayout->setSpacing(0);
+    mPageWallpaperLayer = new HbWidget(this);
+    mPageWallpaperLayer->setLayout(linearLayout);
+    mPageWallpaperLayer->setZValue(1);
     
     linearLayout = new QGraphicsLinearLayout(Qt::Horizontal);
     linearLayout->setContentsMargins(0, 0, 0, 0);
@@ -94,12 +101,37 @@
         if (page->scene()) {
             page->scene()->removeItem(page);
         }
+        HsWallpaper *pageWallpaper = page->wallpaper();
+        if (pageWallpaper) {
+            pageWallpaper->setParentItem(0);
+            if (pageWallpaper->scene()) {
+                pageWallpaper->scene()->removeItem(pageWallpaper);
+            }
+        }
     }
 
-    HsWallpaper *wallpaper = HsScene::instance()->wallpaper();
-    wallpaper->setParentItem(0);
-    if (wallpaper->scene()) {
-        wallpaper->scene()->removeItem(wallpaper);
+    HsWallpaper *sceneWallpaper = HsScene::instance()->wallpaper();
+    if (sceneWallpaper) {
+        sceneWallpaper->setParentItem(0);
+        if (sceneWallpaper->scene()) {
+            sceneWallpaper->scene()->removeItem(sceneWallpaper);
+        }
+    }
+}
+
+qreal HsIdleWidget::sceneX() const
+{
+    return mPageLayer->x();
+}
+
+void HsIdleWidget::setSceneX(qreal x)
+{
+    if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) {
+        mPageLayer->setX(x);
+        mSceneLayer->setX((parallaxFactor() * x) - HSCONFIGURATION_GET(bounceEffect) / 2);
+    } else {
+        mPageLayer->setX(x);
+        mPageWallpaperLayer->setX(x);
     }
 }
 
@@ -113,7 +145,10 @@
     if (layoutRect == rect || (layoutRect.height() == rect.width() && layoutRect.width() == rect.height())) {
         mControlLayer->resize(rect.size());
 		mPageLayer->resize(n * rect.width(), rect.height());
-		mSceneLayer->resize(2 * rect.width() + HsConfiguration::bounceEffect(), rect.height());
+        if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) {
+            mPageWallpaperLayer->resize(n * rect.width(), rect.height());
+        }
+		mSceneLayer->resize(2 * rect.width() + HSCONFIGURATION_GET(bounceEffect), rect.height());
 		HbWidget::setGeometry(rect);
 	} else {
 		QRectF sceneRect = mapToScene(rect).boundingRect();
@@ -141,7 +176,7 @@
 {
     if (mDelayedPressEvent) {
         QApplication::sendEvent(HsScene::mainWindow()->viewport(), mDelayedPressEvent);
-        clearDelayedPress();     
+        clearDelayedPress();
     }
 }
 
@@ -149,7 +184,7 @@
     Deletes the stored mouse press event.
 */
 void HsIdleWidget::clearDelayedPress()
-{    
+{
     if (mDelayedPressEvent) {
         delete mDelayedPressEvent;
         mDelayedPressEvent = 0;
@@ -157,7 +192,7 @@
 }
 
 /*!
-    Sets the active page \a index to the page 
+    Sets the active page \a index to the page
     indicator.
 */
 void HsIdleWidget::setActivePage(int index)
@@ -171,11 +206,19 @@
 */
 void HsIdleWidget::insertPage(int index, HsPage *page)
 {
-    QGraphicsLinearLayout *layout = 
+    QGraphicsLinearLayout *layout =
         static_cast<QGraphicsLinearLayout *>(mPageLayer->layout());
     layout->insertItem(index, page);
     mPageLayer->resize(
         layout->count() * size().width(), size().height());
+
+    if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) {
+        QGraphicsLinearLayout *layout =
+            static_cast<QGraphicsLinearLayout *>(mPageWallpaperLayer->layout());
+        layout->insertItem(index, page->wallpaper());
+        mPageWallpaperLayer->resize(
+            layout->count() * size().width(), size().height());
+    }
 }
 
 /*!
@@ -184,11 +227,19 @@
 */
 void HsIdleWidget::removePage(int index)
 {
-    QGraphicsLinearLayout *layout = 
+    QGraphicsLinearLayout *layout =
         static_cast<QGraphicsLinearLayout *>(mPageLayer->layout());
     layout->removeAt(index);
     mPageLayer->resize(
         layout->count() * size().width(), size().height());
+
+    if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) {
+        QGraphicsLinearLayout *layout =
+            static_cast<QGraphicsLinearLayout *>(mPageWallpaperLayer->layout());
+        layout->removeAt(index);
+        mPageWallpaperLayer->resize(
+            layout->count() * size().width(), size().height());
+    }
 }
 
 /*!
@@ -225,8 +276,8 @@
     \fn HsIdleWidget::mousePressed(QGraphicsItem *, QGraphicsSceneMouseEvent *, bool &)
 
     The idle state connects to this signal for handling mouse
-    press events. It filters events for the item \a watched. 
-    \a event is the filtered event. Sets the \a filtered true 
+    press events. It filters events for the item \a watched.
+    \a event is the filtered event. Sets the \a filtered true
     if the event was filtered by this handler.
 */
 
@@ -234,8 +285,8 @@
     \fn HsIdleWidget::mouseMoved(QGraphicsItem *, QGraphicsSceneMouseEvent *, bool &)
 
     The idle state connects to this signal for handling mouse
-    move events. It filters events for the item \a watched. 
-    \a event is the filtered event. Sets the \a filtered true 
+    move events. It filters events for the item \a watched.
+    \a event is the filtered event. Sets the \a filtered true
     if the event was filtered by this handler.
 */
 
@@ -243,8 +294,8 @@
     \fn HsIdleWidget::mouseReleased(QGraphicsItem *, QGraphicsSceneMouseEvent *, bool &)
 
     The idle state connects to this signal for handling mouse
-    release events. It filters events for the item \a watched. 
-    \a event is the filtered event. Sets the \a filtered true 
+    release events. It filters events for the item \a watched.
+    \a event is the filtered event. Sets the \a filtered true
     if the event was filtered by this handler.
 */
 
@@ -256,7 +307,7 @@
     mPageIndicator->hide();
     mTrashBin->show();
 }
- 
+
 /*!
     Sets the page indicator visible and hides the trashbin.
 */
@@ -264,7 +315,7 @@
 {
     mTrashBin->hide();
     mTrashBin->deactivate();
-    mPageIndicator->setSpacing(HsConfiguration::pageIndicatorSpacing()); // for usability optimization widget, can be removed later on
+    mPageIndicator->setSpacing(HSCONFIGURATION_GET(pageIndicatorSpacing)); // for usability optimization widget, can be removed later on
     mPageIndicator->setVisible(1 < mPageIndicator->itemCount());
 }
 
@@ -274,31 +325,29 @@
 bool HsIdleWidget::eventFilter(QObject *object, QEvent *event)
 {
     Q_UNUSED(object)
-
-    if (HbVkbHost::activeVkbHost()) {
-        setFiltersChildEvents(false);
-        return false;
-    }
-
+    
     bool filtered = false;
 
     switch (event->type()) {
     case QEvent::GraphicsSceneMousePress:
+        if (HbVkbHost::activeVkbHost()) {
+            setFiltersChildEvents(false);
+            break;
+        }
         if (mDelayedPressEvent &&
             scene()->mouseGrabberItem()) {
             scene()->mouseGrabberItem()->ungrabMouse();
         }
         setFiltersChildEvents(!mDelayedPressEvent);
         break;
-    case QEvent::GraphicsSceneMouseMove:
+    case QEvent::GraphicsSceneMouseMove:        
         emit mouseMoved(0, static_cast<QGraphicsSceneMouseEvent *>(event), filtered);
         break;
     case QEvent::GraphicsSceneMouseRelease:
-        setItemsFocusable();
         emit mouseReleased(0, static_cast<QGraphicsSceneMouseEvent *>(event), filtered);
         if (filtered && scene()->mouseGrabberItem()) {
             scene()->mouseGrabberItem()->ungrabMouse();
-        }        
+        }
         break;
     default:
         break;
@@ -317,10 +366,7 @@
     switch (event->type()) {
     case QEvent::GraphicsSceneMousePress:
         emit mousePressed(watched, static_cast<QGraphicsSceneMouseEvent *>(event), filtered);
-        if (filtered) {
-            setItemsUnfocusable(static_cast<QGraphicsSceneMouseEvent *>(event));
-        }
-        break;    
+        break;
     default:
         break;
     }
@@ -336,16 +382,25 @@
     HsScene *scene = HsScene::instance();
     Q_ASSERT(scene);
 
-    QGraphicsLinearLayout *layout = 
+    QGraphicsLinearLayout *pageLayout = 
         static_cast<QGraphicsLinearLayout *>(mPageLayer->layout());
+
     QList<HsPage *> pages = scene->pages();
+
     foreach (HsPage *page, pages) {
-        layout->addItem(page);
+        pageLayout->addItem(page);
+        if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::PageWallpapers) {
+            QGraphicsLinearLayout *pageWallpaperLayout = 
+                static_cast<QGraphicsLinearLayout *>(mPageWallpaperLayer->layout());
+            pageWallpaperLayout->addItem(page->wallpaper());
+        }
     }
-
-    layout = static_cast<QGraphicsLinearLayout *>(mSceneLayer->layout());
-    HsWallpaper *wallpaper = HsScene::instance()->wallpaper();
-    layout->addItem(wallpaper);
+   if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) {
+        QGraphicsLinearLayout *sceneLayout = 
+            static_cast<QGraphicsLinearLayout *>(mSceneLayer->layout());
+    	HsWallpaper *wallpaper = HsScene::instance()->wallpaper();
+        sceneLayout->addItem(wallpaper);
+    }
            
     mPageIndicator->initialize(pages.count(), scene->activePageIndex());    
     showPageIndicator();
@@ -376,12 +431,12 @@
             loader.load(fallbackPath, &loaded);
         }
     } else {
-        loader.load(fallbackPath, &loaded);       
+        loader.load(fallbackPath, &loaded);
     }
 
     if (loaded) {
         mControlLayer = qobject_cast<HbWidget *>(loader.findWidget(gControlLayerName));
-        mControlLayer->setZValue(2);
+        mControlLayer->setZValue(3);
         mControlLayer->setParentItem(this);
 
         mTrashBin = qobject_cast<HsTrashBinWidget *>(loader.findWidget(gTrashBinName));
@@ -394,56 +449,14 @@
     }
 }
 
-/*!
-    Sets the items under the given mouse \a event scene position 
-    unfocusable and stores the items.
-*/
-void HsIdleWidget::setItemsUnfocusable(QGraphicsSceneMouseEvent *event)
-{
-    mFocusableItems.clear();
-
-    if (!scene()) {
-        return;
-    }
-
-    QList<QGraphicsItem *> items = scene()->items(event->scenePos());
-    if (items.isEmpty()) {
-        return;
-    }
-
-    int i = 0;
-    for (; i < items.count(); ++i) {
-        if (mPageLayer->isAncestorOf(items[i])) {
-            ++i;
-            break;
-        }
-    }
- 
-    HsPage *page = HsScene::instance()->activePage();
-    QList<HsWidgetHost *> widgets = page->widgets();
-    
-    for (; i < items.count(); ++i) {
-        QGraphicsItem *item = items.at(i);
-        if (page->isAncestorOf(item)) {
-            foreach (HsWidgetHost *widget, widgets) {
-                if ((item == widget || widget->isAncestorOf(item))&& item->isEnabled() && (item->flags() & QGraphicsItem::ItemIsFocusable)) {
-                    if (!item->isWidget() || static_cast<QGraphicsWidget *>(item)->focusPolicy() & Qt::ClickFocus) {
-                        item->setFlag(QGraphicsItem::ItemIsFocusable, false);
-                        mFocusableItems.append(item);
-                    }
-                }
-            }
-        }
+qreal HsIdleWidget::parallaxFactor() const
+{   
+    qreal clw = mControlLayer->size().width();
+    qreal slw = mSceneLayer->size().width() - HSCONFIGURATION_GET(bounceEffect);
+    int n = HsScene::instance()->pages().count();
+    if (n < 2) {
+        return 1;
+    } else {
+        return (slw - clw) / ((n - 1) * clw);
     }
 }
- 
-/*!
-    Sets the stored items focusable.
-*/
-void HsIdleWidget::setItemsFocusable()
-{
-    foreach (QGraphicsItem *item, mFocusableItems) {
-        item->setFlag(QGraphicsItem::ItemIsFocusable);
-    }
-    mFocusableItems.clear();
-}
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsloadscenestate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:  
+* Description:
 *
 */
 
@@ -39,14 +39,14 @@
 #ifdef Q_OS_SYMBIAN
       ,mStartupKey(KPSUidStartup.iUid, KPSStartupUiPhase),
       mSettingsMgr(0)
-#endif        
+#endif
 {
     connect(this, SIGNAL(entered()), SLOT(action_loadScene()));
-#ifdef Q_OS_SYMBIAN     
+#ifdef Q_OS_SYMBIAN
 
     mSettingsMgr = new XQSettingsManager(this);
-    
-#endif //Q_OS_SYMBIAN    
+
+#endif //Q_OS_SYMBIAN
 }
 
 /*!
@@ -59,7 +59,7 @@
 /*!
     \fn HsLoadSceneState::event_idle()
 
-    Initiates a transition to idle state.
+    Loads scene information and initiates a transition to idle state if ready.
 */
 
 /*!
@@ -67,32 +67,31 @@
 */
 void HsLoadSceneState::action_loadScene()
 {
+    HsScene::setInstance(new HsScene);
     HsScene::instance()->load();
 
-#ifdef Q_OS_SYMBIAN    
- 
+#ifdef Q_OS_SYMBIAN
+
     int startupPhase = mSettingsMgr->readItemValue(mStartupKey).toInt();
     qDebug() << "HsLoadSceneState::action_loadScene boot phase " << startupPhase;
-    
+
     if (EStartupUiPhaseAllDone != startupPhase) {
         qDebug() << "HsLoadSceneState::HsLoadSceneState, starting to listen key";
-        
+
         connect(mSettingsMgr,SIGNAL(valueChanged(XQSettingsKey, const QVariant &)), this,
 			          SLOT(handleKeyChange(XQSettingsKey, const QVariant &)));
-        
+
         mSettingsMgr->startMonitoring(mStartupKey);
     } else {
         // We're already at the phase in boot where we can draw ourself to the foreground.
         showUi();
-        delete mSettingsMgr;
-        mSettingsMgr = 0;
 		}
 
 #else
 
     showUi();
 
-#endif		
+#endif
 }
 #ifdef Q_OS_SYMBIAN
 /*!
@@ -105,22 +104,20 @@
 {
 		qDebug() << "HsLoadSceneState::handleKeyChange key " << key.key()
 		         << "value " << value.toInt();
-		
+
 		if (key.key() == KPSStartupUiPhase && value.toInt() == EStartupUiPhaseAllDone) {
-			showUi();			 	
+			showUi();
     		mSettingsMgr->stopMonitoring(mStartupKey);
-    		mSettingsMgr->deleteLater();
-    		mSettingsMgr = 0;
 		}
 }
 #endif
 /*!
     \fn HsLoadSceneState::showUi()
 
-    Makes the main window visible, signals transition to idle state and 
+    Makes the main window visible, signals transition to idle state and
     brings the hs app to the foreground.
 */
-	
+
 void HsLoadSceneState::showUi()
 {
     qDebug() << "HsLoadSceneState::showUi";
--- a/homescreenapp/stateplugins/hshomescreenstateplugin/src/hsselectbackgroundstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,348 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  
-*
-*/
-
-#include <QAction>
-#include <QApplication>
-#include <QDir>
-#include <QFileInfo>
-
-#include <HbMainWindow>
-#include <HbProgressDialog>
-
-#include "hsselectbackgroundstate.h"
-#include "hsscene.h"
-#include "hsdomainmodeldatastructures.h"
-#include "hswallpaper.h"
-#include "hsdatabase.h"
-#include "hshomescreenstatecommon.h"
-#include "hsconfiguration.h"
-
-#ifdef Q_OS_SYMBIAN
-#include "hsimagefetcherclient.h"
-#else
-#include "xqaiwgetimageclient.h"
-#include "xqaiwcommon.h"
-#endif
-
-const char hsLocTextId_ProgressDialog_WallpaperLoading[] =
-            "txt_homescreen_dpopinfo_loading_wallpaper";
-
-/*! 
-    \class HsSelectBackgroundState
-    \ingroup group_hshomescreenstateprovider
-    \brief Implements imagefetcher event listening and handles those events.
-
-    \sa StateMachine
-*/
-
-/*!
-    Constructor.         
-    \a parent Owner.
-*/
-HsSelectBackgroundState::HsSelectBackgroundState(QState *parent):
-    QState(parent),
-    mImageFetcher(0),
-    mSourceView(0),
-    mPortraitWallpaperImageReader(0),
-    mLandscapeWallpaperImageReader(0),
-    mProgressDialog(0),
-    mRunningThreadAmount(0),
-    mShowAnimation(false)
-{
-#ifdef Q_OS_SYMBIAN
-    mImageFetcher = new HsImageFetcherClient(this);
-#else    
-    mImageFetcher = new XQAIWGetImageClient;
-#endif
-
-    connect(this, SIGNAL(entered()), SLOT(action_selectWallpaper()));
-    connect(this, SIGNAL(exited()), SLOT(action_disconnectImageFetcher()));
-    connect(this, SIGNAL(handleError()), SLOT(onHandleError()));
-}
-
-/*!
-    Destructor.
-    
-*/
-HsSelectBackgroundState::~HsSelectBackgroundState()
-{
-    delete mImageFetcher;
-    delete mPortraitWallpaperImageReader;
-    delete mLandscapeWallpaperImageReader;
-}
-
-/*!
-    \internal
-    Connects to image fetcher and launches "remote" ui from photos
-    from which user can select background image
-*/
-void HsSelectBackgroundState::action_selectWallpaper()
-{
-    mSourceView = HsScene::mainWindow()->currentView();
-
-    mRunningThreadAmount = 0;
-    mShowAnimation = false;
-
-#ifdef Q_OS_SYMBIAN
-    connect(mImageFetcher, SIGNAL(fetchCompleted(const QString&)),
-            this, SLOT(fetchCompleted(const QString&)));
-    connect(mImageFetcher, SIGNAL(fetchFailed(int, const QString&)),
-            this, SLOT(fetchFailed(int, const QString&)));
-    mImageFetcher->fetch();
-#else
-    connect(mImageFetcher, SIGNAL(fetchComplete(QStringList)),
-            SLOT(onFetchComplete(QStringList)));
-    connect(mImageFetcher, SIGNAL(fetchFailed(int)),
-            SLOT(onFetchFailed(int)));
-    mImageFetcher->fetch(QVariantMap(), SelectionSingle);
-#endif
-}
-
-/*!
-    \internal
-    disconnects photos image fetcher services slots.
-*/
-void HsSelectBackgroundState::action_disconnectImageFetcher()
-{
-    HsScene::mainWindow()->setCurrentView(mSourceView);
-    mImageFetcher->disconnect(this);
-}
-
-/*!
-    \internal
-    Called when user has selected an image 
-*/
-void HsSelectBackgroundState::onFetchComplete(QStringList imageStringList)
-{
-    // start animation immediately
-    onShowAnimation();
-
-    // check that sceneData is available
-    HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-    HsSceneData sceneData;
-    if (!db->scene(sceneData)) {
-        emit handleError();
-        return;
-    }
-
-    // clean thread instances
-    delete mPortraitWallpaperImageReader;
-    delete mLandscapeWallpaperImageReader;
-    mPortraitWallpaperImageReader = NULL;
-    mLandscapeWallpaperImageReader = NULL;
-
-    mPortraitWallpaperImageReader = new HsWallpaperImageReader();
-    mLandscapeWallpaperImageReader = new HsWallpaperImageReader();
-
-    mRunningThreadAmount = 2;
-
-    // delete old wallpapers
-    QFile::remove(sceneData.portraitWallpaper);
-    QFile::remove(sceneData.landscapeWallpaper);
-
-    QString wallpaperDir = HsWallpaper::wallpaperDirectory();            
-    QDir dir(wallpaperDir);
-    if (!dir.exists()) {
-        dir.mkpath(wallpaperDir);
-    }
-
-    // left empty to signal we want to use full size image as source
-    QRect sourceRect;
-
-    // Initialize portrait image threading
-    QRect targetRectPortrait(0, 0, (2 * 360) + HsConfiguration::bounceEffect(), 640);
-    mPortraitWallpaperImageReader->setSourcePath(imageStringList.first());
-    mPortraitWallpaperImageReader->setSourceRect(sourceRect);
-    mPortraitWallpaperImageReader->setTargetRect(targetRectPortrait);
-    mPortraitWallpaperImageReader->setCenterTarget(true);
-
-    connect(mPortraitWallpaperImageReader,
-            SIGNAL(finished()),
-            SLOT(onImageProcessed()));
-
-    // Initialize landscape image threading
-    QRect targetRectLandscape(0, 0, (2 * 640) + HsConfiguration::bounceEffect(), 360);
-    mLandscapeWallpaperImageReader->setSourcePath(imageStringList.first());
-    mLandscapeWallpaperImageReader->setSourceRect(sourceRect);
-    mLandscapeWallpaperImageReader->setTargetRect(targetRectLandscape);
-    mLandscapeWallpaperImageReader->setCenterTarget(true);
-
-    connect(mLandscapeWallpaperImageReader,
-            SIGNAL(finished()),
-            SLOT(onImageProcessed()));
-  
-    // start image processing in thread
-    mPortraitWallpaperImageReader->start();
-    mLandscapeWallpaperImageReader->start();
-}
-
-/*!
-    \internal
-    Called when selection of background image fails  
-*/
-void HsSelectBackgroundState::onFetchFailed(int error)
-{
-    Q_UNUSED(error)
-    emit handleError();
-}
-
-/*!
-    \internal
-    Called when image processing is finished in thread  
-*/
-void HsSelectBackgroundState::onImageProcessed()
-{
-    mRunningThreadAmount--;
-
-    HsDatabase *db = HsDatabase::instance();
-    Q_ASSERT(db);
-    HsSceneData sceneData;
-    if (!db->scene(sceneData)) {
-        emit handleError();
-        return;
-    }
-
-    QFileInfo fileInfo;
-    // get image path
-    if (sender() == mPortraitWallpaperImageReader) {
-        fileInfo = mPortraitWallpaperImageReader->sourcePath();
-    } else {
-        fileInfo = mLandscapeWallpaperImageReader->sourcePath();
-    }
-    // suffix is same for both orientations
-    QString fileExtension("");
-    if (!fileInfo.suffix().isEmpty()) {
-        fileExtension = fileInfo.suffix();
-    }
-
-    QImage image;
-    // set portrait image path to sceneData
-    QString portraitPath(HsWallpaper::wallpaperPath(Qt::Vertical, QString(),
-                                                    fileExtension));
-    // we need to set this always as image to be activated can be either orientation
-    sceneData.portraitWallpaper = portraitPath;
-    QString landscapePath(HsWallpaper::wallpaperPath(Qt::Horizontal, QString(),
-                                                     fileExtension));
-    sceneData.landscapeWallpaper = landscapePath;
-
-    if (sender() == mPortraitWallpaperImageReader) {
-        // get image from thread
-        image = mPortraitWallpaperImageReader->processedImage();
-        // save image
-        image.save(portraitPath);
-    } else {
-        image = mLandscapeWallpaperImageReader->processedImage();
-        image.save(landscapePath);
-    }
-
-    if (image.isNull()) {
-        emit handleError();
-        return;
-    }
-    // update scenedata and set new image to background
-    if (db->updateScene(sceneData)) {
-        HsScene *scene = HsScene::instance();
-        // set image to wallpaper (don't activate yet)
-        if (sender() == mPortraitWallpaperImageReader) {
-            scene->wallpaper()->setPortraitImage(portraitPath, false);
-        } else {
-            scene->wallpaper()->setLandscapeImage(landscapePath, false);
-        }
-        // if last thread running
-        if (mRunningThreadAmount == 0) {
-            // if current orientation matches -> set to active wallpaper
-            if (HsScene::orientation() == Qt::Vertical) {
-                scene->wallpaper()->setPortraitImage(portraitPath, true);
-            } else {
-                scene->wallpaper()->setLandscapeImage(landscapePath, true);
-            }
-            // finish progress bar
-            if (mShowAnimation) {
-                mProgressDialog->setProgressValue(3);
-            }
-            // let user control again homescreen
-            emit event_waitInput();
-        } else {
-            // update progress information
-            if (mShowAnimation) {
-                mProgressDialog->setProgressValue(2);
-            }
-        }
-    }     
-}
-
-/*!
-    \internal
-    Shows animation for longer processing
-*/
-void HsSelectBackgroundState::onShowAnimation()
-{
-    delete mProgressDialog;
-    mProgressDialog = new HbProgressDialog(HbProgressDialog::ProgressDialog);
-    /* TODO: workaround to remove cancel button (setPrimaryAction(0) is deprecated).
-     * clearActions does the same but crashes, fix should be in wk16, check orbit list
-     */
-    QList<QAction*> actions = mProgressDialog->actions();
-    actions[0]->setVisible(false);
-    mProgressDialog->setIcon(HbIcon("note_info"));
-    mProgressDialog->setText(hbTrId(hsLocTextId_ProgressDialog_WallpaperLoading));
-    mProgressDialog->setMinimum(0);
-    mProgressDialog->setMaximum(3);
-    mProgressDialog->setBackgroundFaded(true);
-    mProgressDialog->setAutoClose(true);
-    // set initial value to appear as loading
-    mProgressDialog->setProgressValue(1);
-    mProgressDialog->show();
-    mShowAnimation = true;
-}
-
-/*!
-    \internal
-    Called when error occurs during image processing  
-*/
-void HsSelectBackgroundState::onHandleError()
-{
-    if (mShowAnimation) {
-        mProgressDialog->close();
-    }
-    emit event_waitInput();
-}
-
-/*!
-    \internal
-    Called when user has selected an image on emulator or HW
-*/
-#ifdef Q_OS_SYMBIAN
-void HsSelectBackgroundState::fetchCompleted(const QString& imageFileName)
-{
-    QStringList imageFileNameAsList(imageFileName);
-    onFetchComplete(imageFileNameAsList);
-}
-#endif
-
-/*!
-    \internal
-    Called when selection of background image fails on emulator or HW
-*/
-#ifdef Q_OS_SYMBIAN
-void HsSelectBackgroundState::fetchFailed(int error, const QString& errorString)
-{
-    Q_UNUSED(errorString)
-    onFetchFailed(error);        
-}
-#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/src/hswallpaperselectionstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,216 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "hswallpaperselectionstate.h"
+#include "hsspinnerdialog.h"
+#include "hsscene.h"
+#include "hspage.h"
+#include "hswallpaper.h"
+#include "hsconfiguration.h"
+
+#ifdef Q_OS_SYMBIAN
+#include "hsimagefetcherclient.h"
+#else
+#include "xqaiwgetimageclient.h"
+#endif
+
+// Helper macros for connecting state entry and exit actions.
+#define ENTRY_ACTION(state, action) \
+    connect(state, SIGNAL(entered()), SLOT(action()));
+#define EXIT_ACTION(state, action) \
+    connect(state, SIGNAL(exited()), SLOT(action()));
+
+/*!
+    \class HsWallpaperSelectionState
+    \ingroup group_hshomescreenstateplugin
+    \brief 
+*/
+
+/*!
+
+*/
+HsWallpaperSelectionState::HsWallpaperSelectionState(QState *parent)
+  : QState(parent),    
+    mImageFetcher(0),
+    mWallpaper(0),    
+    mWaitDialog(0)
+{
+    setupStates();
+}
+
+/*!
+
+*/
+HsWallpaperSelectionState::~HsWallpaperSelectionState()
+{
+
+}
+
+/*!
+
+*/
+void HsWallpaperSelectionState::setupStates()
+{
+    // States
+    
+    QState *state_processing = new QState(this);
+    QState *state_selectingImage = new QState(state_processing);
+    QState *state_assigningImage = new QState(state_processing);
+    QState *state_errorMessage = new QState(this);
+    
+    setInitialState(state_processing);
+    state_processing->setInitialState(state_selectingImage);
+    
+    // Transitions
+
+    state_selectingImage->addTransition(
+        this, SIGNAL(event_assignImage()), state_assigningImage);
+    
+    state_processing->addTransition(
+        this, SIGNAL(event_error()), state_errorMessage);
+
+    // Actions
+
+    ENTRY_ACTION(state_selectingImage, action_selectingImage_start)
+    EXIT_ACTION(state_selectingImage, action_selectingImage_cleanup)
+
+    ENTRY_ACTION(state_assigningImage, action_assigningImage_showWaitDialog)
+    ENTRY_ACTION(state_assigningImage, action_assigningImage_start)
+    EXIT_ACTION(state_assigningImage, action_assigningImage_cleanup)
+    EXIT_ACTION(state_assigningImage, action_assigningImage_hideWaitDialog)
+
+    ENTRY_ACTION(state_errorMessage, action_errorMessage_show)
+}
+
+/*!
+
+*/
+void HsWallpaperSelectionState::action_selectingImage_start()
+{
+#ifdef Q_OS_SYMBIAN
+    mImageFetcher = new HsImageFetcherClient;
+#else    
+    mImageFetcher = new XQAIWGetImageClient;
+#endif
+
+    connect(mImageFetcher, SIGNAL(fetchCompleted(const QString&)),
+            this, SLOT(onFetchCompleted(const QString&)));
+    connect(mImageFetcher, SIGNAL(fetchFailed(int, const QString&)),
+            this, SLOT(onFetchFailed(int, const QString&)));
+
+    mImageFetcher->fetch();
+}
+ 
+/*!
+
+*/
+void HsWallpaperSelectionState::action_selectingImage_cleanup()
+{
+    mImageFetcher->disconnect(this);
+    mImageFetcher->deleteLater();
+    mImageFetcher = 0;
+}
+
+/*!
+
+*/
+void HsWallpaperSelectionState::action_assigningImage_showWaitDialog()
+{
+    mWaitDialog = new HsSpinnerDialog;
+    mWaitDialog->start();
+}
+  
+/*!
+
+*/
+void HsWallpaperSelectionState::action_assigningImage_start()
+{
+    HsScene *scene = HsScene::instance();
+
+    if (HSCONFIGURATION_GET(sceneType) == HsConfiguration::SceneWallpaper) {
+        mWallpaper = scene->wallpaper();
+    } else {
+        mWallpaper = scene->activePage()->wallpaper();
+    }
+
+    connect(mWallpaper, SIGNAL(imageSet()), SLOT(onImageSet()));
+    connect(mWallpaper, SIGNAL(imageSetFailed()), SLOT(onImageSetFailed()));
+    
+    mWallpaper->setImage(mImagePath);
+}
+ 
+/*!
+
+*/
+void HsWallpaperSelectionState::action_assigningImage_cleanup()
+{
+    mWallpaper->disconnect(this);
+    mWallpaper = 0;
+}
+
+/*!
+
+*/
+void HsWallpaperSelectionState::action_assigningImage_hideWaitDialog()
+{
+    mWaitDialog->stop();
+    mWaitDialog = 0;
+}
+
+/*!
+
+*/
+void HsWallpaperSelectionState::action_errorMessage_show()
+{
+    // TODO: Waiting for UX decision.
+    emit event_waitInput();
+}
+
+/*!
+
+*/
+void HsWallpaperSelectionState::onFetchCompleted(const QString &imagePath)
+{
+    mImagePath = imagePath;
+    emit event_assignImage();
+}
+ 
+/*!
+
+*/
+void HsWallpaperSelectionState::onFetchFailed(int errorCode, const QString &errorMessage)
+{
+    Q_UNUSED(errorCode)
+    Q_UNUSED(errorMessage)
+    emit event_error();
+}
+
+/*!
+
+*/
+void HsWallpaperSelectionState::onImageSet()
+{
+    emit event_waitInput();
+}
+ 
+/*!
+
+*/
+void HsWallpaperSelectionState::onImageSetFailed()
+{
+    emit event_error();
+}
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.qrc	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/hsmenuworkerstateplugin.qrc	Wed Jun 23 18:03:36 2010 +0300
@@ -4,5 +4,6 @@
         <file alias="hswidgetpreviewdialog.docml">resource/hswidgetpreviewdialog.docml</file>
         <file alias="hsarrangedialog.docml">resource/hsarrangedialog.docml</file>
         <file alias="hsdetailsdialog.docml">resource/hsdetailsdialog.docml</file>
+        <file alias="hsuninstalldialog.docml">resource/hsuninstalldialog.docml</file>
     </qresource>
 </RCC>
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsaddtohomescreenstate.h	Wed Jun 23 18:03:36 2010 +0300
@@ -19,7 +19,7 @@
 #ifndef HSADDSHORTCUTSTATE_H
 #define HSADDSHORTCUTSTATE_H
 
-#include <hsmenubasestate.h>
+#include <QState>
 
 #include "hsmenustates_global.h"
 #include "hsapp_defs.h"
@@ -30,8 +30,9 @@
 class HbMessageBox;
 class CaEntry;
 class CaNotifier;
+class HsContentService;
 
-class HsAddToHomeScreenState: public  HsMenuBaseState
+class HsAddToHomeScreenState: public  QState
 {
     Q_OBJECT
 
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsdeletecollectionstate.h	Wed Jun 23 18:03:36 2010 +0300
@@ -25,7 +25,6 @@
 
 class HbAction;
 class HbMessageBox;
-class HsShortcutService;
 class HsMenuService;
 
 class HsDeleteCollectionState: public QState
@@ -58,8 +57,6 @@
 
     void construct();
 
-    HsShortcutService *shortcutService() const;
-
 private:
     int mItemId;
     HbMessageBox *mDeleteMessage; // deletes itself automatically on close
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsmenubasestate.h	Fri Jun 11 13:30:16 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description: Menu Base state
- *
- */
-
-#ifndef HSMENUBASESTATE_H
-#define HSMENUBASESTATE_H
-
-#include <qstate.h>
-#include <QVariant>
-
-#include "hsmenustates_global.h"
-HS_STATES_TEST_CLASS(MenuStatesTest)
-
-class HsShortcutService;
-class HsContentService;
-
-class HsMenuBaseState: public QState
-{
-    Q_OBJECT
-
-    HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
-
-public:
-
-    HsMenuBaseState(const QString &objectName, QState *parent = 0);
-
-    virtual ~HsMenuBaseState();
-
-protected:
-
-    void construct(const QString &objectName);
-
-    void requestServices(const QVariantList &services);
-
-    void requestService(const QVariant &service);
-
-    HsShortcutService *shortcutService() const;
-
-    HsContentService *contentService() const;
-
-private:
-
-    QVariant propertyWithChecking(const char *propertyName) const;
-
-
-};
-
-#endif //HSMENUBASESTATE_H
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsmenustates_global.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsmenustates_global.h	Wed Jun 23 18:03:36 2010 +0300
@@ -38,7 +38,9 @@
 static const char *const HS_WIDGET_PREVIEW_DIALOG_LAYOUT =
     ":/xml/hswidgetpreviewdialog.docml";
 static const char *const HS_WIDGET_PREVIEW_DIALOG_NAME="preview_dialog";
-static const char *const HS_WIDGET_PREVIEW_SCROLL_AREA_NAME="preview_scroll_area";
+static const char *const HS_WIDGET_PREVIEW_LABEL_NAME="label";
+static const char *const HS_WIDGET_PREVIEW_ICON_BOX_NAME="icon_box";
+static const char *const HS_PREVIEW_ATTRIBUTE_NAME="preview_image_name";
 
 static const char *const HS_ARRANGE_DIALOG_LAYOUT =
     ":/xml/hsarrangedialog.docml";
@@ -48,6 +50,17 @@
 static const char *const HS_DETAILS_DIALOG_LAYOUT =
     ":/xml/hsdetailsdialog.docml";
 static const char *const HS_DETAILS_DIALOG_NAME="details_dialog";
+
+static const char *const HS_UNINSTALL_DIALOG_LAYOUT =
+    ":/xml/hsuninstalldialog.docml";
+static const char *const HS_UNINSTALL_DIALOG_NAME ="uninstall_dialog";
+static const char *const HS_UNINSTALL_DIALOG_DELETE_LABEL ="delete_message_label";
+static const char *const HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_LABEL ="confirmation_dialog_label";
+static const char *const HS_UNINSTALL_DIALOG_LIST_VIEW_LABEL ="list_view_label";
+static const char *const HS_UNINSTALL_DIALOG_CONFIRMATION_ACTION ="qtl_dialog_softkey_2_left";
+static const char *const HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_ICON ="icon";
+
+
 /*!
  To enable logging of function entry and exit use the following flag for qmake:
  -config nft
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hspreviewhswidgetstate.h	Wed Jun 23 18:03:36 2010 +0300
@@ -19,11 +19,12 @@
 #ifndef HSPREVIEWHSWIDGETSTATE_H
 #define HSPREVIEWHSWIDGETSTATE_H
 
-#include <hsmenubasestate.h>
+#include <QState>
 
 #include "hsmenustates_global.h"
 HS_STATES_TEST_CLASS(MenuStatesTest)
 
+class CaEntry;
 class HbDialog;
 class HsWidgetHost;
 class CaNotifier;
@@ -31,7 +32,7 @@
 class HbScrollArea;
 class HbMessageBox;
 
-class HsPreviewHSWidgetState : public HsMenuBaseState
+class HsPreviewHSWidgetState : public QState
 {
     Q_OBJECT
 
@@ -61,23 +62,20 @@
     void showMessageWidgetCorrupted();
 
     void subscribeForMemoryCardRemove();
+    
+    HbDialog* buildPreviewDialog(const CaEntry& entry) const;
 
 private:
     
-    HbDialog *mPopupDialog;
+    HbDialog *mPreviewDialog;
 
     CaNotifier *mNotifier;
 
-    HbScrollArea *mScrollArea;
-
-    HsWidgetHost *mWidget;
-
-    QObjectList mObjectList;
+    QScopedPointer<HsWidgetHost> mWidget;
 
     int mEntryId;
 
     HbMessageBox *mCorruptedMessage;
-    
 };
 
 
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsuninstallitemstate.h	Wed Jun 23 18:03:36 2010 +0300
@@ -27,6 +27,8 @@
 class HbMessageBox;
 class HsShortcutService;
 class HsMenuService;
+class HbDialog;
+class CaNotifier;
 
 class HsUninstallItemState: public QState
 {
@@ -35,6 +37,12 @@
     HS_STATES_TEST_FRIEND_CLASS(MenuStatesTest)
 
 public:
+    enum UninstallDialogType {
+        UninstallDialogDefinition01 = 1,
+        UninstallDialogDefinition02,
+        UninstallDialogDefinition03,
+        UninstallDialogDefinition04
+    };
 
     HsUninstallItemState(QState *parent = 0);
 
@@ -57,14 +65,25 @@
 private:
 
     void construct();
-
-    HsShortcutService *shortcutService() const;
+    
+    bool getApplicationsNames(QString &componentName,
+        QStringList &applicationsNames,
+        QString &confirmationMessage);
+    
+    void createUninstallMessage();
+    void createUninstallJavaMessage();
+    void subscribeForMemoryCardRemove();
 
 private:
 
     int mItemId;
+    
+    CaNotifier *mNotifier;
 
     HbMessageBox *mUninstallMessage; // deletes itself automatically on close
+    HbDialog *mUninstallJavaMessage;
+    QObjectList mObjectList;
+    UninstallDialogType mDialogType;
 
     HbAction *mConfirmAction; // child for mConfirmMessage
 
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/inc/hsviewappdetailsstate.h	Wed Jun 23 18:03:36 2010 +0300
@@ -49,7 +49,6 @@
 private slots:
 
     void stateExited();
-    void memoryCardRemoved();
     
 signals:
     void exit();    
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsdetailsdialog.docml	Wed Jun 23 18:03:36 2010 +0300
@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
+<hbdocument version="1.1">
     <object name="qtl_dialog_softkey_left" type="HbAction">
         <string name="role" value="HbDialog:primaryAction"/>
-        <string name="role" value="HbDialog:primaryAction"/>
-        <string locid="txt_common_button_ok" name="text"/>
+        <string locid="txt_common_button_ok" name="text" value="Ok"/>
     </object>
     <widget name="details_dialog" type="HbDialog">
+        <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
         <widget name="qtl_dialog_pri_heading" role="HbDialog:headingWidget" type="HbLabel">
             <enums name="alignment" value="AlignLeft|AlignLeading"/>
             <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
-            <string locid="txt_applib_title_details" name="plainText"/>
+            <string locid="txt_applib_title_details" name="plainText" value="Details"/>
             <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
             <string name="dismissPolicy" value="HbPopup::NoDismiss"/>
         </widget>
@@ -17,7 +17,7 @@
             <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
                 <widget name="_name" type="HbLabel">
                     <sizehint height="expr(var(hb-param-text-height-secondary))" type="PREFERRED"/>
-                    <string name="plainText" value="txt_applib_dialog_name"/>
+                    <string locid="txt_applib_dialog_name" name="plainText" value="Name:"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
                 </widget>
                 <widget name="name" type="HbLabel">
@@ -26,7 +26,7 @@
                 </widget>
                 <widget name="_version" type="HbLabel">
                     <sizehint height="expr(var(hb-param-text-height-secondary))" type="PREFERRED"/>
-                    <string name="plainText" value="txt_applib_dialog_version"/>
+                    <string locid="txt_applib_dialog_version" name="plainText" value="Version:"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
                 </widget>
                 <widget name="version" type="HbLabel">
@@ -35,7 +35,7 @@
                 </widget>
                 <widget name="_vendor" type="HbLabel">
                     <sizehint height="expr(var(hb-param-text-height-secondary))" type="PREFERRED"/>
-                    <string name="plainText" value="txt_applib_dialog_supplier"/>
+                    <string locid="txt_applib_dialog_supplier" name="plainText" value="Supplier:"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
                 </widget>
                 <widget name="vendor" type="HbLabel">
@@ -44,25 +44,27 @@
                 </widget>
                 <widget name="_driveInfo" type="HbLabel">
                     <sizehint height="expr(var(hb-param-text-height-secondary))" type="PREFERRED"/>
-                    <string name="plainText" value="txt_applib_dialog_memory_in_use"/>
+                    <string locid="txt_applib_dialog_memory_in_use" name="plainText" value="Memory in use:"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
                 </widget>
                 <widget name="driveInfo" type="HbLabel">
                     <sizehint height="expr(var(hb-param-text-height-secondary))" type="PREFERRED"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                    <string locid="txt_applib_dialog_1_device_memory" name="plainText" value="%1 Device memory"/>
                 </widget>
                 <widget name="_size" type="HbLabel">
                     <sizehint height="expr(var(hb-param-text-height-secondary))" type="PREFERRED"/>
-                    <string name="plainText" value="txt_applib_dialog_size"/>
+                    <string locid="txt_applib_dialog_size" name="plainText" value="Size:"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
                 </widget>
                 <widget name="size" type="HbLabel">
                     <sizehint height="expr(var(hb-param-text-height-secondary))" type="PREFERRED"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                    <string locid="txt_applib_dialog_l1_kb" name="plainText" value="%L1 KB"/>
                 </widget>
                 <widget name="_type" type="HbLabel">
                     <sizehint height="expr(var(hb-param-text-height-secondary))" type="PREFERRED"/>
-                    <string name="plainText" value="txt_applib_dialog_format"/>
+                    <string locid="txt_applib_dialog_format" name="plainText" value="Format:"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
                 </widget>
                 <widget name="type" type="HbLabel">
@@ -86,10 +88,9 @@
                 </layout>
             </widget>
         </widget>
-        <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
-        <ref object="qtl_dialog_softkey_left" role="HbDialog:primaryAction"/>
+        <ref object="qtl_dialog_softkey_left" role="HbWidget:addAction"/>
     </widget>
-    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
         <uistate name="Common ui state" sections="#common"/>
     </metadata>
 </hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hsuninstalldialog.docml	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+    <object name="qtl_dialog_softkey_2_left" type="HbAction">
+        <string name="role" value="HbDialog:primaryAction"/>
+		<string locid="txt_common_button_ok" name="text"/>
+    </object>
+    <object name="qtl_dialog_softkey_2_right" type="HbAction">
+        <string name="role" value="HbDialog:secondaryAction"/>
+        <string locid="txt_common_button_cancel" name="text"/>
+    </object>
+    <widget name="uninstall_dialog" type="HbDialog">
+        <sizehint height="55un" type="PREFERRED" width="49.73un"/>
+        <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
+        <enums name="dismissPolicy" value="NoDismiss"/>
+        <widget name="confirmation_dialog_label_large_graphic" role="HbDialog:contentWidget" type="HbScrollArea">
+            <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
+                <widget name="common_confirmation" type="HbWidget">
+                    <widget name="icon" type="HbLabel">
+                        <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                        <icon iconName="qtg_large_info" name="icon"/>
+                        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                        <sizehint height="var(hb-param-graphic-size-primary-large)" type="FIXED" width="var(hb-param-graphic-size-primary-large)"/>
+                        <bool name="visible" value="TRUE"/>
+                    </widget>
+                    <widget name="confirmation_dialog_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="TRUE"/>
+                        <string name="plainText" value="txt_applib_info_remove_1_all_its_shortcuts_and"/>
+                        <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
+                    </widget>
+                    <real name="z" value="0"/>
+                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                    <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                        <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                        <linearitem itemname="icon"/>
+                        <linearitem itemname="confirmation_dialog_label"/>
+                    </layout>
+                </widget>
+                <widget name="list_label" type="HbLabel">
+                    <enums name="textWrapping" value="TextWordWrap"/>
+                    <bool name="visible" value="TRUE"/>
+                    <string name="plainText" value=" txt_applib_info_following_applications_will_be_rem"/>
+                </widget>
+                <widget name="delete_message_label" type="HbLabel">
+                    <enums name="textWrapping" value="TextWordWrap"/>
+                    <bool name="visible" value="TRUE"/>
+                    <string name="plainText" value="Delete message details"/>
+                </widget>
+                <widget name="list_view_label" type="HbLabel">
+                    <bool name="visible" value="TRUE"/>
+                    <string name="plainText" value=""/>
+                </widget>
+                <layout orientation="Vertical" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                    <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                    <linearitem itemname="common_confirmation"/>
+                    <linearitem itemname="list_label"/>
+                    <linearitem itemname="list_view_label"/>
+                    <linearitem itemname="delete_message_label"/>
+                </layout>
+            </widget>
+        </widget>
+        <ref object="qtl_dialog_softkey_2_left" role="HbWidget:addAction"/>
+        <ref object="qtl_dialog_softkey_2_right" role="HbWidget:addAction"/>
+    </widget>
+    <section name="uninstallDialogDefinition01">
+        <widget name="uninstall_dialog" type="HbDialog">
+            <widget name="confirmation_dialog_label_large_graphic" role="HbDialog:contentWidget" type="HbScrollArea">
+                <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
+                    <widget name="common_confirmation" type="HbWidget">
+                        <widget name="icon" type="HbLabel">
+                            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                            <icon iconName="qtg_large_info" name="icon"/>
+                            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                            <sizehint height="var(hb-param-graphic-size-primary-large)" type="FIXED" width="var(hb-param-graphic-size-primary-large)"/>
+                            <bool name="visible" value="TRUE"/>
+                        </widget>
+                        <widget name="confirmation_dialog_label" type="HbLabel">
+                            <enums name="textWrapping" value="TextWordWrap"/>
+                            <bool name="visible" value="TRUE"/>
+                            <string name="plainText" value="txt_applib_info_remove_1_all_its_shortcuts_and"/>
+                            <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
+                        </widget>
+                        <real name="z" value="0"/>
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                        <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                            <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                            <linearitem itemname="icon"/>
+                            <linearitem itemname="confirmation_dialog_label"/>
+                        </layout>
+                    </widget>
+                    <widget name="list_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="FALSE"/>
+                        <string name="plainText" value=" txt_applib_info_following_applications_will_be_rem"/>
+                    </widget>
+                    <widget name="delete_message_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="FALSE"/>
+                        <string name="plainText" value="Delete message details"/>
+                    </widget>
+                    <widget name="list_view_label" type="HbLabel">
+                        <bool name="visible" value="FALSE"/>
+                        <string name="plainText" value=""/>
+                    </widget>
+                    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                        <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                        <linearitem itemname="common_confirmation"/>
+                    </layout>
+                </widget>
+            </widget>
+            <sizehint height="50un" type="PREFERRED" width="49.73un"/>
+            <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
+            <ref object="qtl_dialog_softkey_2_left" role="HbWidget:addAction"/>
+            <ref object="qtl_dialog_softkey_2_right" role="HbWidget:addAction"/>
+        </widget>
+    </section>
+    <section name="uninstallDialogDefinition02">
+        <widget name="uninstall_dialog" type="HbDialog">
+            <widget name="confirmation_dialog_label_large_graphic" role="HbDialog:contentWidget" type="HbScrollArea">
+                <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
+                    <widget name="common_confirmation" type="HbWidget">
+                        <widget name="icon" type="HbLabel">
+                            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                            <icon iconName="qtg_large_info" name="icon"/>
+                            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                            <sizehint height="var(hb-param-graphic-size-primary-large)" type="FIXED" width="var(hb-param-graphic-size-primary-large)"/>
+                            <bool name="visible" value="TRUE"/>
+                        </widget>
+                        <widget name="confirmation_dialog_label" type="HbLabel">
+                            <enums name="textWrapping" value="TextWordWrap"/>
+                            <bool name="visible" value="TRUE"/>
+                            <string name="plainText" value="txt_applib_info_remove_1_all_its_shortcuts_and"/>
+                            <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
+                        </widget>
+                        <real name="z" value="0"/>
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                        <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                            <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                            <linearitem itemname="icon"/>
+                            <linearitem itemname="confirmation_dialog_label"/>
+                        </layout>
+                    </widget>
+                    <widget name="list_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="TRUE"/>
+                        <string name="plainText" value=" txt_applib_info_following_applications_will_be_rem"/>
+                    </widget>
+                    <widget name="delete_message_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="TRUE"/>
+                        <string name="plainText" value="Delete message details"/>
+                    </widget>
+                    <widget name="list_view_label" type="HbLabel">
+                        <bool name="visible" value="TRUE"/>
+                        <string name="plainText" value=""/>
+                    </widget>
+                    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                        <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                        <linearitem itemname="common_confirmation"/>
+                        <linearitem itemname="list_label"/>
+                        <linearitem itemname="list_view_label"/>
+                        <linearitem itemname="delete_message_label"/>
+                    </layout>
+                </widget>
+            </widget>
+            <sizehint height="50un" type="PREFERRED" width="49.73un"/>
+            <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
+            <ref object="qtl_dialog_softkey_2_left" role="HbWidget:addAction"/>
+            <ref object="qtl_dialog_softkey_2_right" role="HbWidget:addAction"/>
+        </widget>
+    </section>
+    <section name="uninstallDialogDefinition03">
+        <widget name="uninstall_dialog" type="HbDialog">
+            <widget name="confirmation_dialog_label_large_graphic" role="HbDialog:contentWidget" type="HbScrollArea">
+                <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
+                    <widget name="common_confirmation" type="HbWidget">
+                        <widget name="icon" type="HbLabel">
+                            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                            <icon iconName="qtg_large_info" name="icon"/>
+                            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                            <sizehint height="var(hb-param-graphic-size-primary-large)" type="FIXED" width="var(hb-param-graphic-size-primary-large)"/>
+                            <bool name="visible" value="TRUE"/>
+                        </widget>
+                        <widget name="confirmation_dialog_label" type="HbLabel">
+                            <enums name="textWrapping" value="TextWordWrap"/>
+                            <bool name="visible" value="TRUE"/>
+                            <string name="plainText" value="txt_applib_info_remove_1_all_its_shortcuts_and"/>
+                            <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
+                        </widget>
+                        <real name="z" value="0"/>
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                        <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                            <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                            <linearitem itemname="icon"/>
+                            <linearitem itemname="confirmation_dialog_label"/>
+                        </layout>
+                    </widget>
+                    <widget name="list_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="TRUE"/>
+                        <string name="plainText" value=" txt_applib_info_following_applications_will_be_rem"/>
+                    </widget>
+                    <widget name="list_view_label" type="HbLabel">
+                        <bool name="visible" value="TRUE"/>
+                        <string name="plainText" value=""/>
+                    </widget>
+                    <widget name="delete_message_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="FALSE"/>
+                        <string name="plainText" value="Delete message details"/>
+                    </widget>
+                    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                        <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                        <linearitem itemname="common_confirmation"/>
+                        <linearitem itemname="list_label"/>
+                        <linearitem itemname="list_view_label"/>
+                    </layout>
+                </widget>
+            </widget>
+            <sizehint height="50un" type="PREFERRED" width="49.73un"/>
+            <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
+            <ref object="qtl_dialog_softkey_2_left" role="HbWidget:addAction"/>
+            <ref object="qtl_dialog_softkey_2_right" role="HbWidget:addAction"/>
+        </widget>
+    </section>
+    <section name="uninstallDialogDefinition04">
+        <widget name="uninstall_dialog" type="HbDialog">
+            <widget name="confirmation_dialog_label_large_graphic" role="HbDialog:contentWidget" type="HbScrollArea">
+                <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
+                    <widget name="common_confirmation" type="HbWidget">
+                        <widget name="icon" type="HbLabel">
+                            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                            <icon iconName="qtg_large_info" name="icon"/>
+                            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                            <sizehint height="var(hb-param-graphic-size-primary-large)" type="FIXED" width="var(hb-param-graphic-size-primary-large)"/>
+                            <bool name="visible" value="TRUE"/>
+                        </widget>
+                        <widget name="confirmation_dialog_label" type="HbLabel">
+                            <enums name="textWrapping" value="TextWordWrap"/>
+                            <bool name="visible" value="TRUE"/>
+                            <string name="plainText" value="txt_applib_info_remove_1_all_its_shortcuts_and"/>
+                            <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
+                        </widget>
+                        <real name="z" value="0"/>
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                        <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                            <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                            <linearitem itemname="icon"/>
+                            <linearitem itemname="confirmation_dialog_label"/>
+                        </layout>
+                    </widget>
+                    <widget name="list_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="FALSE"/>
+                        <string name="plainText" value=" txt_applib_info_following_applications_will_be_rem"/>
+                    </widget>
+                    <widget name="delete_message_label" type="HbLabel">
+                        <enums name="textWrapping" value="TextWordWrap"/>
+                        <bool name="visible" value="TRUE"/>
+                        <string name="plainText" value="Delete message details"/>
+                    </widget>
+                    <widget name="list_view_label" type="HbLabel">
+                        <bool name="visible" value="FALSE"/>
+                        <string name="plainText" value=""/>
+                    </widget>
+                    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-popup)" type="linear">
+                        <contentsmargins bottom="var(hb-param-margin-gene-popup)" left="var(hb-param-margin-gene-popup)" right="var(hb-param-margin-gene-popup)" top="var(hb-param-margin-gene-popup)"/>
+                        <linearitem itemname="common_confirmation"/>
+                        <linearitem itemname="delete_message_label"/>
+                    </layout>
+                </widget>
+            </widget>
+            <sizehint height="50un" type="PREFERRED" width="49.73un"/>
+            <contentsmargins bottom="var(hb-param-margin-view-bottom)" left="var(hb-param-margin-view-left)" right="var(hb-param-margin-view-right)" top="var(hb-param-margin-view-top)"/>
+            <ref object="qtl_dialog_softkey_2_left" role="HbWidget:addAction"/>
+            <ref object="qtl_dialog_softkey_2_right" role="HbWidget:addAction"/>
+        </widget>
+    </section>
+    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <uistate name="Variant1" sections="#common uninstallDialogDefinition01"/>
+        <uistate name="Variant2" sections="#common uninstallDialogDefinition02"/>
+        <uistate name="Variant3" sections="#common uninstallDialogDefinition03"/>
+        <uistate name="Variant4" sections="#common uninstallDialogDefinition04"/>
+    </metadata>
+</hbdocument>
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hswidgetpreviewdialog.docml	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/resource/hswidgetpreviewdialog.docml	Wed Jun 23 18:03:36 2010 +0300
@@ -1,32 +1,37 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="0.9">
+<hbdocument version="1.1">
     <object name="add_to_homescreen" type="HbAction">
-        <string name="role" value="HbDialog:primaryAction"/>
         <string locid="txt_applib_button_add_to_homescreen" name="text"/>
     </object>
     <object name="close" type="HbAction">
-        <string name="role" value="HbDialog:secondaryAction"/>
         <string locid="txt_common_button_close" name="text"/>
     </object>
     <widget name="preview_dialog" type="HbDialog">
-        <enums name="dismissPolicy" value="HbPopup::NoDismiss"/>
-        <ref object="add_to_homescreen" role="HbDialog:primaryAction"/>
-        <ref object="close" role="HbDialog:secondaryAction"/>
+        <enums name="dismissPolicy" value="NoDismiss"/>
+        <widget name="label" role="HbDialog:headingWidget" type="HbLabel"/>
+        <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
+            <widget name="icon_box" type="HbLabel">
+                <enums name="alignment" value="AlignHCenter|AlignTop"/>
+                <enums name="aspectRatioMode" value="KeepAspectRatio"/>
+                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+                <sizehint height="32un" type="PREFERRED"/>
+                <sizehint height="var(hb-param-text-height-secondary)" type="MINIMUM" width="32un"/>
+                <contentsmargins bottom="0un" left="0un" right="0un" top="expr(var(hb-param-margin-gene-popup) )"/>
+                <sizehint type="MAXIMUM" width="32un"/>
+                <string locid="txt_applib_info_no_preview_available" name="plainText"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+            </widget>
+            <real name="z" value="0"/>
+            <layout orientation="Horizontal" type="linear">
+                <stretchitem stretchfactor="1"/>
+                <linearitem itemname="icon_box"/>
+                <stretchitem stretchfactor="1"/>
+            </layout>
+        </widget>
+        <ref object="add_to_homescreen" role="HbWidget:addAction"/>
+        <ref object="close" role="HbWidget:addAction"/>
     </widget>
-    <widget name="container" role="HbDialog:contentWidget" type="HbWidget">
-        <widget name="preview_scroll_area" type="HbScrollArea">
-            <enums name="scrollingStyle" value="Pan"/>
-            <enums name="alignment" value="Qt:AlignCenter"/>
-            <enums name="verticalScrollBarPolicy" value="ScrollBarAutoHide"/>
-            <enums name="horizontalScrollBarPolicy" value="ScrollBarAutoHide"/>
-            <enums name="scrollDirections" value="Qt::Horizontal|Qt::Vertical"/>
-            <enums name="clampingStyle" value="StrictClamping"/>
-        </widget>
-        <layout orientation="Vertical" type="linear">
-            <linearitem itemname="preview_scroll_area"/>
-        </layout>
-    </widget>
-    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
         <uistate name="Common ui state" sections="#common"/>
     </metadata>
 </hbdocument>
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddappstocollectionstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -172,7 +172,7 @@
 /*!
  Constructor.
  \return \a true on success, \a false otherwise.
- \param parent Owner.
+ \param parent Parent state.
  */
 HsAddAppsToCollectionState::HsAddAppsToCollectionState(QState *parent) :
     QState(parent), mCollectionName(), mCollectionId(0), mAppList(),
@@ -395,9 +395,6 @@
 /*!
  Slot invoked when new collection state is entered..
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsAddAppsToCollectionState::newCollection()
 {
     qDebug("HsAddAppsToCollectionState::newCollection");
@@ -407,9 +404,6 @@
 
     HSMENUTEST_FUNC_EXIT("HsAddAppsToCollectionState::newCollection");
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
 
 // ---------------------------------------------------------------------------
@@ -439,9 +433,6 @@
 /*!
  Slot invoked when select collection state is entered.
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsAddAppsToCollectionState::selectCollection()
 {
     qDebug("HsAddAppsToCollectionState::selectCollection()");
@@ -452,11 +443,6 @@
     HSMENUTEST_FUNC_EXIT("HsAddAppsToCollectionState::selectCollection");
 }
 
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
-
-
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsaddtohomescreenstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -35,7 +35,7 @@
 
 const char SHORTCUT_WIDGET_URI[] = "hsshortcutwidgetplugin";
 const char SHORTCUT_ID[] = "caEntryId";
-const char ADD_TO_HOMESCREEN_STATE[] = "AddToHomeScreenState";
+
 
 
 /*!
@@ -50,17 +50,21 @@
 
 /*!
  Constructor
- \param parent: parent state
+ \param parent Parent state.
  \retval void
  */
 HsAddToHomeScreenState::HsAddToHomeScreenState(QState *parent) :
-    HsMenuBaseState(ADD_TO_HOMESCREEN_STATE, parent), 
+    QState(parent), 
     mCorruptedMessage(NULL), mConfirmAction(NULL),
     mMenuMode(NormalHsMenuMode),
     mNotifier(0)
 {
-    requestServices(QList<QVariant> () << SHORTCUT_SERVICE_KEY
-                    << CONTENT_SERVICE_KEY);
+    setObjectName("/AddToHomeScreenState");
+    
+    if (this->parent()) {
+        setObjectName(this->parent()->objectName() + objectName());
+    }
+    
     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
 }
 
@@ -86,7 +90,7 @@
 void HsAddToHomeScreenState::onEntry(QEvent *event)
 {
     HSMENUTEST_FUNC_ENTRY("HsAddToHomeScreenState::onEntry");
-    HsMenuBaseState::onEntry(event);
+    QState::onEntry(event);
     HsMenuEvent *menuEvent = static_cast<HsMenuEvent *>(event);
     QVariantMap data = menuEvent->data();
 
@@ -99,10 +103,10 @@
     bool success = false;
     if (entryTypeName == widgetTypeName()) {
         const QString uri = entry->attribute(widgetUriAttributeName());
-        success = addWidget(*contentService(), uri);
+        success = addWidget(*HsContentService::instance(), uri);
         HsMenuService::touch(mEntryId);        
     } else {
-        success = addApplication(*contentService(), *entry);
+        success = addApplication(*HsContentService::instance(), *entry);
     }
     
     if (success && (mMenuMode == NormalHsMenuMode)) {
@@ -153,9 +157,6 @@
  \param itemId entryId of widget (needed to delete it)
  \retval void
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsAddToHomeScreenState::showMessageWidgetCorrupted()
 {
     HSMENUTEST_FUNC_ENTRY("HsCollectionState::showMessageWidgetCorrupted");
@@ -179,9 +180,6 @@
 
     HSMENUTEST_FUNC_EXIT("HsCollectionState::showMessageWidgetCorrupted");
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
 /*!
  Slot launched on dismissing the corrupted widget error note
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsarrangestate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -73,7 +73,7 @@
 
 /*!
  Constructor
- \param parent owner
+ \param parent Parent state.
  \retval void
  */
 HsArrangeState::HsArrangeState(QState *parent) :
@@ -132,9 +132,6 @@
  Method invoked when a state is entered.
  \param event an event causing the entrance the state.
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsArrangeState::onEntry(QEvent *event)
 {
     qDebug("HsArrangeState::onEntry()");
@@ -184,9 +181,6 @@
     }
     HSMENUTEST_FUNC_EXIT("HsArrangeState::onEntry");
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
 /*!
  Slot invoked on closing the dialog.
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamedialog.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -48,7 +48,7 @@
 
 /*!
  Constructor
- \param parent owner
+ \param itemId Collection Id.
  \retval void
  */
 HsCollectionNameDialog::HsCollectionNameDialog(const int &itemId)
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionnamestate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -50,7 +50,7 @@
 
 /*!
  Constructor
- \param parent owner
+ \param parent Parent state.
  \retval void
  */
 HsCollectionNameState::HsCollectionNameState(QState *parent) :
@@ -74,7 +74,11 @@
  */
 void HsCollectionNameState::construct()
 {
-    setObjectName(this->parent()->objectName() + "/collectionnamestate");
+    setObjectName("/collectionnamestate");
+    if (this->parent()) {
+        setObjectName(this->parent()->objectName() + objectName());
+    }
+    
     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
 }
 
@@ -82,9 +86,6 @@
  Sets entry event.
  \param event entry event.
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsCollectionNameState::onEntry(QEvent *event)
 {
     qDebug("CollectionState::onEntry()");
@@ -104,10 +105,6 @@
     HSMENUTEST_FUNC_EXIT("HsCollectionNameState::onEntry");
 }
 
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
-
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 //
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionslistdialog.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hscollectionslistdialog.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -15,12 +15,12 @@
  *
  */
 
-#include <hbaction.h>
-#include <hblabel.h>
-#include <hsmenuservice.h>
+#include <HbAction>
+#include <HbLabel>
 #include <QDebug>
 #include <QStandardItemModel>
 
+#include <hsmenuservice.h>
 #include <hsmenuitemmodel.h>
 #include "hscollectionslistdialog.h"
 
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionitemstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <hbmessagebox.h>
 #include <hbaction.h>
+#include <HbParameterLengthLimiter>
 #include <hsmenuservice.h>
 #include <hsmenueventfactory.h>
 
@@ -32,7 +33,7 @@
 
 /*!
  Constructor.
- \param parent Owner.
+ \param parent Parent state. 
  */
 HsDeleteCollectionItemState::HsDeleteCollectionItemState(QState *parent) :
     QState(parent),
@@ -57,8 +58,10 @@
  */
 void HsDeleteCollectionItemState::construct()
 {
-    setObjectName(this->parent()->objectName()
-                  + "/DeleteCollectionItemState");
+    setObjectName("/DeleteCollectionItemState");
+    if (this->parent()) {
+        setObjectName(this->parent()->objectName() + objectName());
+    }
     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
 }
 
@@ -79,7 +82,7 @@
 
     QString message;
     message.append(
-        hbTrId("txt_applib_dialog_remove_1_from_collection").arg(
+        HbParameterLengthLimiter("txt_applib_dialog_remove_1_from_collection").arg(
             HsMenuService::getName(mItemId)));
 
     // create and show message box
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsdeletecollectionstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -19,6 +19,7 @@
 #include <hbmessagebox.h>
 #include <hbaction.h>
 #include <hsmenuservice.h>
+#include <HbParameterLengthLimiter>
 #include <hsshortcutservice.h>
 #include <hsmenueventfactory.h>
 
@@ -34,7 +35,7 @@
 
 /*!
  Constructor.
- \param parent Owner.
+ \param parent Parent state.
  */
 HsDeleteCollectionState::HsDeleteCollectionState(QState *parent) :
     QState(parent),
@@ -58,9 +59,10 @@
  */
 void HsDeleteCollectionState::construct()
 {
-    setObjectName(this->parent()->objectName() + "/DeleteCollectionState");
-    setProperty(HS_SERVICES_REGISTRATION_KEY, QList<QVariant> ()
-                << SHORTCUT_SERVICE_KEY);
+    setObjectName("/DeleteCollectionState");
+    if (this->parent()) {
+        setObjectName(this->parent()->objectName() + objectName());
+    }
     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
 }
 
@@ -68,9 +70,6 @@
  Sets entry event.
  \param event entry event.
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsDeleteCollectionState::onEntry(QEvent *event)
 {
     HSMENUTEST_FUNC_ENTRY("HsDeleteCollectionState::onEntry");
@@ -82,12 +81,12 @@
     mItemId = data.value(itemIdKey()).toInt();
 
     QString message;
-    if (shortcutService()->isItemShortcutWidget(mItemId)) {
-        message.append(hbTrId(
+    if (HsShortcutService::instance()->isItemShortcutWidget(mItemId)) {
+        message.append(HbParameterLengthLimiter(
                            "txt_applib_dialog_deletes_1_also_from_home_screen"). arg(
                            HsMenuService::getName(mItemId)));
     } else {
-        message.append(hbTrId("txt_applib_dialog_delete_1").arg(
+        message.append(HbParameterLengthLimiter("txt_applib_dialog_delete_1").arg(
                            HsMenuService::getName(mItemId)));
     }
 
@@ -107,19 +106,7 @@
     mDeleteMessage->open(this, SLOT(deleteMessageFinished(HbAction*)));
     HSMENUTEST_FUNC_EXIT("HsDeleteCollectionState::onEntry");
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
-/*!
- Convenience method returning the shortcut service.
- \since S60 ?S60_version.
- \return Shortcut Service.
- */
-HsShortcutService *HsDeleteCollectionState::shortcutService() const
-{
-    return property(SHORTCUT_SERVICE_KEY).value<HsShortcutService *> ();
-}
 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenubasestate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#include <QDebug>
-#include <QVariantList>
-
-#include <hsmenuservice.h>
-#include <hsshortcutservice.h>
-#include <hscontentservice.h>
-
-#include "hsmenubasestate.h"
-
-/*!
- \class HsMenuBaseState
- \ingroup group_hsworkerstateplugin
- \brief Menu Base State
- Menu Base state is the base class for states used in Menu.
- It provides basic functionality that makes implemenatation state easier.
- Derived implementation can request specific service and access it using convience function.
- \lib ?library
- */
-
-/*!
- Constructor.
- \param objectName object name, used for debug purpose
- \param parent Owner.
- */
-HsMenuBaseState::HsMenuBaseState(const QString &objectName, QState *parent) :
-    QState(parent)
-{
-    construct(objectName);
-}
-
-/*!
- Destructor.
- */
-HsMenuBaseState::~HsMenuBaseState()
-{
-}
-
-/*!
- Constructs contained objects.
- \param objectName object name, used for debug purpose
- */
-void HsMenuBaseState::construct(const QString &objectName)
-{
-    if (this->parent()) {
-        setObjectName(this->parent()->objectName() + "/" + objectName);
-    } else {
-        setObjectName(objectName);
-    }
-}
-
-/*!
- Convenience method that request single service.
- \param service service to be requested.
- \see requestServices
- */
-void HsMenuBaseState::requestService(const QVariant &service)
-{
-    requestServices(QList<QVariant> () << service);
-}
-
-/*!
- Request for services
- notice that services are appended to the list,
- so this fuction can be called more than once.
- \param services list of requested services
- this method must be called during construction phased of derived class
- */
-void HsMenuBaseState::requestServices(const QVariantList &services)
-{
-    // if value is not list, it returns empty list
-    QVariantList value = property(HS_SERVICES_REGISTRATION_KEY).toList();
-    // apppend to list
-    value.append(services);
-    setProperty(HS_SERVICES_REGISTRATION_KEY, value);
-}
-
-/*!
- Convenience method that returns the shortcut serviceif was requested
- \return Shortcut service if exists.
- */
-HsShortcutService *HsMenuBaseState::shortcutService() const
-{
-    return propertyWithChecking(SHORTCUT_SERVICE_KEY).value<
-           HsShortcutService *> ();
-}
-
-/*!
- Convenient method that returns the content serviceif was requested
- \return Content service if exists.
- */
-HsContentService *HsMenuBaseState::contentService() const
-{
-    return propertyWithChecking(CONTENT_SERVICE_KEY).value<
-           HsContentService *> ();
-}
-
-/*!
- Function return value for specified property and
- if it is not valid add warning message on console.
- \param propertyName Property name.
- \return Property after validation.
- */
-QVariant HsMenuBaseState::propertyWithChecking(const char *propertyName) const
-{
-    QVariant val = property(propertyName);
-    if (!val.isValid()) {
-        qWarning() << "Missing value for property: " << propertyName;
-    }
-    return val;
-}
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsmenuworkerstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -43,7 +43,7 @@
 
 /*!
  Constructor.
- \param parent Owner.
+ \param parent Parent state. 
  */
 HsMenuWorkerState::HsMenuWorkerState(QState *parent) :
     QState(parent), mInitialState(0)
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hspreviewhswidgetstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -17,12 +17,13 @@
 
 
 #include <hblabel.h>
-//#include <hsiwidgetprovider.h>
 #include <hbmessagebox.h>
 #include <qstatemachine.h>
 #include <hbaction.h>
 #include <HbDocumentLoader>
 #include <hbdialog.h>
+#include <HbIcon>
+#include <HbLabel>
 #include <hbwidget.h>
 #include <hbscrollarea.h>
 #include <hbscrollbar.h>
@@ -44,7 +45,6 @@
 #include "hsdomainmodel_global.h"
 #include <hscontentservice.h>
 
-const char HS_PREVIEW_HS_WIDGET_STATE[] = "HsPreviewHSWidgetState";
 
 /*!
  \class HsPreviewHSWidgetState
@@ -57,19 +57,21 @@
 
 /*!
  Constructor
- \param parent: parent state
+ \param parent Parent state.
  \retval void
  */
 HsPreviewHSWidgetState::HsPreviewHSWidgetState(QState *parent) :
-    HsMenuBaseState(HS_PREVIEW_HS_WIDGET_STATE, parent),
-    mPopupDialog(0),
+    QState(parent),
+    mPreviewDialog(0),
     mNotifier(0),
-    mScrollArea(0),
     mWidget(0),
     mEntryId(0),
     mCorruptedMessage(0)
 {
-    requestServices(QList<QVariant> () << CONTENT_SERVICE_KEY);
+    setObjectName("/HsPreviewHSWidgetState");
+    if (this->parent()) {
+        setObjectName(this->parent()->objectName() + objectName());
+    }
     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
 }
 
@@ -93,13 +95,10 @@
  \param shortcutService: service for adding shortcuts
  \retval void
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsPreviewHSWidgetState::onEntry(QEvent *event)
 {
     HSMENUTEST_FUNC_ENTRY("HsPreviewHSWidgetState::onEntry");
-    HsMenuBaseState::onEntry(event);
+    QState::onEntry(event);
     HsMenuEvent *menuEvent = static_cast<HsMenuEvent *>(event);
     QVariantMap data = menuEvent->data();
 
@@ -109,47 +108,21 @@
     widgetData.insert(LIBRARY, data.value(widgetLibraryAttributeName()).toString());
     widgetData.insert(URI, data.value(widgetUriAttributeName()).toString());
 
-    QScopedPointer<HsWidgetHost> widget(contentService()->createWidgetForPreview(widgetData));
-
-    if (widget) {
-        widget->setMinimumSize(widget->preferredWidth(),widget->preferredHeight());
-
-        HbDocumentLoader loader;
-
-        bool loadStatusOk = false;
-        mObjectList = 
-            loader.load(HS_WIDGET_PREVIEW_DIALOG_LAYOUT, &loadStatusOk);
-        Q_ASSERT_X(loadStatusOk,
-            HS_WIDGET_PREVIEW_DIALOG_LAYOUT,
-               "Error while loading docml file.");
-
-        mPopupDialog = 
-            qobject_cast<HbDialog*>(
-                loader.findWidget(HS_WIDGET_PREVIEW_DIALOG_NAME));
+    mWidget.reset(
+        HsContentService::instance()->createWidgetForPreview(widgetData));
 
-        mScrollArea =
-            qobject_cast<HbScrollArea*>(
-                loader.findWidget(HS_WIDGET_PREVIEW_SCROLL_AREA_NAME));
-
-        // set parent to actions to delete them together with dialog
-        mPopupDialog->actions()[0]->setParent(mPopupDialog);
-        mPopupDialog->actions()[1]->setParent(mPopupDialog);
-
-        if (mPopupDialog != NULL && mScrollArea != NULL) {
-            mPopupDialog->setContentWidget(mScrollArea); // ownership transferred
-            mPopupDialog->setTimeout(HbPopup::NoTimeout);
-            mPopupDialog->setAttribute(Qt::WA_DeleteOnClose, true);
-            mScrollArea->verticalScrollBar()->setInteractive(true);
-            mScrollArea->horizontalScrollBar()->setInteractive(true);
-            mWidget = widget.take(); // ownership transfered
-            mScrollArea->setContentWidget(mWidget); // ownership transferred
-            
+    if (!mWidget.isNull()) {
+        
+        QSharedPointer<CaEntry> entry = 
+            CaService::instance()->getEntry(mEntryId);
+        
+        mPreviewDialog = buildPreviewDialog(*entry);
+        
+        if (mPreviewDialog != NULL) {
             subscribeForMemoryCardRemove();
-            mWidget->startWidget();
             // Launch popup asyncronously
-            mPopupDialog->open(this, SLOT(previewDialogFinished(HbAction*)));    
+            mPreviewDialog->open(this, SLOT(previewDialogFinished(HbAction*)));    
         }
-
     } else {
         subscribeForMemoryCardRemove();
         showMessageWidgetCorrupted();
@@ -157,9 +130,6 @@
 
     HSMENUTEST_FUNC_EXIT("HsPreviewHSWidgetState::onEntry");
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
 /*!
  Slot launched after state has exited and in destructor.
@@ -168,20 +138,21 @@
 void HsPreviewHSWidgetState::cleanUp()
 {
     // Close popups if App key was pressed or memory card removed
-    if (mPopupDialog) {
-        disconnect(mPopupDialog, SIGNAL(finished(HbAction*)), this, SLOT(previewDialogFinished(HbAction*)));
-        mPopupDialog->close();
-        mPopupDialog = NULL;
+    if (mPreviewDialog) {
+        disconnect(mPreviewDialog, SIGNAL(finished(HbAction*)), 
+            this, SLOT(previewDialogFinished(HbAction*)));
+        mPreviewDialog->close();
+        mPreviewDialog = NULL;
     }
 
     if (mCorruptedMessage) {
-        disconnect(mCorruptedMessage, SIGNAL(finished(HbAction*)), this, SLOT(messageWidgetCorruptedFinished(HbAction*)));
+        disconnect(mCorruptedMessage, SIGNAL(finished(HbAction*)), 
+            this, SLOT(messageWidgetCorruptedFinished(HbAction*)));
         mCorruptedMessage->close();
         mCorruptedMessage = NULL;
     }
 
-    mScrollArea = NULL;
-    mWidget = NULL;
+    mWidget.reset();
 
     disconnect(mNotifier,
                SIGNAL(entryChanged(CaEntry,ChangeType)),
@@ -197,20 +168,19 @@
  */
 void HsPreviewHSWidgetState::previewDialogFinished(HbAction* finishedAction)
 {
-    if (finishedAction == mPopupDialog->actions().value(0)) {
-        mWidget->hideWidget();
-        mScrollArea->takeContentWidget();
+    if (finishedAction == mPreviewDialog->actions().value(0)) {
+
         HsScene::instance()->activePage()->addNewWidget(
-            mWidget); // ownership transferred
+            mWidget.take()); // ownership transferred
         HbNotificationDialog *notificationDialog = new HbNotificationDialog();
         notificationDialog->setAttribute(Qt::WA_DeleteOnClose);
         notificationDialog->setTitle(hbTrId(
                                      "txt_applib_dpophead_added_to_homescreen") );
         notificationDialog->show();
     } else {
-            mScrollArea->takeContentWidget();
             mWidget->remove();
-            mWidget = NULL;
+            mWidget.take();   
+            mWidget.reset();
     }
     emit exit();
 }
@@ -236,9 +206,6 @@
  Shows message about corrupted widget library. Deletes widget eventually
  \retval void
  */
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 void HsPreviewHSWidgetState::showMessageWidgetCorrupted()
 {
     HSMENUTEST_FUNC_ENTRY("HsCollectionState::showMessageWidgetCorrupted");
@@ -259,9 +226,6 @@
     mCorruptedMessage->open(this, SLOT(messageWidgetCorruptedFinished(HbAction*)));
     HSMENUTEST_FUNC_EXIT("HsCollectionState::showMessageWidgetCorrupted");
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
 /*!
  Slot launched on dismissing the corrupted widget error note
@@ -274,3 +238,56 @@
     }
     emit exit();
 }
+
+/*!
+ \param entry The entry which is to be presented by the preview dialog.
+ \return Preview popup for a given entry on success, NULL otherwise. 
+  Ownership is passed to the caller.
+ */
+HbDialog* HsPreviewHSWidgetState::buildPreviewDialog(const CaEntry& entry) const
+{
+    HbDocumentLoader loader;
+
+    bool loadStatusOk = false;
+    loader.load(HS_WIDGET_PREVIEW_DIALOG_LAYOUT, &loadStatusOk);
+    
+    HbDialog *const previewDialog = 
+        qobject_cast<HbDialog*>(
+            loader.findWidget(HS_WIDGET_PREVIEW_DIALOG_NAME));
+    HbLabel *const headingLabel =
+        qobject_cast<HbLabel*>(
+            loader.findWidget(HS_WIDGET_PREVIEW_LABEL_NAME));
+    HbLabel *const iconBox =
+        qobject_cast<HbLabel*>(
+            loader.findWidget(HS_WIDGET_PREVIEW_ICON_BOX_NAME));
+    
+    loadStatusOk = loadStatusOk && (previewDialog != NULL)
+        && (headingLabel != NULL) && (iconBox != NULL);
+    
+    Q_ASSERT_X(loadStatusOk,
+        HS_WIDGET_PREVIEW_DIALOG_LAYOUT,
+           "Cannot initialize widgets based on docml file.");
+    
+    if (loadStatusOk) {
+        previewDialog->actions()[0]->setParent(previewDialog);
+        previewDialog->actions()[1]->setParent(previewDialog);
+        
+        previewDialog->setTimeout(HbPopup::NoTimeout);
+        previewDialog->setAttribute(Qt::WA_DeleteOnClose, true);
+        
+        headingLabel->setPlainText(entry.text());
+        
+        const QString previewImageName(entry.attribute(
+            QLatin1String(HS_PREVIEW_ATTRIBUTE_NAME))); 
+        
+        if (!previewImageName.isEmpty()) {
+            const HbIcon previewImage(previewImageName);
+            if (previewImage.size().isValid()) {
+                iconBox->setIcon(previewImage);
+            }
+        }
+    }
+    
+    return previewDialog;
+}
+
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsuninstallitemstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -19,6 +19,17 @@
 #include <hbaction.h>
 #include <hsmenuservice.h>
 #include <hsshortcutservice.h>
+#include <HbDocumentLoader>
+#include <HbLabel>
+#include <HbListView>
+#include <HbParameterLengthLimiter>
+
+
+#include <QStandardItemModel>
+#include <QStandardItem>
+#include <casoftwareregistry.h>
+#include <caquery.h>
+#include <canotifier.h>
 
 #include "hsuninstallitemstate.h"
 #include "hsmenuevent.h"
@@ -32,12 +43,14 @@
 
 /*!
  Constructor.
- \param parent Owner.
+ \param parent Parent state.
  */
 HsUninstallItemState::HsUninstallItemState(QState *parent) :
     QState(parent),
     mItemId(0),
+    mNotifier(NULL),
     mUninstallMessage(NULL),
+    mUninstallJavaMessage(NULL),
     mConfirmAction(NULL)
 {
     construct();
@@ -56,10 +69,10 @@
  */
 void HsUninstallItemState::construct()
 {
-    setObjectName(this->parent()->objectName()
-                  + "/UninstallItemState");
-    setProperty(HS_SERVICES_REGISTRATION_KEY, QList<QVariant> ()
-                << SHORTCUT_SERVICE_KEY);
+    setObjectName("/UninstallItemState");
+    if (this->parent()) {
+        setObjectName(this->parent()->objectName() + objectName());
+    }
     connect(this, SIGNAL(exited()), SLOT(cleanUp()));
 }
 
@@ -76,32 +89,17 @@
     QVariantMap data = menuEvent->data();
 
     mItemId = data.value(itemIdKey()).toInt();
-
-    QString message;
-    if (shortcutService()->isItemShortcutWidget(mItemId)) {
-        message.append(
-            hbTrId("txt_applib_dialog_uninstalls_1_and_deletes_all_sh").arg(
-                HsMenuService::getName(mItemId)));
+    QSharedPointer<CaEntry> entry = CaService::instance()->getEntry(mItemId);
+    QString appType = entry->attribute(swTypeKey());
+    if (!appType.compare(javaSwType())) {
+        // java
+        createUninstallJavaMessage();
     } else {
-        message.append(
-            hbTrId("txt_applib_dialog_1_will_be_removed_from_phone_c").arg(
-                HsMenuService::getName(mItemId)));
+        // other
+        createUninstallMessage();
     }
-
-    // create and show message box
-    mUninstallMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
-    mUninstallMessage->setAttribute(Qt::WA_DeleteOnClose);
-
-    mUninstallMessage->setText(message);
-
-    mUninstallMessage->clearActions();
-    mConfirmAction = new HbAction(hbTrId("txt_common_button_ok"), mUninstallMessage);
-    mUninstallMessage->addAction(mConfirmAction);
-
-    HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"), mUninstallMessage);
-    mUninstallMessage->addAction(secondaryAction);
-
-    mUninstallMessage->open(this, SLOT(uninstallMessageFinished(HbAction*)));
+    
+    subscribeForMemoryCardRemove();
 
     HSMENUTEST_FUNC_EXIT("HsUninstallItemState::onEntry");
 }
@@ -120,13 +118,61 @@
 }
 
 /*!
- Convenience method returning the shortcut service.
- \since S60 ?S60_version.
- \return Shortcut Service.
+ Return information about a component: component name, a list of names
+ of applications in this component and a delete message.
+ \param[out] componentName component name.
+ \param[out] applicationsNames a list of names of applications.
+ \param[out] confirmationMessage delete message.
+ \retval true if there is no error.
  */
-HsShortcutService *HsUninstallItemState::shortcutService() const
+bool HsUninstallItemState::getApplicationsNames(QString &componentName,
+    QStringList &applicationsNames,
+    QString &confirmationMessage)
 {
-    return property(SHORTCUT_SERVICE_KEY).value<HsShortcutService *> ();
+    componentName.clear();
+    applicationsNames.clear();
+    confirmationMessage.clear();
+    
+    QSharedPointer<CaService> service = CaService::instance();
+    QSharedPointer<CaEntry> entry = service->getEntry(mItemId);
+    const int componentId =
+        entry->attribute(componentIdAttributeName()).toInt();
+    
+    QSharedPointer<CaSoftwareRegistry> softwareRegistry =
+        CaSoftwareRegistry::create();
+    QStringList appUids;
+    bool retval = softwareRegistry->getUninstallDetails(componentId,
+        componentName,
+        appUids,
+        confirmationMessage);
+    if (retval) {
+        CaQuery query;
+        foreach (QString uid, appUids) {
+            query.setAttribute(applicationUidEntryKey(), uid);
+            QList< QSharedPointer<CaEntry> > entries =
+                service->getEntries(query);
+            applicationsNames << entries[0]->text();
+        }
+        if (applicationsNames.length()==1
+            && applicationsNames[0]==componentName) {
+            applicationsNames.clear();
+        }
+    }
+    return retval;
+}
+
+/*!
+ Subscribe for memory card remove.
+ */
+void HsUninstallItemState::subscribeForMemoryCardRemove()
+{
+    CaNotifierFilter filter;
+    filter.setIds(QList<int>() << mItemId);
+    mNotifier = CaService::instance()->createNotifier(filter);
+    mNotifier->setParent(this);
+    connect(mNotifier,
+        SIGNAL(entryChanged(CaEntry,ChangeType)),
+        SIGNAL(exit()));
 }
 
 /*!
@@ -137,11 +183,143 @@
 {
     // Close messagebox if App key was pressed
     if (mUninstallMessage) {
-        disconnect(mUninstallMessage, SIGNAL(finished(HbAction*)), this, SLOT(uninstallMessageFinished(HbAction*)));
+        disconnect(mUninstallMessage, SIGNAL(finished(HbAction*)),
+            this, SLOT(uninstallMessageFinished(HbAction*)));
         mUninstallMessage->close();
         mUninstallMessage = NULL;
     }
+    
+    if (mUninstallJavaMessage) {
+        disconnect(mUninstallJavaMessage, SIGNAL(finished(HbAction*)), this, SLOT(uninstallMessageFinished(HbAction*)));
+        mUninstallJavaMessage->close();
+        mUninstallJavaMessage = NULL;
+    }
 
+    delete mNotifier;
+    mNotifier = NULL;
     mConfirmAction = NULL;
     mItemId = 0;
 }
+
+/*!
+ Method create uninstall confirmation message.
+ \retval void
+ */
+void HsUninstallItemState::createUninstallMessage()
+{
+    QString message;
+    if (HsShortcutService::instance()->isItemShortcutWidget(mItemId)) {
+        message.append(
+            HbParameterLengthLimiter("txt_applib_dialog_uninstalls_1_and_deletes_all_sh").arg(
+                HsMenuService::getName(mItemId)));
+    } else {
+        message.append(
+            HbParameterLengthLimiter("txt_applib_dialog_1_will_be_removed_from_phone_c").arg(
+                HsMenuService::getName(mItemId)));
+    }
+
+    // create and show message box
+    mUninstallMessage = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
+    mUninstallMessage->setAttribute(Qt::WA_DeleteOnClose);
+
+    mUninstallMessage->setText(message);
+
+    mUninstallMessage->clearActions();
+    mConfirmAction = new HbAction(hbTrId("txt_common_button_ok"),
+            mUninstallMessage);
+    mUninstallMessage->addAction(mConfirmAction);
+
+    HbAction *secondaryAction = new HbAction(hbTrId("txt_common_button_cancel"),
+            mUninstallMessage);
+    mUninstallMessage->addAction(secondaryAction);
+
+    mUninstallMessage->open(this, SLOT(uninstallMessageFinished(HbAction*)));
+}
+
+/*!
+ Method create uninstall confirmation dialog for java.
+ \retval void
+ */
+void HsUninstallItemState::createUninstallJavaMessage()
+{
+    HbDocumentLoader loader;
+    bool loadStatusOk = false;
+    mObjectList = loader.load(HS_UNINSTALL_DIALOG_LAYOUT, &loadStatusOk);
+    
+    Q_ASSERT_X(loadStatusOk,
+            HS_UNINSTALL_DIALOG_LAYOUT,
+           "Error while loading docml file.");
+
+    QString componentName;
+    QStringList applicationsNames;
+    QString detailsMessage;
+    getApplicationsNames(componentName, applicationsNames, detailsMessage);
+    
+    QString section;
+    if (applicationsNames.isEmpty() && detailsMessage.isEmpty()) {
+        mDialogType = UninstallDialogDefinition01;
+        section = QString("uninstallDialogDefinition01");
+        mObjectList = loader.load(
+                HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk);
+    } else if ( (!applicationsNames.isEmpty()) && (!detailsMessage.isEmpty())) {
+        mDialogType = UninstallDialogDefinition02;
+        section = QString("uninstallDialogDefinition02");
+        mObjectList = loader.load(
+                HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk);
+    } else if ( (!applicationsNames.isEmpty() && detailsMessage.isEmpty())) {
+        mDialogType = UninstallDialogDefinition03;
+        section = QString("uninstallDialogDefinition03");
+        mObjectList = loader.load(
+                HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk);
+    } else if (applicationsNames.isEmpty()  && (!detailsMessage.isEmpty())) {
+        mDialogType = UninstallDialogDefinition04;
+        section = QString("uninstallDialogDefinition04");
+        mObjectList = loader.load(
+                HS_UNINSTALL_DIALOG_LAYOUT, section, &loadStatusOk);
+    }
+ 
+    mUninstallJavaMessage = 
+        qobject_cast<HbDialog*>(
+            loader.findWidget(HS_UNINSTALL_DIALOG_NAME));
+    
+    HbLabel* iconLabel = 
+        qobject_cast<HbLabel*>(
+            loader.findWidget(HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_ICON));
+    QSharedPointer<CaEntry> entry2 = CaService::instance()->getEntry(mItemId);
+    HbIcon icon = entry2->makeIcon();
+    iconLabel->setIcon(icon);
+    
+    HbLabel* textLabel = 
+        qobject_cast<HbLabel*>(
+            loader.findWidget(HS_UNINSTALL_DIALOG_CONFIRMATION_DIALOG_LABEL));
+    textLabel->setPlainText(textLabel->plainText().arg(componentName));
+    
+    HbLabel* detailsUninstalLabel;
+    if ((mDialogType == UninstallDialogDefinition02) ||
+        (mDialogType == UninstallDialogDefinition04)) {
+        detailsUninstalLabel= qobject_cast<HbLabel*>(
+                loader.findWidget(HS_UNINSTALL_DIALOG_DELETE_LABEL));
+        detailsUninstalLabel->setPlainText(detailsMessage);
+    }
+
+    HbLabel* listView;
+    QString applicationsList;
+    QString newLine("\n");
+    if ((mDialogType == UninstallDialogDefinition02) ||
+        (mDialogType == UninstallDialogDefinition03)) {
+        listView = qobject_cast<HbLabel*>(
+                loader.findWidget(HS_UNINSTALL_DIALOG_LIST_VIEW_LABEL));
+
+        for (int i=0; i<applicationsNames.count(); i++) {
+            applicationsList = applicationsList + applicationsNames[i] + newLine;
+        }
+        listView->setPlainText(applicationsList);
+    }
+
+    mUninstallJavaMessage->setAttribute(Qt::WA_DeleteOnClose);
+    mUninstallJavaMessage->setTimeout(HbPopup::NoTimeout);
+    mConfirmAction = qobject_cast<HbAction*>(loader.findObject(
+            HS_UNINSTALL_DIALOG_CONFIRMATION_ACTION));
+    
+    mUninstallJavaMessage->open(this, SLOT(uninstallMessageFinished(HbAction*)));
+}
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappdetailsstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -31,12 +31,20 @@
 #include "hsmenuevent.h"
 #include "hsmenuitemmodel.h"
 
+
+/*!
+ Constructor.
+ @param parent Parent state.
+ */
 HsViewAppDetailsState::HsViewAppDetailsState(QState *parent) :
     QState(parent), mDialog(0), mNotifier(0)
 {
     construct();
 }
 
+/*!
+ Destructor
+ */
 HsViewAppDetailsState::~HsViewAppDetailsState()
 {
     if (mDialog) {
@@ -44,14 +52,23 @@
     }
 }
 
+/*!
+ Construction
+ */
 void HsViewAppDetailsState::construct()
 {
     HSMENUTEST_FUNC_ENTRY("HsViewAppDetailsState::construct");
-    setObjectName(this->parent()->objectName()
-                  + "/ViewAppDetailsState");
+        
+    setObjectName("/ViewAppDetailsState");
+    if (this->parent()) {
+        setObjectName(this->parent()->objectName() + objectName());
+    }
     HSMENUTEST_FUNC_EXIT("HsViewAppDetailsState::construct");
 }
 
+/*!
+ Invoked on entering state
+ */
 void HsViewAppDetailsState::onEntry(QEvent *event)
 {
     HSMENUTEST_FUNC_ENTRY("HsViewAppDetailsState::onEntry");
@@ -60,50 +77,61 @@
     QVariantMap data = menuEvent->data();
     
     const int entryId = data.value(itemIdKey()).toInt();
-    QSharedPointer<const CaEntry> entry = CaService::instance()->getEntry(entryId);
-    const int componentId = entry->attribute(componentIdAttributeName()).toInt();
+    QSharedPointer<const CaEntry> entry 
+        = CaService::instance()->getEntry(entryId);
+    const int componentId = entry->attribute(
+        componentIdAttributeName()).toInt();
     
     QSharedPointer<CaSoftwareRegistry> scr = CaSoftwareRegistry::create();
     CaSoftwareRegistry::DetailMap detailMap = scr->entryDetails(componentId);
     
     HbDocumentLoader loader;
     bool loadStatusOk = false;
-    mObjectList = 
-        loader.load(HS_DETAILS_DIALOG_LAYOUT, &loadStatusOk);
-    Q_ASSERT_X(loadStatusOk,
-        HS_DETAILS_DIALOG_LAYOUT,
+    mObjectList = loader.load(HS_DETAILS_DIALOG_LAYOUT, &loadStatusOk);
+    Q_ASSERT_X(loadStatusOk, HS_DETAILS_DIALOG_LAYOUT,
            "Error while loading docml file.");
 
-    mDialog = qobject_cast<HbDialog*>(loader.findWidget(HS_DETAILS_DIALOG_NAME));
+    mDialog = qobject_cast<HbDialog*>(
+        loader.findWidget(HS_DETAILS_DIALOG_NAME));
     mDialog->actions()[0]->setParent(mDialog);
     
     subscribeForMemoryCardRemove(entryId);
     
-    HbLabel* nameLabel = qobject_cast<HbLabel*>(loader.findWidget(CaSoftwareRegistry::componentNameKey()));
-    HbLabel* versionLabel = qobject_cast<HbLabel*>(loader.findWidget(CaSoftwareRegistry::componentVersionKey()));
-    HbLabel* supplierLabel = qobject_cast<HbLabel*>(loader.findWidget(CaSoftwareRegistry::componentVendorKey()));
-    HbLabel* memoryLabel = qobject_cast<HbLabel*>(loader.findWidget(CaSoftwareRegistry::componentDriveInfoKey()));
-    HbLabel* sizeLabel = qobject_cast<HbLabel*>(loader.findWidget(CaSoftwareRegistry::componentSizeKey()));
-    HbLabel* typeLabel = qobject_cast<HbLabel*>(loader.findWidget(CaSoftwareRegistry::componentTypeKey()));    
+    HbLabel* nameLabel = qobject_cast<HbLabel*>(
+        loader.findWidget(CaSoftwareRegistry::componentNameKey()));
+    HbLabel* versionLabel = qobject_cast<HbLabel*>(
+        loader.findWidget(CaSoftwareRegistry::componentVersionKey()));
+    HbLabel* supplierLabel = qobject_cast<HbLabel*>(
+        loader.findWidget(CaSoftwareRegistry::componentVendorKey()));
+    HbLabel* memoryLabel = qobject_cast<HbLabel*>(
+        loader.findWidget(CaSoftwareRegistry::componentDriveInfoKey()));
+    HbLabel* sizeLabel = qobject_cast<HbLabel*>(
+        loader.findWidget(CaSoftwareRegistry::componentSizeKey()));
+    HbLabel* typeLabel = qobject_cast<HbLabel*>(
+        loader.findWidget(CaSoftwareRegistry::componentTypeKey()));    
     
-    nameLabel->setPlainText(detailMap[CaSoftwareRegistry::componentNameKey()]);
-    versionLabel->setPlainText(detailMap[CaSoftwareRegistry::componentVersionKey()]);
-    supplierLabel->setPlainText(detailMap[CaSoftwareRegistry::componentVendorKey()]);
-    memoryLabel->setPlainText(detailMap[CaSoftwareRegistry::componentDriveInfoKey()]);
-    sizeLabel->setPlainText(detailMap[CaSoftwareRegistry::componentSizeKey()]);
-    typeLabel->setPlainText(detailMap[CaSoftwareRegistry::componentTypeKey()]);
+    nameLabel->setPlainText(
+        detailMap[CaSoftwareRegistry::componentNameKey()]);
+    versionLabel->setPlainText(
+        detailMap[CaSoftwareRegistry::componentVersionKey()]);
+    supplierLabel->setPlainText(
+        detailMap[CaSoftwareRegistry::componentVendorKey()]);
+    memoryLabel->setPlainText(
+            detailMap[CaSoftwareRegistry::componentDriveInfoKey()]);
+    sizeLabel->setPlainText(
+        detailMap[CaSoftwareRegistry::componentSizeKey()]);
+
+    typeLabel->setPlainText(
+        detailMap[CaSoftwareRegistry::componentTypeKey()]);
     
     if (mDialog != NULL) {
         mDialog->setTimeout(HbPopup::NoTimeout);
         mDialog->setAttribute(Qt::WA_DeleteOnClose, true);
         mDialog->open(this, SLOT(stateExited())); 
     }
-    
     HSMENUTEST_FUNC_EXIT("HsViewAppDetailsState::onEntry");    
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
+
 /*!
  Slot invoked when a state is exited.
  */
@@ -115,26 +143,20 @@
     HSMENUTEST_FUNC_EXIT("HsViewAppDetailsState::stateExited");
     qDebug("HsViewAppDetailsState::stateExited()");
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
-
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
+/*!
+ Invoked on exiting state
+ */
 void HsViewAppDetailsState::onExit(QEvent *event)
 {
     QState::onExit(event);
-    // Close popups if App key was pressed
+    // Close popups if App key was pressed or
+    // memory card removed
     if (mDialog) {
         mDialog->close();
     }
     mDialog = NULL;
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
 /*!
  Subscribe for memory card remove.
@@ -151,25 +173,5 @@
     mNotifier->setParent(this);
     connect(mNotifier,
             SIGNAL(entryChanged(CaEntry,ChangeType)),
-            SLOT(memoryCardRemoved()));
+            SIGNAL(exit()));
 }
-
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
-/*!
- Memory card with instaled widget was removed.
- \retval void
- */
-void HsViewAppDetailsState::memoryCardRemoved()
-{
-    if (mDialog) {
-    mDialog->close();
-    }
-    // exit not needed, it is called after dialog closed
-
-}
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
-
--- a/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/stateplugins/hsmenuworkerstateplugin/src/hsviewappsettingsstate.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -57,7 +57,7 @@
 
 /*!
  Constructor
- \param parent: parent state
+ \param parent Parent state.
  \retval void
  */
 HsViewAppSettingsState::HsViewAppSettingsState(QState *parent) :
@@ -68,7 +68,7 @@
         mNotifier(0)
         
 {
-        construct();
+    construct();
 }
 
 /*!
@@ -76,8 +76,10 @@
  */
 void HsViewAppSettingsState::construct()
 {
-    setObjectName(this->parent()->objectName()
-                  + "/ViewAppSettingsState");
+    setObjectName("/ViewAppSettingsState");
+    if (this->parent()) {
+        setObjectName(this->parent()->objectName() + objectName());
+    }
 }
 
 /*!
@@ -106,7 +108,8 @@
     const int entryId = data.value(itemIdKey()).toInt();   
     QSharedPointer<const CaEntry> entry = CaService::instance()->getEntry(entryId);    
     
-    QString pluginPath(entry->attribute(appSettingsPlugin()));
+    QString pluginPath;
+    pluginPath = pluginPath.append("/resource/qt/plugins/appsettings/").append(entry->attribute(appSettingsPlugin())).append(".qtplugin");
     QPluginLoader loader(pluginPath);
     mView = qobject_cast<HbView *>(loader.instance()); 
     
@@ -138,7 +141,7 @@
 
 #ifdef COVERAGE_MEASUREMENT
 #pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
+#endif //COVERAGE_MEASUREMENT (only returns HbMainWindow)
 /*!
  Returns pointer to tha main window.
  \return Pointer to the main window.
@@ -152,9 +155,6 @@
 #endif //COVERAGE_MEASUREMENT
 
 
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC SKIP
-#endif //COVERAGE_MEASUREMENT
 /*!
  Invoked when plugin view exits
  */
@@ -162,9 +162,6 @@
 {
     emit exit();
 }
-#ifdef COVERAGE_MEASUREMENT
-#pragma CTC ENDSKIP
-#endif //COVERAGE_MEASUREMENT
 
 /*!
  Subscribe for memory card remove.
--- a/homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsanalogclockwidget.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/widgetplugins/hsclockwidgetplugin/src/hsanalogclockwidget.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -149,7 +149,7 @@
         return;
     }
 
-    HbInstantFeedback::play(HsConfiguration::clockWidgetTapFeedbackType());
+    HbInstantFeedback::play(HSCONFIGURATION_GET(clockWidgetTapFeedbackEffect));
 
     emit clockTapped();
 }
--- a/homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/homescreenapp/widgetplugins/hsshortcutwidgetplugin/src/hsshortcutwidget.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -232,7 +232,7 @@
         return;
     }
 
-    HbInstantFeedback::play(HsConfiguration::shortcutWidgetTapFeedbackType());
+    HbInstantFeedback::play(HSCONFIGURATION_GET(shortcutWidgetTapFeedbackEffect));
     
     if (mCaEntryRole == ItemEntryRole) {
         CaService::instance()->executeCommand(mCaEntryId);
@@ -261,7 +261,7 @@
     }
 
     // Text
-    if ( HsConfiguration::shortcutLabelsVisible() && !mText ) {
+    if (HSCONFIGURATION_GET(isShortcutLabelVisible) && !mText ) {
         mText = new HbTextItem(this);
         HbStyle::setItemName(mText, QLatin1String("text"));
         }
@@ -283,8 +283,12 @@
     mCaEntryTypeName = caEntry.entryTypeName();
     mIcon->setIcon(caEntry.makeIcon());
     if (mText) {
-        mText->setText(caEntry.text());
-        }
+        if(caEntry.attribute(entryShortName()).length()) {
+            mText->setText(caEntry.attribute(entryShortName()));
+        } else {
+            mText->setText(caEntry.text());
+        }        
+    }
 }
 
 /*!
@@ -345,3 +349,4 @@
 }
 
 
+
--- a/taskswitcherapp/taskswitcherapp.pro	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/taskswitcherapp.pro	Wed Jun 23 18:03:36 2010 +0300
@@ -30,7 +30,6 @@
     SUBDIRS += ../../homescreensrv/activityfw/activityserviceplugin/tsrc
     SUBDIRS += ../../homescreensrv/activityfw/activitydatabase/hsactivitydbclient/t_hsactivitydbclient
     SUBDIRS += ../../homescreensrv/hsappkeyhandler/tsrc/t_hsappkeyhandler
-    SUBDIRS += ../../homescreensrv/activityfw/activityserviceplugin/s60/tsrc
     SUBDIRS += ../../homescreensrv/tstaskmonitor/client/tsrc
     SUBDIRS += ../../homescreensrv/tstaskmonitor/server/tsrc
     SUBDIRS += ../../homescreensrv/tstaskmonitor/screenshotplugin/tsrc
--- a/taskswitcherapp/tsdevicedialogplugin/inc/tsdevicedialog.h	Fri Jun 11 13:30:16 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 TSDEVICEDIALOG_H
-#define TSDEVICEDIALOG_H
-
-#include <HbDialog>
-#include <HbDeviceDialogInterface>
-
-class QGraphicsLinearLayout;
-class HbDocumentLoader;
-
-class TsDeviceDialog : public HbDialog, public HbDeviceDialogInterface
-{
-    Q_OBJECT
-
-public:
-    TsDeviceDialog(HbDocumentLoader &loader, QGraphicsItem *parent = 0);
-    ~TsDeviceDialog();
-
-    virtual bool setDeviceDialogParameters(const QVariantMap &parameters);
-    virtual int deviceDialogError() const;
-    virtual void closeDeviceDialog(bool byClient);
-    virtual HbPopup *deviceDialogWidget() const;
-
-signals:
-    void deviceDialogClosed();
-
-public slots:
-    void changeOrientation(Qt::Orientation orientation);
-
-private:
-    HbDocumentLoader &mLoader;
-
-};
-
-#endif // TSDEVICEDIALOG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/taskswitcherapp/tsdevicedialogplugin/inc/tsdevicedialogcontainer.h	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#ifndef TSDEVICEDIALOGCONTAINER_H
+#define TSDEVICEDIALOGCONTAINER_H
+
+#include <QObject>
+
+#include <HbDeviceDialogInterface>
+
+#include "tsdocumentloader.h"
+
+class QAbstractListModel;
+
+class TsDeviceDialogContainer : public QObject, public HbDeviceDialogInterface
+{
+Q_OBJECT
+public:
+    explicit TsDeviceDialogContainer(QAbstractListModel *model, QObject *parent = 0);
+    ~TsDeviceDialogContainer();
+
+public:
+    virtual bool setDeviceDialogParameters(const QVariantMap &parameters);
+    virtual int deviceDialogError() const;
+    virtual void closeDeviceDialog(bool byClient);
+    virtual HbPopup *deviceDialogWidget() const;
+    virtual QObject *signalSender() const;
+
+signals:
+    void deviceDialogClosed();
+
+public slots:
+    void changeOrientation(Qt::Orientation orientation);
+
+private:
+    TsDocumentLoader mLoader;
+
+};
+
+#endif // TSDEVICEDIALOGCONTAINER_H
--- a/taskswitcherapp/tsdevicedialogplugin/inc/tsdevicedialogplugin.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/inc/tsdevicedialogplugin.h	Wed Jun 23 18:03:36 2010 +0300
@@ -49,6 +49,8 @@
     QAbstractListModel *mModel;
     TsTaskMonitor *mStorage;
 
+    bool mTriedToLoadTranslation;
+    
     Q_DISABLE_COPY(TsDeviceDialogPlugin)
 };
 
--- a/taskswitcherapp/tsdevicedialogplugin/inc/tstasksgriditem.h	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/inc/tstasksgriditem.h	Wed Jun 23 18:03:36 2010 +0300
@@ -19,7 +19,9 @@
 
 #include <hbabstractviewitem.h>
 
-class HbLabel;
+class HbTextItem;
+class HbIconItem;
+class HbFrameItem;
 class HbPushButton;
 
 class TsTasksGridItem : public HbAbstractViewItem
@@ -29,7 +31,6 @@
 public:
     TsTasksGridItem();
     TsTasksGridItem(const TsTasksGridItem &item);
-    ~TsTasksGridItem();
 
     HbAbstractViewItem *createItem();
     void updateChildItems();
@@ -41,10 +42,12 @@
     void deleteClicked(const QModelIndex &index);
 
 private:
-    HbLabel *mScreenshotLabel;
-    HbLabel *mApplicationNameLabel;
+    HbIconItem *mScreenshotLabel;
+    HbTextItem *mApplicationNameLabel;
     HbPushButton *mDeleteButton;
 
+    HbFrameItem *mActiveLabelFrame;
+    HbTextItem *mActiveLabel;
 };
 
 #endif //TSTASKSGRIDITEM_H
Binary file taskswitcherapp/tsdevicedialogplugin/resource/delete.png has changed
--- a/taskswitcherapp/tsdevicedialogplugin/resource/layout.docml	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/resource/layout.docml	Wed Jun 23 18:03:36 2010 +0300
@@ -1,25 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <hbdocument version="0.10">
-    <widget name="tsdevicedialog" type="TsDeviceDialog">
+    <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" />
         </widget>
         <widget name="taskgrid" role="HbDialog:contentWidget" type="TsTasksGrid">
-            <string name="scrollDirections" value="Horizontal"/>
-            <integer name="rowCount" value="1"/>
-            <integer name="columnCount" value="2"/>
+            <widget name="item" role="HbAbstractView:prototype" type="TsTasksGridItem"/>
             <bool name="longPressEnabled" value="FALSE"/>
+            <enums name="horizontalScrollBarPolicy" value="ScrollBarAlwaysOff"/>
         </widget>            
         <bool name="backgroundFaded" value="TRUE"/>
         <string name="dismissPolicy" value="TapOutside"/>
         <integer name="timeout" value="0"/>
         <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
-        <sizehint type="PREFERRED" width="320.0px" height="320.0px"/>
     </widget>
     <section name="portrait">
         <widget name="tsdevicedialog">
-            <sizehint type="PREFERRED" width="320.0px" height="320.0px"/>
+            <sizehint type="PREFERRED" width="48un" height="40un"/>
         </widget>
         <widget name="taskgrid">
             <string name="scrollDirections" value="Horizontal"/>
@@ -29,7 +27,7 @@
     </section>
     <section name="landscape">
         <widget name="tsdevicedialog">
-            <sizehint type="PREFERRED" width="500.0px" height="320.0px"/>
+            <sizehint type="PREFERRED" width="60un" height="40un"/>
         </widget>
         <widget name="taskgrid">
             <string name="scrollDirections" value="Horizontal"/>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/taskswitcherapp/tsdevicedialogplugin/resource/tstasksgriditem.css	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,52 @@
+TsTasksGridItem {
+    layout:custom;
+}
+
+TsTasksGridItem::appname {
+    text-align: center;
+    color: var(qtc_default_main_pane_normal);
+    font-variant: secondary;
+    text-height: var(hb-param-text-height-tiny);
+}
+
+TsTasksGridItem > HbPushButton#closebadge {
+    min-width: 7un;
+    min-height: 7un;
+}
+
+TsTasksGridItem::screenshotFrame {
+    zvalue: -1;
+}
+
+TsTasksGridItem::applicationLabelFrame {
+    zvalue: -1;
+}
+
+TsTasksGridItem > HbPushButton#closebadge::toucharea {
+    left: 1un;
+    right: -1un;
+    top: 1un;
+    bottom: -1un;
+}
+
+TsTasksGridItem > HbPushButton#closebadge::icon {
+    max-width: var(hb-param-graphic-size-primary-small);
+    max-height: var(hb-param-graphic-size-primary-small);
+}
+
+TsTasksGridItem::activeLabel  {
+    text-align: center;
+    color: var(qtc_default_main_pane_normal);
+    text-height: var(hb-param-text-height-tiny);
+    font-variant: secondary;
+    
+    zvalue: 2;
+    
+    /* workaround for mesh layout limitations */
+    max-height: 4un;
+    min-height: 4un;
+}
+
+TsTasksGridItem::activeLabelFrame {
+    zvalue: 1;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/taskswitcherapp/tsdevicedialogplugin/resource/tstasksgriditem.widgetml	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,34 @@
+<hbwidget version="0.1" type="TsTasksGridItem">
+    <layout name="custom" type="mesh">
+        <meshitem src="appname" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-4un"/>
+        <meshitem src="appname" srcEdge="LEFT" dst="screenshot" dstEdge="LEFT"/>
+        <meshitem src="appname" srcEdge="RIGHT" dst="screenshot" dstEdge="RIGHT"/>
+
+        <meshitem src="screenshot" srcEdge="TOP" dst="appname" dstEdge="BOTTOM" spacing="-1.5un"/>
+        <meshitem src="screenshot" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="1.5un"/>
+        <meshitem src="screenshot" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-1.5un"/>
+        <meshitem src="screenshot" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="4un"/>
+        
+        <meshitem src="screenshotFrame" srcEdge="TOP" dst="screenshot" dstEdge="TOP" spacing="0.5un"/>
+        <meshitem src="screenshotFrame" srcEdge="RIGHT" dst="screenshot" dstEdge="RIGHT" spacing="-0.5un"/>
+        <meshitem src="screenshotFrame" srcEdge="LEFT" dst="screenshot" dstEdge="LEFT" spacing="0.5un"/>
+        <meshitem src="screenshotFrame" srcEdge="BOTTOM" dst="screenshot" dstEdge="BOTTOM" spacing="-0.5un"/>
+        
+        <meshitem src="applicationLabelFrame" srcEdge="TOP" dst="appname" dstEdge="TOP"/>
+        <meshitem src="applicationLabelFrame" srcEdge="RIGHT" dst="appname" dstEdge="RIGHT"/>
+        <meshitem src="applicationLabelFrame" srcEdge="LEFT" dst="appname" dstEdge="LEFT"/>
+        <meshitem src="applicationLabelFrame" srcEdge="BOTTOM" dst="appname" dstEdge="BOTTOM"/>
+
+        <meshitem src="closebadge" srcEdge="TOP" dst="screenshot" dstEdge="TOP"/>
+        <meshitem src="closebadge" srcEdge="RIGHT" dst="screenshot" dstEdge="RIGHT"/>
+        
+        <meshitem src="activeLabel" srcEdge="RIGHT" dst="screenshot" dstEdge="RIGHT"/>
+        <meshitem src="activeLabel" srcEdge="LEFT" dst="screenshot" dstEdge="LEFT"/>
+        <meshitem src="activeLabel" srcEdge="BOTTOM" dst="screenshot" dstEdge="BOTTOM"/>
+        
+        <meshitem src="activeLabelFrame" srcEdge="TOP" dst="activeLabel" dstEdge="TOP"/>
+        <meshitem src="activeLabelFrame" srcEdge="RIGHT" dst="activeLabel" dstEdge="RIGHT"/>
+        <meshitem src="activeLabelFrame" srcEdge="LEFT" dst="activeLabel" dstEdge="LEFT"/>
+        <meshitem src="activeLabelFrame" srcEdge="BOTTOM" dst="activeLabel" dstEdge="BOTTOM"/>        
+    </layout>
+</hbwidget>
--- a/taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialog.cpp	Fri Jun 11 13:30:16 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: Default Screensaver runtime.
-*
-*/
-
-#include <HbMainWindow>
-#include <HbDocumentLoader>
-
-#include "tsdevicedialog.h"
-
-/*!
-    \class TsDeviceDialog
-    \ingroup group_tsdevicedialogplugin
-    \brief TaskSwitcher Device Dialog.
- */
-
-/*!
-    Constructor.
-    \param parent Parent.
- */
-TsDeviceDialog::TsDeviceDialog(HbDocumentLoader &loader, QGraphicsItem *parent) : HbDialog(parent), mLoader(loader)
-{
-    connect(mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(changeOrientation(Qt::Orientation)));
-    connect(this, SIGNAL(aboutToClose()), this, SIGNAL(deviceDialogClosed()));
-}
-
-TsDeviceDialog::~TsDeviceDialog()
-{
-    qDebug("Destruction");
-}
-
-/*!
-    Sets device dialog parameters.
-    \param parameters Device Dialog's parameters to be set.
-    \ret return true if parameters are correct.
- */
-bool TsDeviceDialog::setDeviceDialogParameters(const QVariantMap &parameters)
-{
-    Q_UNUSED(parameters);
-    return false;
-}
-
-/*!
-    Returns error code.
-    \ret error code.
- */
-int TsDeviceDialog::deviceDialogError() const
-{
-    return 0;
-}
-
-/*!
-    Closes device dialog.
-    \param byClient If dialog is close by client.
- */
-void TsDeviceDialog::closeDeviceDialog(bool byClient)
-{
-    Q_UNUSED(byClient)
-    hide();
-    emit deviceDialogClosed();
-}
-
-/*!
-    Returns device dialog instance.
-    \ret Device dialog instance.
- */
-HbPopup *TsDeviceDialog::deviceDialogWidget() const
-{
-    return const_cast<TsDeviceDialog *>(this);
-}
-
-void TsDeviceDialog::changeOrientation(Qt::Orientation orientation)
-{
-    qDebug("Loading DOCML data for orientation %d", orientation);
-    bool ok(true);
-    if (orientation == Qt::Horizontal) {
-        mLoader.load(":/xml/resource/layout.docml", "landscape", &ok);
-    } else {
-        mLoader.load(":/xml/resource/layout.docml", "portrait", &ok);
-    }
-    Q_ASSERT(ok);
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialogcontainer.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+#include "tsdevicedialogcontainer.h"
+
+#include <QAbstractListModel>
+
+#include <HbDialog>
+#include <HbMainWindow>
+
+#include "tstasksgrid.h"
+#include "tstasksgriditem.h"
+
+namespace {
+    const char KDocmlPath[] = ":/resource/layout.docml";
+}
+
+TsDeviceDialogContainer::TsDeviceDialogContainer(QAbstractListModel *model, QObject *parent) : QObject(parent)
+{
+    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"));
+    Q_ASSERT(dialog);
+    Q_ASSERT(grid);
+
+    changeOrientation(dialog->mainWindow()->orientation());
+
+    grid->setModel(model);
+
+    // 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(dialog->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(changeOrientation(Qt::Orientation)));
+    connect(dialog, SIGNAL(aboutToClose()), this, SIGNAL(deviceDialogClosed()));
+}
+
+TsDeviceDialogContainer::~TsDeviceDialogContainer()
+{
+}
+
+bool TsDeviceDialogContainer::setDeviceDialogParameters(const QVariantMap &parameters)
+{
+    Q_UNUSED(parameters);
+    return false;
+}
+
+int TsDeviceDialogContainer::deviceDialogError() const
+{
+    return 0;
+}
+
+void TsDeviceDialogContainer::closeDeviceDialog(bool byClient)
+{
+    Q_UNUSED(byClient)
+    // @todo: should there be hide calls? deviceDialogWidget->hide();
+    emit deviceDialogClosed();
+}
+
+HbPopup *TsDeviceDialogContainer::deviceDialogWidget() const
+{
+    HbDialog *widget = qobject_cast<HbDialog*>(mLoader.findWidget("tsdevicedialog"));
+    Q_ASSERT(widget);
+    return widget;
+}
+
+QObject *TsDeviceDialogContainer::signalSender() const
+{
+    return const_cast<TsDeviceDialogContainer*>(this);
+}
+
+void TsDeviceDialogContainer::changeOrientation(Qt::Orientation orientation)
+{
+    bool ok(true);
+    if (orientation == Qt::Horizontal) {
+        mLoader.load(KDocmlPath, "landscape", &ok);
+    } else {
+        mLoader.load(KDocmlPath, "portrait", &ok);
+    }
+    Q_ASSERT(ok);
+}
--- a/taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/src/tsdevicedialogplugin.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -15,13 +15,18 @@
 *
 */
 
+#include <QTranslator>
+#include <QCoreApplication>
+#include <QLocale>
 #include <QtPlugin>
+
+#include <qservicemanager.h>
+
 #include <hbdevicedialog.h>
 #include <HbMainWindow>
-#include <qservicemanager.h>
 
 #include "tsdevicedialogplugin.h"
-#include "tsdevicedialog.h"
+#include "tsdevicedialogcontainer.h"
 #include "tstasksgrid.h"
 #include "tstasksgriditem.h"
 #include "tsdocumentloader.h"
@@ -33,12 +38,16 @@
     \brief TaskSwitcher Device Dialog Plug-in.
  */
 
-const QString KTsDialogType = "com.nokia.taskswitcher.tsdevicedialogplugin/1.0";
-
+namespace
+{
+    const char KTranslationPath[] = "resource/qt/translations";
+    const char KTsDialogType[] = "com.nokia.taskswitcher.tsdevicedialogplugin/1.0";
+} 
+ 
 /*!
     Constructor.
  */
-TsDeviceDialogPlugin::TsDeviceDialogPlugin() : mError(0), mModel(0), mStorage(0)
+TsDeviceDialogPlugin::TsDeviceDialogPlugin() : mError(0), mModel(0), mStorage(0), mTriedToLoadTranslation(false)
 {
 }
 
@@ -56,7 +65,7 @@
     Q_UNUSED(securityInfo)
 
     // This plugin doesn't perform operations that may compromise security.
-    // All clients are allowed to use.
+    // All clients are allowed to use it.
     return true;
 }
 
@@ -66,53 +75,50 @@
 HbDeviceDialogInterface *TsDeviceDialogPlugin::createDeviceDialog(const QString &deviceDialogType, const QVariantMap &parameters)
 {
     Q_UNUSED(parameters)
-    TsDeviceDialog *dialog(0);
-    if (deviceDialogType == KTsDialogType) {
+    HbDeviceDialogInterface *dialogInterface(0);
+    if (deviceDialogType == QString(KTsDialogType)) {
+        // lazy loading of translation
+        if (!mTriedToLoadTranslation) {
+            mTriedToLoadTranslation = true;
+
+            QTranslator *translator = new QTranslator(this);
+            QString translationFile = QString("taskswitcher_%1").arg(QLocale::system().name());
+    
+            bool translationLoaded(false);
+            #ifdef Q_OS_SYMBIAN
+                translationLoaded = translator->load(translationFile, QString("z:/") + KTranslationPath);
+                if (!translationLoaded) {
+                    translationLoaded = translator->load(translationFile, QString("c:/") + KTranslationPath);
+                }
+            #else
+                translationLoaded = translator->load(translationFile, QString(KTranslationPath));
+            #endif //Q_OS_SYMBIAN
+
+            Q_ASSERT(translationLoaded);
+            qApp->installTranslator(translator);
+        }
+    
+        // lazy loading of model
         if (0 == mModel) {
             mStorage = new TsTaskMonitor(this);
             if (0 == mStorage) {
-                return 0;
+                return 0; // provider of running application list is critical
             }
+            
             QtMobility::QServiceManager serviceManager;
-            QObject *objPtr(serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager"));
-            if (objPtr) {
-                objPtr->setParent(this);//make it autodestucted
+            QObject *activityManager(serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager"));
+            if (activityManager) {
+                activityManager->setParent(this); //make it autodestructed
             } else {
-                objPtr = this;//activity plugin is not present. provide invalid instance because its not critical functionality.
+                activityManager = this; //activity plugin is not present. provide invalid instance because its not critical functionality.
                 //QMetaObject::invokeMethod is safe to use in such a case.
             }
-            mModel = new TsModel(*mStorage, *objPtr);
+            mModel = new TsModel(*mStorage, *activityManager);
         }
-
-        mLoader.reset();
-        bool ok(true);
-        mLoader.load(":/xml/resource/layout.docml", &ok);
-        Q_ASSERT(ok);
-
-        dialog = qobject_cast<TsDeviceDialog *>(mLoader.findWidget("tsdevicedialog"));
-        TsTasksGrid *grid = qobject_cast<TsTasksGrid *>(mLoader.findWidget("taskgrid"));
-        Q_ASSERT(dialog);
-        Q_ASSERT(grid);
-
-        dialog->changeOrientation(dialog->mainWindow()->orientation());
-
-        grid->setItemPrototype(new TsTasksGridItem());
-        grid->setModel(mModel);
-
-        //static_cast<TsModel *>(mModel)->updateModel();
-
-        // connect the grid and model
-        qRegisterMetaType<QModelIndex>("QModelIndex");
         
-        disconnect(grid, SIGNAL(activated(QModelIndex)), mModel, SLOT(openApplication(QModelIndex)));
-        disconnect(grid, SIGNAL(activated(QModelIndex)), dialog, SLOT(close()));
-        disconnect(grid, SIGNAL(deleteButtonClicked(QModelIndex)), mModel, SLOT(closeApplication(QModelIndex)));
-        
-        connect(grid, SIGNAL(activated(QModelIndex)), mModel, SLOT(openApplication(QModelIndex)));
-        connect(grid, SIGNAL(activated(QModelIndex)), dialog, SLOT(close()));
-        connect(grid, SIGNAL(deleteButtonClicked(QModelIndex)), mModel, SLOT(closeApplication(QModelIndex)), Qt::QueuedConnection);
+        dialogInterface = new TsDeviceDialogContainer(mModel);
     }
-    return dialog;
+    return dialogInterface;
 }
 
 /*!
@@ -135,7 +141,7 @@
  */
 QStringList TsDeviceDialogPlugin::deviceDialogTypes() const
 {
-    return QStringList(KTsDialogType);
+    return QStringList(QString(KTsDialogType));
 }
 
 /*!
--- a/taskswitcherapp/tsdevicedialogplugin/src/tsdocumentloader.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/src/tsdocumentloader.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -17,7 +17,7 @@
 
 #include "tsdocumentloader.h"
 #include "tstasksgrid.h"
-#include "tsdevicedialog.h"
+#include "tstasksgriditem.h"
 
 /*!
     \class TsDocumentLoader
@@ -33,8 +33,8 @@
         QObject *object = new TsTasksGrid();
         object->setObjectName(name);
         return object;
-    } else if (type == TsDeviceDialog::staticMetaObject.className()) {
-        QObject *object = new TsDeviceDialog(*this);
+    } else if (type == TsTasksGridItem::staticMetaObject.className()) {
+        QObject *object = new TsTasksGridItem();
         object->setObjectName(name);
         return object;
     }
--- a/taskswitcherapp/tsdevicedialogplugin/src/tsmodel.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/src/tsmodel.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -201,7 +201,7 @@
 void TsModel::prepareActivityEntry(QVariantHash &activity)
 {
     activity.insert(TsActivityModelItem::applicationKeyword(),
-                    activity.find(ActivityActivityKeyword) == activity.end() ?
+                    activity.find(ActivityApplicationKeyword) == activity.end() ?
                     QString::null :
                     getApplicationName(activity[ActivityApplicationKeyword].toInt()));
 }
@@ -228,12 +228,9 @@
 */
 void TsModel::entryChanged(TsModelItem *itemPtr)
 {
-    QList<TsModelItem *>::const_iterator iter(mEntries.constBegin());
-    for (int offset(0); iter != mEntries.constEnd(); ++iter, ++offset) {
-        if ((*iter) == itemPtr) {
-            emit dataChanged(index(offset, 0), index(offset, 0));
-            break;
-        }
+    const int itemIndex = mEntries.indexOf(itemPtr);
+    if (itemIndex != -1) {
+        emit dataChanged(index(itemIndex, 0), index(itemIndex, 0));
     }
 }
 
--- a/taskswitcherapp/tsdevicedialogplugin/src/tstasksgriditem.cpp	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/src/tstasksgriditem.cpp	Wed Jun 23 18:03:36 2010 +0300
@@ -16,10 +16,13 @@
 */
 #include "tstasksgriditem.h"
 
-#include <hblabel.h>
-#include <hbpushbutton.h>
-#include <hbabstractitemview.h>
-#include <hbanchorlayout.h>
+#include <HbPushButton>
+#include <HbAbstractItemView>
+#include <HbFrameItem>
+#include <HbTextItem>
+#include <HbIconItem>
+#include <HbStyleLoader>
+
 #include "tsdataroles.h"
 
 /*!
@@ -29,51 +32,44 @@
 */
 
 
-TsTasksGridItem::TsTasksGridItem() : HbAbstractViewItem(), mScreenshotLabel(0), mApplicationNameLabel(0), mDeleteButton(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");
+    Q_ASSERT(widgetmlLoaded);
+    bool cssLoaded = HbStyleLoader::registerFilePath(":/resource/tstasksgriditem.css");
+    Q_ASSERT(cssLoaded);
 }
 
 TsTasksGridItem::TsTasksGridItem(const TsTasksGridItem &item) : HbAbstractViewItem(item)
 {
-    // add screenshot
-    mScreenshotLabel = new HbLabel();
-    mScreenshotLabel->setAlignment(Qt::AlignHCenter);
-
-    // add application name label
-    mApplicationNameLabel = new HbLabel();
-    mApplicationNameLabel->setAlignment(Qt::AlignCenter);
+    mScreenshotLabel = new HbIconItem(this);
+    mApplicationNameLabel = new HbTextItem(this);
+    mDeleteButton = new HbPushButton(this);
+    HbFrameItem *screenshotFrame = new HbFrameItem(this);    
+    screenshotFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    screenshotFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
 
-    // add close app button
-    HbIcon deleteIcon(":/resource/delete.png");
-    mDeleteButton = new HbPushButton();
-    mDeleteButton->setIcon(deleteIcon);
-    mDeleteButton->setPreferredSize(48, 48);
-    mDeleteButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
-    mDeleteButton->setEnabled(true);
-    connect(mDeleteButton, SIGNAL(clicked()), this, SLOT(handleDeleteClicked()));
-    mDeleteButton->hide();
-
-    setContentsMargins(5, 5, 5, 5);
+    HbFrameItem *applicationLabelFrame = new HbFrameItem(this);
+    applicationLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    applicationLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
 
-    // add all items to layout
-    HbAnchorLayout *anchorLayout = new HbAnchorLayout();
-    anchorLayout->setAnchor(mApplicationNameLabel, Hb::LeftEdge, anchorLayout, Hb::LeftEdge, 0);
-    anchorLayout->setAnchor(mApplicationNameLabel, Hb::TopEdge, anchorLayout, Hb::TopEdge, 0);
-    anchorLayout->setAnchor(mApplicationNameLabel, Hb::RightEdge, anchorLayout, Hb::RightEdge, 0);
+    mActiveLabel = new HbTextItem(hbTrId("txt_tsw_label_active"), this);
+    mActiveLabelFrame = new HbFrameItem(this);
+    mActiveLabelFrame->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
+    mActiveLabelFrame->frameDrawer().setFrameGraphicsName("qtg_fr_multimedia_trans");
+
+    mDeleteButton->setIcon(HbIcon("qtg_mono_exit"));
 
-    anchorLayout->setAnchor(mScreenshotLabel, Hb::TopEdge, mApplicationNameLabel, Hb::BottomEdge, 0);
-    anchorLayout->setAnchor(mScreenshotLabel, Hb::LeftEdge, anchorLayout, Hb::LeftEdge, 0);
-    anchorLayout->setAnchor(mScreenshotLabel, Hb::RightEdge, anchorLayout, Hb::RightEdge, 0);
-    anchorLayout->setAnchor(mScreenshotLabel, Hb::BottomEdge, anchorLayout, Hb::BottomEdge, 0);
-
-    anchorLayout->setAnchor(mDeleteButton, Hb::RightEdge, mScreenshotLabel, Hb::RightEdge, 0);
-    anchorLayout->setAnchor(mDeleteButton, Hb::TopEdge, mScreenshotLabel, Hb::TopEdge, 0);
-
-    setLayout(anchorLayout);
-}
-
-TsTasksGridItem::~TsTasksGridItem()
-{
+    HbStyle::setItemName(mScreenshotLabel, "screenshot");
+    HbStyle::setItemName(mApplicationNameLabel, "appname");
+    HbStyle::setItemName(mDeleteButton, "closebadge");
+    mDeleteButton->setObjectName("closebadge");
+    HbStyle::setItemName(screenshotFrame, "screenshotFrame");
+    HbStyle::setItemName(applicationLabelFrame, "applicationLabelFrame");
+    HbStyle::setItemName(mActiveLabel, "activeLabel");
+    HbStyle::setItemName(mActiveLabelFrame, "activeLabelFrame");
+    connect(mDeleteButton, SIGNAL(clicked()), this, SLOT(handleDeleteClicked()));
 }
 
 HbAbstractViewItem *TsTasksGridItem::createItem()
@@ -91,12 +87,16 @@
 void TsTasksGridItem::updateChildItems()
 {
     mScreenshotLabel->setIcon(modelIndex().data(Qt::DecorationRole).value<HbIcon>());
-    mApplicationNameLabel->setPlainText(modelIndex().data(Qt::DisplayRole).toString());
+    mApplicationNameLabel->setText(modelIndex().data(Qt::DisplayRole).toString());
     QVariant status(modelIndex().data(TsDataRoles::Closable));
     const bool isRunning(status.isValid() && status.toBool());
     if (isRunning) {
         mDeleteButton->show();
+        mActiveLabel->show();
+        mActiveLabelFrame->show();
     } else {
         mDeleteButton->hide();
+        mActiveLabel->hide();
+        mActiveLabelFrame->hide();
     }
 }
--- a/taskswitcherapp/tsdevicedialogplugin/tsdevicedialogplugin.pro	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/tsdevicedialogplugin.pro	Wed Jun 23 18:03:36 2010 +0300
@@ -20,7 +20,7 @@
 
 include (../common.pri)
 
-HEADERS +=  inc/tsdevicedialog.h \
+HEADERS +=  inc/tsdevicedialogcontainer.h \
             inc/tsdevicedialogplugin.h \
             inc/tsmodel.h \
             inc/tsmodelitem.h \
@@ -31,7 +31,7 @@
             inc/tsdocumentloader.h \
             inc/tsdataroles.h \
 
-SOURCES +=  src/tsdevicedialog.cpp \
+SOURCES +=  src/tsdevicedialogcontainer.cpp \
             src/tsdevicedialogplugin.cpp \
             src/tsmodel.cpp \
             src/tsentrymodelitem.cpp \
@@ -55,7 +55,7 @@
     pluginstub.sources = tsdevicedialogplugin.dll
     pluginstub.path = /resource/plugins/devicedialogs
     
-    LIBS += -lxqsettingsmanager
+    LIBS += -lxqsettingsmanager -lapparc -lapgrfx
     
     # ugly hack
     translation.sources = ./*.qm
--- a/taskswitcherapp/tsdevicedialogplugin/tsdevicedialogplugin.qrc	Fri Jun 11 13:30:16 2010 +0300
+++ b/taskswitcherapp/tsdevicedialogplugin/tsdevicedialogplugin.qrc	Wed Jun 23 18:03:36 2010 +0300
@@ -1,8 +1,7 @@
 <RCC>
-    <qresource prefix="/xml">
+    <qresource prefix="/">
         <file>resource/layout.docml</file>
-    </qresource>
-    <qresource prefix="/" >
-        <file>resource/delete.png</file>
+        <file>resource/tstasksgriditem.widgetml</file>
+        <file>resource/tstasksgriditem.css</file>        
     </qresource>
 </RCC>