201021
authorhgs
Fri, 28 May 2010 21:11:54 +0530
changeset 43 72396548277c
parent 42 5e1df1b52eb3
child 44 aa2fa096cbfb
201021
commonutilities/common/group/bld.inf
data/photos.docml
data/photos.splashml
data/transitionrotate0.fxml
data/transitionrotate180.fxml
data/transitionrotate270.fxml
data/transitionrotate90.fxml
data/zoomin.fxml
data/zoomout.fxml
engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp
engine/collectionframework/datasource/manager/src/glxdatasource.cpp
engine/collectionframework/datasource/manager/src/glxdatasourcetask.cpp
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/group/glxdatasourcemde.mmp
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcemds.h
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcemds.inl
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmds.h
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsattribute.h
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdscommand.h
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsidlist.h
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsthumbnail.h
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/mthumbnailfetchrequestobserver.h
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemdsproxy.cpp
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsattribute.cpp
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsidlist.cpp
engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsthumbnail.cpp
engine/collectionframework/plugins/glxcollectionpluginimageviewer/src/glxcollectionpluginimageviewer.cpp
engine/collectionframework/plugins/glxcollectionpluginmonths/inc/glxcollectionpluginmonths.h
engine/collectionframework/plugins/glxcollectionpluginmonths/src/glxcollectionpluginmonths.cpp
engine/collectionframework/plugins/tagcollectionplugin/src/glxcollectionplugintags.cpp
gallery/sis/photos.pkg
gallery/sis/photos_stub.pkg
inc/glxfiltergeneraldefs.h
inc/glxfilterproperties.h
inc/glxlocalisationstrings.h
inc/glxtvconstants.h
photos.qrc
rom/photos.iby
tvout/bwins/glxtvoutwrapperu.def
tvout/eabi/glxtvoutwrapperu.def
tvout/tvoutengine/bwins/glxtvoutu.def
tvout/tvoutengine/eabi/glxtvoutu.def
tvout/tvoutengine/group/glxtvout.mmp
tvout/tvoutengine/inc/glxhdmicontainer.h
tvout/tvoutengine/inc/glxhdmicontroller.h
tvout/tvoutengine/inc/glxhdmisurfaceupdater.h
tvout/tvoutengine/inc/glxtv.h
tvout/tvoutengine/inc/glxtvconnectionmonitor.h
tvout/tvoutengine/src/glxhdmicontainer.cpp
tvout/tvoutengine/src/glxhdmicontroller.cpp
tvout/tvoutengine/src/glxhdmisurfaceupdater.cpp
tvout/tvoutengine/src/glxtv.cpp
tvout/tvoutengine/src/glxtvconnectionmonitor.cpp
tvout/tvoutwrapper/inc/glxtvoutwrapper.h
tvout/tvoutwrapper/inc/glxtvoutwrapper_p.h
tvout/tvoutwrapper/src/glxtvoutwrapper.cpp
tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp
ui/bwins/glxviewsu.def
ui/bwins/glxviewutilitiesu.def
ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp
ui/eabi/glxviewsu.def
ui/eabi/glxviewutilitiesu.def
ui/inc/glxcommandhandlers.hrh
ui/inc/glxuistd.h
ui/ui.pro
ui/uiengine/medialistwrapper/inc/glxmlwrapper_p.h
ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp
ui/uiengine/model/mediamodel/src/glxmediamodel.cpp
ui/viewmanagement/statehandler/inc/glxstatemanager.h
ui/viewmanagement/statehandler/inc/glxtnobserver.h
ui/viewmanagement/statehandler/src/glxstatemanager.cpp
ui/viewmanagement/statehandler/src/glxtnobserver.cpp
ui/viewmanagement/viewmanager/inc/glxviewmanager.h
ui/viewmanagement/viewmanager/src/glxviewmanager.cpp
ui/viewmanagement/viewmanager/viewmanager.pro
ui/views/detailsview/src/glxdetailsview.cpp
ui/views/fullscreenview/inc/glxcoverflow.h
ui/views/fullscreenview/inc/glxzoomwidget.h
ui/views/fullscreenview/src/glxcoverflow.cpp
ui/views/fullscreenview/src/glxfullscreenview.cpp
ui/views/fullscreenview/src/glxzoomwidget.cpp
ui/views/gridview/inc/glxgridview.h
ui/views/gridview/src/glxgridview.cpp
ui/views/slideshowsettingsview/inc/glxslideshowsettingsview.h
ui/views/slideshowsettingsview/src/glxslideshowsettingsview.cpp
ui/views/slideshowview/inc/glxslideshowwidget.h
ui/views/slideshowview/src/glxslideshowview.cpp
ui/views/slideshowview/src/glxslideshowwidget.cpp
ui/views/views.pro
ui/viewutilities/effectengine/inc/glxeffectengine.h
ui/viewutilities/effectengine/inc/glxtransitioneffect.h
ui/viewutilities/effectengine/src/glxeffectengine.cpp
ui/viewutilities/effectengine/src/glxtransitioneffect.cpp
ui/viewutilities/effectplugin/inc/glxeffectpluginbase.h
ui/viewutilities/effectplugin/inc/glxeffectpluginresolver.h
ui/viewutilities/effectplugin/inc/glxfadeeffectplugin.h
ui/viewutilities/effectplugin/inc/glxflipeffectplugin.h
ui/viewutilities/effectplugin/inc/glxzoominoutplugin.h
ui/viewutilities/effectplugin/src/glxeffectpluginresolver.cpp
ui/viewutilities/effectplugin/src/glxfadeeffectplugin.cpp
ui/viewutilities/effectplugin/src/glxflipeffectplugin.cpp
ui/viewutilities/effectplugin/src/glxzoominoutplugin.cpp
ui/viewutilities/settingutility/inc/glxsetting.h
ui/viewutilities/settingutility/inc/glxsettinginterface.h
ui/viewutilities/settingutility/src/glxsetting.cpp
ui/viewutilities/settingutility/src/glxsettinginterface.cpp
ui/viewutilities/viewutilities.pro
ui/widgets/bwins/glxzoomwidgetu.def
ui/widgets/eabi/glxzoomwidgetu.def
ui/widgets/glxzoomwidget/glxzoomwidget.pro
ui/widgets/glxzoomwidget/inc/glxzoomwidget.h
ui/widgets/glxzoomwidget/inc/glxzoomwidget_global.h
ui/widgets/glxzoomwidget/src/glxzoomwidget.cpp
ui/widgets/widgets.pro
--- a/commonutilities/common/group/bld.inf	Mon May 17 13:35:26 2010 +0530
+++ b/commonutilities/common/group/bld.inf	Fri May 28 21:11:54 2010 +0530
@@ -46,9 +46,8 @@
 	// for emulator
 	../cenrep/200009EE_orientation_portrait_landscape.txt   /epoc32/release/winscw/udeb/z/private/10202be9/200009EE.txt
 	//slideshow settings cenrep initialisation file
-	../cenrep/20007194.txt   /epoc32/data/z/private/10202be9/20007194.txt
-	../cenrep/20007194.txt   /epoc32/release/winscw/udeb/z/private/10202be9/20007194.txt
-	../cenrep/20007194.txt   /epoc32/release/winscw/urel/z/private/10202be9/20007194.txt	
+	../cenrep/20007194.txt   z:/private/10202be9/20007194.txt
+	
 	
 #endif
 
@@ -58,6 +57,8 @@
 
 ../../../conf/slideshowsettings.confml                        CONFML_EXPORT_PATH(slideshowsettings.confml,customsw)
 ../../../conf/slideshowsettings_20007194.crml	        CRML_EXPORT_PATH(slideshowsettings_20007194.crml,customsw)
+../../../data/photos.docml		z:/resource/hb/splashml/photos.docml
+../../../data/photos.splashml	z:/resource/hb/splashml/photos.splashml
 PRJ_MMPFILES
 glxcommon.mmp
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/photos.docml	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+    <object name="action" type="HbAction">
+        <bool name="checkable" value="TRUE"/>
+        <bool name="enabled" value="FALSE"/>
+        <icon iconName="qtg_mono_photos" name="icon"/>
+        <string name="text"/>
+        <bool name="visible" value="TRUE"/>
+    </object>
+    <object name="action_1" type="HbAction">
+        <bool name="checkable" value="TRUE"/>
+        <bool name="enabled" value="TRUE"/>
+        <icon iconName="qtg_mono_photo_albums" name="icon"/>
+        <string name="text"/>
+    </object>
+    <object name="action_2" type="HbAction">
+        <icon iconName="qtg_mono_camera" name="icon"/>
+        <string name="text"/>
+    </object>
+    <object name="action_3" type="HbAction">
+        <icon iconName="qtg_small_ovi" name="icon"/>
+        <string name="text"/>
+    </object>
+    <widget name="mainView" type="HbView">
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <layout type="anchor"/>
+        </widget>
+        <widget name="viewToolbar" role="HbView:toolBar" type="HbToolBar">
+            <ref object="action" role="HbWidget:addAction"/>
+            <ref object="action_1" role="HbWidget:addAction"/>
+            <ref object="action_2" role="HbWidget:addAction"/>
+            <ref object="action_3" role="HbWidget:addAction"/>
+        </widget>
+        <string locid="txt_photos_title_photos" name="title" value="Photos"/>
+    </widget>
+    <section name="portrait"/>
+    <section name="landscape">
+        <widget name="content" role="HbView:widget" type="HbWidget">
+            <widget name="pushButton" type="HbPushButton">
+                <icon iconName="qtg_mono_back" name="icon"/>
+                <real name="z" value="1"/>
+                <sizehint type="PREFERRED" width="10.59702un"/>
+                <string name="text"/>
+                <sizehint height="5.5un" type="MINIMUM" width="5un"/>
+            </widget>
+            <layout type="anchor">
+                <anchoritem dst="pushButton" dstEdge="TOP" spacing="0.14925un" src="" srcEdge="TOP"/>
+                <anchoritem dst="pushButton" dstEdge="RIGHT" spacing="-0.14925un" src="" srcEdge="RIGHT"/>
+            </layout>
+        </widget>
+        <widget name="mainView" type="HbView">
+            <enums name="titleBarFlags" value="TitleBarHidden"/>
+        </widget>
+        <widget name="viewToolbar" role="HbView:toolBar" type="HbToolBar">
+            <bool name="visible" value="FALSE"/>
+        </widget>
+    </section>
+    <metadata activeUIState="landscape" display="NHD-3.2-inch_landscape" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+        <uistate name="portrait" sections="#common portrait"/>
+        <uistate name="landscape" sections="#common landscape"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/photos.splashml	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,8 @@
+<hbsplash version="1">
+          <docml>photos.docml</docml>
+          <widget>mainView</widget>
+          <appuid>0x20000A14</appuid>
+          <tsappname>photos</tsappname>
+          <use-section when="portrait">portrait</use-section>
+     	  <use-section when="landscape">landscape</use-section>
+      </hbsplash>
--- a/data/transitionrotate0.fxml	Mon May 17 13:35:26 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<layers>
-	<visual>
-	    <param name="rotation_angle" type="anim">
-	        <duration>0.5</duration>
-		    <keyframe at="0.0">0</keyframe>	
-	            <keyframe at="1.0">90</keyframe>
-	     </param>
-   	    
-	    <param name="rotation_origin_x" ref="visual.width">0.5</param>
-	    <param name="rotation_origin_y" ref="visual.height">0.5</param>
-	    <param name="rotation_axis_z">1</param>
-    	    
-	</visual>
-</layers>
--- a/data/transitionrotate180.fxml	Mon May 17 13:35:26 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<layers>
-	<visual>
-	    <param name="rotation_angle" type="anim">
-	        <duration>0.5</duration>
-		    <keyframe at="0.0">180</keyframe>	
-	            <keyframe at="1.0">270</keyframe>
-	     </param>
-   	    
-	    <param name="rotation_origin_x" ref="visual.width">0.5</param>
-	    <param name="rotation_origin_y" ref="visual.height">0.5</param>
-	    <param name="rotation_axis_z">1</param>
-    	    
-	</visual>
-</layers>
--- a/data/transitionrotate270.fxml	Mon May 17 13:35:26 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<layers>
-	<visual>
-	    <param name="rotation_angle" type="anim">
-	        <duration>0.5</duration>
-		    <keyframe at="0.0">-90</keyframe>	
-	            <keyframe at="1.0">0</keyframe>
-	     </param>
-   	    
-	    <param name="rotation_origin_x" ref="visual.width">0.5</param>
-	    <param name="rotation_origin_y" ref="visual.height">0.5</param>
-	    <param name="rotation_axis_z">1</param>
-    	    
-	</visual>
-</layers>
--- a/data/transitionrotate90.fxml	Mon May 17 13:35:26 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-<layers>
-	<visual>
-	    <param name="rotation_angle" type="anim">
-	        <duration>0.5</duration>
-		    <keyframe at="0.0">90</keyframe>	
-	            <keyframe at="1.0">180</keyframe>
-	     </param>
-   	    
-	    <param name="rotation_origin_x" ref="visual.width">0.5</param>
-	    <param name="rotation_origin_y" ref="visual.height">0.5</param>
-	    <param name="rotation_axis_z">1</param>
-    	    
-	</visual>
-</layers>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/zoomin.fxml	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<layers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:noNamespaceSchemaLocation="http://www.nokia.com/FXML/10.1">
+	<comment>Created using carbide.fx 1.5.0;  FxML revision 0.84; Platform 10.1 </comment>
+	<visual src="Item">
+		<param name="scale_y" type="anim">
+			<style>linear</style>
+			<duration>0.6</duration>
+			<keyframe at="0.0">1.0</keyframe>
+			<keyframe at="1.0">0.1</keyframe>
+		</param>
+		<param name="scale_origin_x" ref="visual.width">0.5</param>
+		<param name="scale_origin_y" ref="visual.height">0.5</param>
+		<param name="scale_x" type="anim">
+			<style>linear</style>
+			<duration>0.6</duration>
+			<keyframe at="0.0">1.0</keyframe>
+			<keyframe at="1.0">0.1</keyframe>
+		</param>
+		<param name="opacity" type="anim">
+			<style>linear</style>
+			<duration>0.6</duration>
+			<keyframe at="0.0">1.0</keyframe>
+			<keyframe at="1.0">0.0</keyframe>
+		</param>
+	</visual>
+</layers>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data/zoomout.fxml	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<layers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:noNamespaceSchemaLocation="http://www.nokia.com/FXML/10.1">
+	<comment>Created using carbide.fx 1.5.0;  FxML revision 0.84; Platform 10.1 </comment>
+	<visual src="Item">
+		<param name="scale_x" type="anim">
+			<style>linear</style>
+			<duration>0.6</duration>
+			<keyframe at="0.0">0.1</keyframe>
+			<keyframe at="1.0">1.0</keyframe>
+		</param>
+		<param name="scale_origin_x" ref="visual.width">0.5</param>
+		<param name="scale_origin_y" ref="visual.height">0.5</param>
+		<param name="scale_y" type="anim">
+			<style>linear</style>
+			<duration>0.6</duration>
+			<keyframe at="0.0">0.1</keyframe>
+			<keyframe at="1.0">1.0</keyframe>
+		</param>
+		<param name="opacity" type="anim">
+			<style>linear</style>
+			<duration>0.6</duration>
+			<keyframe at="0.0">0.0</keyframe>
+			<keyframe at="1.0">1.0</keyframe>
+		</param>
+	</visual>
+</layers>
\ No newline at end of file
--- a/engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp	Fri May 28 21:11:54 2010 +0530
@@ -102,26 +102,40 @@
 // ----------------------------------------------------------------------------
 //
 EXPORT_C void CGlxCollectionPluginBase::OpenL(const CMPXCollectionPath& aPath,
-                   const TArray<TMPXAttribute>& /*aAttrs*/,
+                   const TArray<TMPXAttribute>& aAttrs,
                    CMPXFilter* aFilter)
     {
     TRACER("void CGlxCollectionPluginBase::OpenL()");
     iPath = CMPXCollectionPath::NewL(aPath);
-    if(aFilter)
+    // When a collection is opened for browsing, 
+    // there are two queries executed with similar filter. 
+    // First query to open the collection from list / cloud view.
+    // Second one from grid view construction. To improve the grid opening
+    // performance, the first query will be completed with empty Id list.
+    TBool openRequest = EFalse;
+    for (TInt index = 0; index < aAttrs.Count(); index++)
         {
-        if(aFilter->IsSupported(KGlxFilterGeneralNavigationalStateOnly))
+        const TMPXAttribute attr = aAttrs[index];
+
+        if (attr == KGlxFilterGeneralNavigationalStateOnly)
             {
-            RArray<TMPXItemId> mpxIds;
-         	CleanupClosePushL(mpxIds);
-            iPath->AppendL(mpxIds.Array());
-            iObs->HandleOpen(iPath, KErrNone);
-            CleanupStack::PopAndDestroy(&mpxIds);
-            delete iPath;
-            iPath = NULL;
-            return;
+            openRequest = ETrue;
             }
         }
 
+    if ((aFilter && aFilter->IsSupported(
+            KGlxFilterGeneralNavigationalStateOnly)) || openRequest)
+        {
+        RArray<TMPXItemId> mpxIds;
+        CleanupClosePushL(mpxIds);
+        iPath->AppendL(mpxIds.Array());
+        iObs->HandleOpen(iPath, KErrNone);
+        CleanupStack::PopAndDestroy(&mpxIds);
+        delete iPath;
+        iPath = NULL;
+        return;
+        }
+
     TGlxMediaId targetId(aPath.Id());
     if (aPath.Levels() == KGlxCollectionRootLevel)
         {
@@ -218,7 +232,7 @@
 	    
 	    if(aSpecs->IsSupported(KMPXMediaGeneralSize))
 	    	{
-	    	tnFileInfo->iFileSize = aSpecs->ValueTObjectL<TInt>(KMPXMediaGeneralSize);
+	    	tnFileInfo->iFileSize = aSpecs->ValueTObjectL<TUint>(KMPXMediaGeneralSize);
 	    	countInfo++;
 	    	}
 	    if(aSpecs->IsSupported(KGlxMediaGeneralLastModifiedDate))
--- a/engine/collectionframework/datasource/manager/src/glxdatasource.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/manager/src/glxdatasource.cpp	Fri May 28 21:11:54 2010 +0530
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:   
+* Description: Implementation of the Data Source Class.
 *
 */
 
--- a/engine/collectionframework/datasource/manager/src/glxdatasourcetask.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/manager/src/glxdatasourcetask.cpp	Fri May 28 21:11:54 2010 +0530
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:   
+* Description: Data Source Task Class.
 *
 */
 
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/group/glxdatasourcemde.mmp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/group/glxdatasourcemde.mmp	Fri May 28 21:11:54 2010 +0530
@@ -94,4 +94,6 @@
 LIBRARY         platformenv.lib
 LIBRARY         flogger.lib
 LIBRARY         imageconversion.lib
+LIBRARY	   	harvesterclient.lib
+
 // End of File
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcemds.h	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcemds.h	Fri May 28 21:11:54 2010 +0530
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:   
+* Description: The data source mds class   
 *
 */
 
@@ -29,10 +29,18 @@
 #define _C_GLXDATASOURCEMDS_H_
 
 // INCLUDES
+#include <e32base.h>
+#include <w32std.h>
+#include <e32property.h> 
+
 #include <e32cmn.h>
 #include <f32file.h>
 
 #include <mdesession.h>
+
+#include <harvesterclient.h>
+#include <harvestereventenum.h>
+
 #include <mglxtnstorage.h>
 #include <mpxcollectionmessagedefs.h>
 
@@ -44,16 +52,104 @@
 
 #include "mthumbnailfetchrequestobserver.h"
 #endif
-
 #include "glxdatasource.h"
 
 // FORWARD DECLARATIONS
 class CGlxRequest;
-
 #ifndef USE_S60_TNM
 class CGlxtnThumbnailCreator;
 class CGlxtnThumbnailDatabase;
 #endif
+class CGlxDataSourceMde ;
+
+const TUid KHarvesterPSShutdown = { 0x200009F5 } ;
+const TInt KMdSShutdown     = 0x00000002; // values 1 = shutdown, 0 = restart, normal state
+
+static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy);
+static _LIT_SECURITY_POLICY_C1(KPowerMgmtPolicy,ECapabilityPowerMgmt);
+
+/**
+ * PSCW Listener Observer interface for signaling that MDS has Shutdown/restarted
+ */
+class MGlxMDSShutdownObserver
+    {
+public:
+
+    virtual void ShutdownNotification(TInt aShutdownState) = 0;
+    };
+
+/**
+ *  Active object for observing P&S keys
+ *
+ *  @since S60 v5.0
+ */
+class CGlxMDSShutdownObserver: public CActive
+    {
+public:
+
+    /**
+     * Two-phased constructor.
+     *
+     * @since S60 v5.0
+     * @return Instance of CGlxMDSShutdownObserver.
+     */
+    static CGlxMDSShutdownObserver* NewL( MGlxMDSShutdownObserver& aObserver, const TUid& aKeyCategory,
+                                      const TInt aPropertyKey, TBool aDefineKey);
+
+    /**
+     * Destructor
+     *
+     * @since S60 v5.0
+     */
+    virtual ~CGlxMDSShutdownObserver();
+    
+protected:
+
+    /**
+     * Handles an active object's request completion event.
+     *
+     * @since S60 v5.0
+     */
+    void RunL();
+
+    /**
+     * Implements cancellation of an outstanding request.
+     *
+     * @since S60 v5.0
+     */
+    void DoCancel();
+
+private:
+
+    /**
+     * C++ default constructor
+     *
+     * @since S60 v5.0
+     * @return Instance of CGlxMDSShutdownObserver.
+     */
+    CGlxMDSShutdownObserver( MGlxMDSShutdownObserver& aObserver, const TUid& aKeyCategory,
+                         const TInt iPropertyKey, TBool aDefineKey);
+
+    /**
+     * Symbian 2nd phase constructor can leave.
+     *
+     * @since S60 v5.0
+     */
+    void ConstructL();
+
+private:
+    
+    // not own
+    MGlxMDSShutdownObserver& iObserver;
+    
+    const TUid& iKeyCategory;
+    RProperty iProperty;
+    TInt iPropertyKey;
+    
+    TBool iDefineKey;
+};
+
+
 
 // CONSTANTS
 
@@ -68,10 +164,12 @@
  */
 class CGlxDataSourceMde : public CGlxDataSource,
                           public MMdESessionObserver,
+                          public MGlxMDSShutdownObserver,
                           public MMdEObjectObserver,
                           public MMdEObjectPresentObserver,
                           public MMdERelationObserver,
-                          public MMdERelationPresentObserver
+                          public MMdERelationPresentObserver,
+                          public MHarvesterEventObserver
 #ifdef USE_S60_TNM
 						, public MThumbnailManagerObserver
 #else
@@ -90,11 +188,19 @@
 
 public:
     // from CGlxDataSource
-    CGlxDataSourceTask* CreateTaskL(CGlxRequest* aRequest, MGlxDataSourceRequestObserver& aObserver);
+    CGlxDataSourceTask* CreateTaskL(CGlxRequest* aRequest,
+            MGlxDataSourceRequestObserver& aObserver);
+public:
+    // from MHarvesterEventObserver
+    void HarvestingUpdated( 
+                HarvesterEventObserverType aHEObserverType, 
+                HarvesterEventState aHarvesterEventState,
+                TInt aItemsLeft );
 
 #ifdef USE_S60_TNM
 public:
-	void FetchThumbnailL(CGlxRequest* aRequest, MThumbnailFetchRequestObserver& aObserver);
+	void FetchThumbnailL(CGlxRequest* aRequest, 
+	        MThumbnailFetchRequestObserver& aObserver);
 	TInt CancelFetchThumbnail();
 #else
 private: 
@@ -161,13 +267,15 @@
 #endif
 		
 private:
-    void BackgroundThumbnailMessageL(const TGlxMediaId& aId, const TSize& aSize, TInt aError);
+    void BackgroundThumbnailMessageL(const TGlxMediaId& aId, const TSize& aSize, 
+            TInt aError);
 
     void DoSessionInitL();
 
     void AddMdEObserversL();
 
-    void ProcessUpdateArray(const RArray<TItemId>& aArray, TMPXChangeEventType aType, TBool aIsObject);
+    void ProcessUpdateArray(const RArray<TItemId>& aArray, TMPXChangeEventType aType,
+            TBool aIsObject);
 
     void ProcessItemUpdateL();
 
@@ -180,8 +288,19 @@
     void TaskCompletedL();
 
     void TaskStartedL();
+    
+#ifdef USE_S60_TNM
+    /*
+     * This function doesnt add up any value, added to reduce compiler warnings
+     */
+    void ThumbnailReadyL( TInt aError, MThumbnailData& aThumbnail,
+        TThumbnailRequestId aId, TBool aQuality );
+#endif
+    
+public:
 
-public:
+    void CreateSession();
+    
     inline CMdESession& Session() const;
     
 #ifndef USE_S60_TNM
@@ -236,6 +355,9 @@
     TBool SameMonth(const TTime& aOldDate, const TTime& aNewDate);
      
 	TBool ContainerIsLeft(CMdEObjectDef& aObjectDef);    
+	
+	// from MGlxMDSShutdownObserver
+    void ShutdownNotification(TInt aShutdownState);
 
 private:
 #ifdef USE_S60_TNM
@@ -247,10 +369,7 @@
     TBool iTnRequestInProgress;
     TInt iTnHandle;
     TGlxMediaId iMediaId;
-#ifdef _DEBUG   
-	TTime iStartTime;
-	TTime iStopTime;
-#endif
+    
 #else
     CGlxtnThumbnailCreator*   iThumbnailCreator;
     CGlxtnThumbnailDatabase*  iThumbnailDatabase;
@@ -279,6 +398,8 @@
     
     RArray<TTime> iMonthArray;
     RArray<TGlxMediaId> iMonthList;
+    RArray<TItemId> iAddedItems;
+    
     TTime iFirstMonth;
     TTime iLastMonth;
     
@@ -296,6 +417,16 @@
     RArray<TUpdateData> iUpdateData;
 	TBool iPauseUpdate;
     TInt iDeletedCount;
+    
+    RHarvesterClient iHC;
+    TBool iHarvestingOngoing;
+
+    CGlxMDSShutdownObserver* iMDSShutdownObserver;
+
+#ifdef _DEBUG
+    TTime iStartTime;
+    TTime iStopTime;
+#endif    
     };
 
 #include "glxdatasourcemds.inl"
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcemds.inl	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcemds.inl	Fri May 28 21:11:54 2010 +0530
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:   
+* Description:  Inline methods for the data source MDS class
 *
 */
 
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmds.h	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmds.h	Fri May 28 21:11:54 2010 +0530
@@ -67,7 +67,8 @@
  *  CGlxDataSourceTaskMde class 
  *  Base class for mde tasks: provides task generic functionality.
  */
-NONSHARABLE_CLASS(CGlxDataSourceTaskMde) : 	public CGlxDataSourceTask, public MMdEQueryObserver
+NONSHARABLE_CLASS(CGlxDataSourceTaskMde) : 	public CGlxDataSourceTask, 
+                                            public MMdEQueryObserver
 	{
 public:
     /**
@@ -76,8 +77,8 @@
      * @param aObserver observer to be informed when task has completed.
      * @param aDataSource data source to be used by this object.
      */
-    CGlxDataSourceTaskMde(CGlxRequest* aRequest, MGlxDataSourceRequestObserver& aObserver, 
-            CGlxDataSource* aDataSource);
+    CGlxDataSourceTaskMde(CGlxRequest* aRequest, MGlxDataSourceRequestObserver& 
+            aObserver, CGlxDataSource* aDataSource);
     
     /**
      * Destructor.
@@ -142,7 +143,8 @@
      */
     CGlxDataSourceMde* DataSource();
 
-    void AddMonthFilterL(const TGlxMediaId& aContainerId, TGlxFilterProperties& aFilterProperties);
+    void AddMonthFilterL(const TGlxMediaId& aContainerId, 
+            TGlxFilterProperties& aFilterProperties);
     
     void AddMonthFilterL(CMdEObject* aMonth, TGlxFilterProperties& aFilterProperties);
         
@@ -154,11 +156,14 @@
      * EFalse if the container is on the right side of the relation
      * 
      */	
-    void SetQueryConditionsL(CMdEQuery& aQuery, const TGlxFilterProperties& aFilterProperties, const TGlxMediaId aContainerId, CMdEObjectDef& aObjectDef);
+    void SetQueryConditionsL(CMdEQuery& aQuery, const TGlxFilterProperties& aFilterProperties, 
+            const TGlxMediaId aContainerId, CMdEObjectDef& aObjectDef);
 
-    void SetQueryFilterConditionsL(CMdELogicCondition& aLogicCondition, CMdEObjectDef& aObjectDef, const TGlxFilterProperties& aFilterProperties);
+    void SetQueryFilterConditionsL(CMdELogicCondition& aLogicCondition, CMdEObjectDef& aObjectDef,
+            const TGlxFilterProperties& aFilterProperties);
 
-    void SetSortOrderL(CMdEQuery& aQuery, CMdEObjectDef& aObjectDef, const TGlxFilterProperties& aFilterProperties);
+    void SetSortOrderL(CMdEQuery& aQuery, CMdEObjectDef& aObjectDef, 
+            const TGlxFilterProperties& aFilterProperties);
 
     /**
      * Returns the maximum number of items that a query should find.
@@ -171,7 +176,8 @@
      */
     void RemoveQuery();
 
-    void DoQueryL(CMdEObjectDef& aObjectDef, TBool aIsContent, TGlxQueryType aQueryType, TQueryResultMode aResultMode, const TGlxMediaId& aContainerId);
+    void DoQueryL(CMdEObjectDef& aObjectDef, TBool aIsContent, TGlxQueryType aQueryType,
+            TQueryResultMode aResultMode, const TGlxMediaId& aContainerId);
 
     /**
      * Adds queries for images and or videos to the query queue. The queries will return objects
@@ -181,7 +187,8 @@
      * image or video queries are required if iItemType is not set to EGlxFilterImage or 
      * EGlxFitlerVideo a query for images will be queued first followed by a query for videos.
      */
-    void QueueImageVideoObjectQueriesL(const RArray<TGlxMediaId>& aObjectIds, const TGlxFilterProperties& aFilterProperties);
+    void QueueImageVideoObjectQueriesL(const RArray<TGlxMediaId>& aObjectIds, 
+            const TGlxFilterProperties& aFilterProperties);
     
     /**
      * Adds a query for tag objects that have ids specified by aObjectIds
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsattribute.h	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsattribute.h	Fri May 28 21:11:54 2010 +0530
@@ -64,7 +64,8 @@
      * @param aObserver observer to be informed when task has completed.
      * @param aDataSource data source to be used by this object.
      */
-	CGlxDataSourceTaskMdeAttributeMde(CGlxGetRequest* aRequest, MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource);
+	CGlxDataSourceTaskMdeAttributeMde(CGlxGetRequest* aRequest, 
+	        MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource);
 	
     /**
      * Destructor.
@@ -94,9 +95,11 @@
 
 	void AddCollectionAttributesL(CMPXMedia* aEntry);
 	
-	void AddContainerAttributesL(CMPXMedia* aEntry, CMdEObject* aContainer, CGlxDataSource::TContainerType aType);
+	void AddContainerAttributesL(CMPXMedia* aEntry, CMdEObject* aContainer, 
+	        CGlxDataSource::TContainerType aType);
 	
-	void AddItemAttributesL(CMPXMedia* aEntry, CMdEObject* aItem, CGlxDataSource::TItemType aType);
+	void AddItemAttributesL(CMPXMedia* aEntry, CMdEObject* aItem, 
+	        CGlxDataSource::TItemType aType);
 	
     /**
      * Add location information to a media object from MDS.
@@ -127,8 +130,10 @@
      * of the object being queried is provided by the aObjectDef parameter
      *  
      */
-    void QueueObjectQueryL(CMdEObjectDef& aObjectDef, TBool aIsContent, TGlxQueryType aQueryType, TQueryResultMode aResultMode, 
-                          const TGlxMediaId& aContainerId, TMPXAttribute aAttribute, CMPXMedia* aEntry, 
+    void QueueObjectQueryL(CMdEObjectDef& aObjectDef, TBool aIsContent, 
+            TGlxQueryType aQueryType, TQueryResultMode aResultMode, 
+                          const TGlxMediaId& aContainerId, 
+                          TMPXAttribute aAttribute, CMPXMedia* aEntry, 
                           const TGlxFilterProperties& aFilterProperties);
     
 
@@ -156,10 +161,11 @@
      * Attributes associated with outstanding queries
      */
     RArray< TGlxQueryAttribute > iQueryAttributes;
+    
 #ifdef _DEBUG
-	TTime iStartTime;
-	TTime iStopTime;
-#endif
+    TTime iStartTime;
+    TTime iStopTime;
+#endif    
 	};
 
 
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdscommand.h	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdscommand.h	Fri May 28 21:11:54 2010 +0530
@@ -64,7 +64,8 @@
      * @param aObserver observer to be informed when task has completed.
      * @param aDataSource data source to be used by this object.
      */
-     CGlxDataSourceTaskMdeCommand(CGlxCommandRequest* aRequest, MGlxDataSourceRequestObserver& aObserver,
+     CGlxDataSourceTaskMdeCommand(CGlxCommandRequest* aRequest, 
+             MGlxDataSourceRequestObserver& aObserver,
              CGlxDataSource* aDataSource);
 
      /**
@@ -88,12 +89,14 @@
      /**
      * See @ref MGlxCommandParserCallback::AddToContainerL
      */ 
-     void AddToContainerL(const RArray<TGlxMediaId>& aSourceIds, const RArray<TGlxMediaId>& aTargetContainers);
+     void AddToContainerL(const RArray<TGlxMediaId>& aSourceIds, 
+             const RArray<TGlxMediaId>& aTargetContainers);
      
      /**
       * See @ref MGlxCommandParserCallback::AddToContainerL
       */ 
-     void AddToContainerL(const TDesC& aSourceUri, const RArray<TGlxMediaId>& aTargetContainers);    
+     void AddToContainerL(const TDesC& aSourceUri, 
+             const RArray<TGlxMediaId>& aTargetContainers);    
      
      /**
       * See @ref MGlxCommandParserCallback::CopyL
@@ -108,7 +111,8 @@
      /**
       * See @ref MGlxCommandParserCallback::RemoveFromContainerL
       */ 
-     void RemoveFromContainerL(const RArray<TGlxMediaId>& aItemIds, const TGlxMediaId& aContainerId);
+     void RemoveFromContainerL(const RArray<TGlxMediaId>& aItemIds,
+             const TGlxMediaId& aContainerId);
      
      /**
       * See @ref MGlxCommandParserCallback::DeleteL
@@ -123,12 +127,14 @@
      /**
       * See @ref MGlxCommandParserCallback::SetDescriptionL
       */ 
-     void SetDescriptionL(const RArray<TGlxMediaId>& aItemIds, const TDesC& aDescription);
+     void SetDescriptionL(const RArray<TGlxMediaId>& aItemIds, 
+             const TDesC& aDescription);
      
      /**
       * See @ref MGlxCommandParserCallback::SetCaptureLocationL
       */ 
-     void SetCaptureLocationL(const RArray<TGlxMediaId>& aItemIds, const TCoordinate& aCoordinate);
+     void SetCaptureLocationL(const RArray<TGlxMediaId>& aItemIds, 
+             const TCoordinate& aCoordinate);
      
      /**
       * See @ref MGlxCommandParserCallback::ThumbnailCleanupL
@@ -165,7 +171,8 @@
 	 * @param aDrive destination drive.
 	 * @param aFileOperation file operation to perform (either a copy or a move) 
 	 */
-	void FileOperationL(const TArray<TGlxMediaId>& aSourceIds, const TDesC& aDrive, TFileOperation aFileOperation);
+	void FileOperationL(const TArray<TGlxMediaId>& aSourceIds, 
+	        const TDesC& aDrive, TFileOperation aFileOperation);
 	
     /**
 	 * Gets the container id for a given media id.
@@ -282,6 +289,18 @@
      */	
 	
 	TInt SearchStringL(TInt aResourceId);
+	
+	/**
+	 * Timer callback to stop scheduler wait
+	 * @param aPtr Pointer to object that started the timer
+	 * @return 0 to signal that further callbacks are unnecessary, 1 otherwise
+	 */
+	static TInt SchedulerStopCallback(TAny* aPtr);
+	    
+	/**
+	 * Starts the scheduler wait timer. When complete, Scheduler is stopped
+	 */	
+	void SchedulerStopComplete();
 
 private:	
 	/**
@@ -325,6 +344,16 @@
     *
     */
     CGlxStringCache* iStringCache;
+    
+    /**
+	 *  Timer that checks if scheduler wait needs to be cancelled  
+	 */
+    CPeriodic* iTimer; 
+    
+    /**
+	*  Active scheduler wait object. (Owned)
+	*/
+    CActiveSchedulerWait* iSchedulerWait;
 	};
 
 #endif //_C_GLXDATASOURCETASKMDSCOMMAND_H_
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsidlist.h	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsidlist.h	Fri May 28 21:11:54 2010 +0530
@@ -47,7 +47,8 @@
  *  CGlxDataSourceTaskMdeIdList class 
  *  Task to handle id list requests.
  */
-NONSHARABLE_CLASS(CGlxDataSourceTaskMdeIdList) : public CGlxDataSourceTaskMde, public MGlxtnThumbnailCreatorClient
+NONSHARABLE_CLASS(CGlxDataSourceTaskMdeIdList) : public CGlxDataSourceTaskMde,
+                                                 public MGlxtnThumbnailCreatorClient
 
 	{
 public:
@@ -57,7 +58,8 @@
      * @param aObserver observer to be informed when task has completed.
      * @param aDataSource data source to be used by this object.
      */
-     CGlxDataSourceTaskMdeIdList(CGlxIdListRequest* aRequest, MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource);
+     CGlxDataSourceTaskMdeIdList(CGlxIdListRequest* aRequest, 
+             MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource);
         
      /**
       * Destructor.
@@ -118,11 +120,17 @@
 private:
 	void DoHandleListQueryCompletedL();
 		
-    void DoMonthListCreationL(CMdEQuery& aQuery, const TGlxFilterProperties& aFilterProperties);
+    void DoMonthListCreationL(CMdEQuery& aQuery, const TGlxFilterProperties& 
+            aFilterProperties);
         
     void DoPostFilterComplete(const RArray<TGlxMediaId>& aIdArray, TInt aErrorCode);	
     
-    void PostFilterL(const RArray<TGlxMediaId>& aFilteredList, const TGlxFilterProperties& aFilterProperties);                                                                            
+    void PostFilterL(const RArray<TGlxMediaId>& aFilteredList,
+            const TGlxFilterProperties& aFilterProperties);                                                                            
+#ifdef _DEBUG
+    TTime iStartTime;
+    TTime iStopTime;
+#endif
 	};
 
 #endif // GLXDATASOURCETASKMDSIDLIST_H_
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsthumbnail.h	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/glxdatasourcetaskmdsthumbnail.h	Fri May 28 21:11:54 2010 +0530
@@ -77,7 +77,7 @@
 
 #ifdef USE_S60_TNM
 private: //MThumbnailFetchRequestObserver
-    void ThumbnailFetchComplete(TInt aError);
+    void ThumbnailFetchComplete(TInt aError, TBool aQuality);
     void FetchFileInfoL();
 #endif
 
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/mthumbnailfetchrequestobserver.h	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/inc/mthumbnailfetchrequestobserver.h	Fri May 28 21:11:54 2010 +0530
@@ -28,7 +28,7 @@
 class MThumbnailFetchRequestObserver
     {
 public:
-    virtual void ThumbnailFetchComplete(TInt aError) = 0;
+    virtual void ThumbnailFetchComplete(TInt aError, TBool aQuality) = 0;
     virtual void FetchFileInfoL() = 0;
     };
 
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp	Fri May 28 21:11:54 2010 +0530
@@ -20,6 +20,7 @@
 // INCLUDE FILES
 #include "glxdatasourcemds.h"
 
+#include <e32base.h>
 #include <fbs.h>
 #include <glxbackgroundtnmessagedefs.h>
 #include <glxcollectionmessagedefs.h>
@@ -48,14 +49,14 @@
 #include "glxdatasourcetaskmdsidlist.h"
 #include "glxdatasourcetaskmdsthumbnail.h"
 
-#ifndef USE_S60_TNM
+#ifdef USE_S60_TNM
+const TInt KMaxGridThumbnailWidth = 200;
+#else
 const TInt KGlxThumbnailCleanupAfterDeletions = 200;
 
 _LIT(KGlxMdeDataSourceThumbnailDatabase, "glxmdstn");
 #endif
 
-const TInt KMaxGridThumbnailWidth = 200;
-
 _LIT(KObjectDefLocation, "Location");
 _LIT(KObjectDefNameAlbum, "Album");
 _LIT(KObjectDefNameImage, "Image");
@@ -77,6 +78,8 @@
 
 #undef __USING_INTELLIGENT_UPDATE_FILTERING
 
+const TInt KHarvestUpdateChunkSize = 1000;
+
 // ---------------------------------------------------------------------------
 // MPXChangeEventType
 // Helper method
@@ -101,6 +104,110 @@
 	return type;
 	}
 
+
+// ---------------------------------------------------------------------------
+// CGlxMDSShutdownObserver::NewL()
+// ---------------------------------------------------------------------------
+//
+CGlxMDSShutdownObserver* CGlxMDSShutdownObserver::NewL( MGlxMDSShutdownObserver& aObserver,
+                                                const TUid& aKeyCategory,
+                                                const TInt aPropertyKey,
+                                                TBool aDefineKey)
+    {
+    TRACER("CGlxMDSShutdownObserver* CGlxMDSShutdownObserver::NewL");
+    CGlxMDSShutdownObserver* self = new( ELeave )CGlxMDSShutdownObserver( aObserver, 
+                                                                  aKeyCategory,
+                                                                  aPropertyKey,
+                                                                  aDefineKey);
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CGlxMDSShutdownObserver::CGlxMDSShutdownObserver()
+// ---------------------------------------------------------------------------
+//
+CGlxMDSShutdownObserver::CGlxMDSShutdownObserver( MGlxMDSShutdownObserver& aObserver,
+                                          const TUid& aKeyCategory,
+                                          const TInt aPropertyKey,
+                                          TBool aDefineKey)
+    : CActive( CActive::EPriorityStandard ), iObserver( aObserver ),
+      iKeyCategory( aKeyCategory ), iPropertyKey(aPropertyKey), iDefineKey( aDefineKey )
+    {   
+    TRACER("CGlxMDSShutdownObserver::CGlxMDSShutdownObserver()");
+    CActiveScheduler::Add( this );
+    }
+
+// ---------------------------------------------------------------------------
+// CGlxMDSShutdownObserver::ConstructL()
+// ---------------------------------------------------------------------------
+//
+void CGlxMDSShutdownObserver::ConstructL()
+    { 
+    TRACER("void CGlxMDSShutdownObserver::ConstructL()");
+    // define P&S property types
+    if (iDefineKey)
+        {
+        RProperty::Define(iKeyCategory,iPropertyKey,
+                          RProperty::EInt,KAllowAllPolicy,KPowerMgmtPolicy);
+        }
+    
+    // attach to the property
+    TInt err = iProperty.Attach(iKeyCategory,iPropertyKey,EOwnerThread);
+    User::LeaveIfError(err);
+    
+    // wait for the previously attached property to be updated
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    }
+
+// ---------------------------------------------------------------------------
+// CGlxMDSShutdownObserver::~CGlxMDSShutdownObserver()
+// ---------------------------------------------------------------------------
+//
+CGlxMDSShutdownObserver::~CGlxMDSShutdownObserver()
+    {
+    TRACER("CGlxMDSShutdownObserver::~CGlxMDSShutdownObserver()");
+    Cancel();
+    iProperty.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// CGlxMDSShutdownObserver::RunL()
+// ---------------------------------------------------------------------------
+//
+void CGlxMDSShutdownObserver::RunL()
+    {
+    TRACER("void CGlxMDSShutdownObserver::RunL()");
+
+    // resubscribe before processing new value to prevent missing updates
+    iProperty.Subscribe(iStatus);
+    SetActive();
+    
+    // retrieve the value
+    TInt value = 0;
+    TInt err = iProperty.Get(value);
+    GLX_DEBUG2("CGlxMDSShutdownObserver::RunL(): iProperty.Get(value); returns %d", err);
+    
+    User::LeaveIfError(err);
+
+    iObserver.ShutdownNotification(value);
+    }
+
+// ---------------------------------------------------------------------------
+// CGlxMDSShutdownObserver::DoCancel()
+// ---------------------------------------------------------------------------
+//
+void CGlxMDSShutdownObserver::DoCancel()
+    {
+    TRACER("void CGlxMDSShutdownObserver::DoCancel()");
+    iProperty.Cancel();
+    }
+
+
+
 // ============================ MEMBER FUNCTIONS ==============================
 
 // ---------------------------------------------------------------------------
@@ -143,14 +250,17 @@
     	}
     delete iThumbnailDatabase;
 #endif
-
     iFs.Close();
+    iHC.Close();
     RFbsSession::Disconnect();
     iMonthArray.Close();
     iMonthList.Close();
     iUpdateData.Close();
+    iAddedItems.Reset();
+    iAddedItems.Close();
     delete iUpdateCallback;
     delete iCreateSessionCallback;
+    delete iMDSShutdownObserver ;
 	}
 
 // ---------------------------------------------------------------------------
@@ -159,7 +269,7 @@
 //
 CGlxDataSourceMde::CGlxDataSourceMde()
 	{
-    TRACER("CGlxDataSourceMde::CGlxDataSourceMde()")
+    TRACER("CGlxDataSourceMde::CGlxDataSourceMde()");
     //No Implementation
 	}
 
@@ -169,7 +279,7 @@
 //
 void CGlxDataSourceMde::ConstructL()
 	{
-    TRACER("CGlxDataSourceMde::ConstructL()")
+    TRACER("CGlxDataSourceMde::ConstructL()");
     
 	iDataSourceReady = EFalse;			
     User::LeaveIfError(iFs.Connect());
@@ -179,20 +289,27 @@
 
 #ifdef USE_S60_TNM
     iTnEngine = CThumbnailManager::NewL( *this);
-    iTnEngine->SetFlagsL(CThumbnailManager::EAllowAnySize);
-    iTnEngine->SetDisplayModeL( EColor64K );
+    iTnEngine->SetDisplayModeL( EColor16M );
     iTnRequestInProgress = EFalse;
 #else
 	iThumbnailCreator = CGlxtnThumbnailCreator::InstanceL();
 	iThumbnailDatabase = CGlxtnThumbnailDatabase::NewL(
             	                        KGlxMdeDataSourceThumbnailDatabase, this);
 #endif
-         	                        
+            	                        
     iCreateSessionCallback = new ( ELeave )
 	    CAsyncCallBack( TCallBack( CreateSession, this ), CActive::EPriorityHigh );
+    
+    iMDSShutdownObserver = CGlxMDSShutdownObserver::NewL( *this, KHarvesterPSShutdown, KMdSShutdown, EFalse );
+    
     iUpdateCallback = new ( ELeave )
 	    CAsyncCallBack( TCallBack( ProcessItemUpdate, this ), CActive::EPriorityLow );
     iUpdateData.Reserve(100); // ignore if it fails
+    
+    User::LeaveIfError(iHC.Connect());
+    iHC.AddHarvesterEventObserver(*this, EHEObserverTypePlaceholder, KHarvestUpdateChunkSize);
+
+    iHarvestingOngoing = EFalse;
 	}
 	
 // ----------------------------------------------------------------------------
@@ -202,20 +319,22 @@
 //    
 void CGlxDataSourceMde::HandleSessionOpened( CMdESession& aSession, TInt aError )    
     {
-    TRACER("CGlxDataSourceMde::HandleSessionOpened(CMdESession& aSession, TInt aError)")
+    TRACER("CGlxDataSourceMde::HandleSessionOpened(CMdESession& aSession, TInt aError)");
     if( KErrNone != aError )
         {
         HandleSessionError(aSession, aError);
         }
     TRAPD(err, DoSessionInitL());
-    if( KErrNone != err )
+    if (KErrNone == err)
+        {
+        iSessionOpen = ETrue;
+        iDataSourceReady = ETrue;
+        TryStartTask(ETrue);
+        }
+    else
         {
         HandleSessionError(aSession, err);
         }
-    
-    iSessionOpen = ETrue;
-    iDataSourceReady = ETrue;
-	TryStartTask(ETrue);
     }
     
 // ----------------------------------------------------------------------------
@@ -223,28 +342,37 @@
 // CMPXCollectionMdEPlugin::HandleSessionError
 // ----------------------------------------------------------------------------
 //     
-void CGlxDataSourceMde::HandleSessionError(CMdESession& /*aSession*/, TInt /*aError*/ )    
+void CGlxDataSourceMde::HandleSessionError(CMdESession& /*aSession*/, TInt aError )    
     {
-    TRACER("CGlxDataSourceMde::HandleSessionError(CMdESession& /*aSession*/, TInt /*aError*/)")
-    delete iSession;
-    iSession = NULL;
+    TRACER("CGlxDataSourceMde::HandleSessionError(CMdESession& /*aSession*/, TInt aError)")
+    GLX_DEBUG2("void CGlxDataSourceMde::HandleSessionError() aError(%d)", aError);
+
     iDataSourceReady = EFalse;
     iSessionOpen = EFalse;
-    iCreateSessionCallback->CallBack();
+
+    // We wait till MDS restarts before starting the session if the current session is locked.
+    // that is handled separately by the MDS Shutdown PUB SUB Framework.   
+    // for everything else we use the generic method and continue.
+    if ( (KErrLocked != aError) && ( KErrServerTerminated != aError) )
+        {
+        iCreateSessionCallback->CallBack();
+        }
     }
 
-
 // ---------------------------------------------------------------------------
 // CreateTaskL
 // ---------------------------------------------------------------------------
 //
-CGlxDataSourceTask* CGlxDataSourceMde::CreateTaskL(CGlxRequest* aRequest, MGlxDataSourceRequestObserver& aObserver)
+CGlxDataSourceTask* CGlxDataSourceMde::CreateTaskL(CGlxRequest* aRequest, 
+        MGlxDataSourceRequestObserver& aObserver)
 	{
-    TRACER("CGlxDataSourceTask* CGlxDataSourceMde::CreateTaskL(CGlxRequest* aRequest, MGlxDataSourceRequestObserver& aObserver)")	
+    TRACER("CGlxDataSourceTask* CGlxDataSourceMde::CreateTaskL(CGlxRequest* aRequest,MGlxDataSourceRequestObserver& aObserver)")	;
 	if(dynamic_cast<CGlxCommandRequest*>(aRequest))
 		{
         CleanupStack::PushL(aRequest);
-        CGlxDataSourceTaskMdeCommand* task = new (ELeave) CGlxDataSourceTaskMdeCommand(static_cast<CGlxCommandRequest*>(aRequest), aObserver, this);
+        CGlxDataSourceTaskMdeCommand* task = new (ELeave) 
+        CGlxDataSourceTaskMdeCommand(static_cast<CGlxCommandRequest*>(aRequest),
+                aObserver, this);
 		CleanupStack::Pop(aRequest); // now owned by task
         CleanupStack::PushL(task);
         task->ConstructL();
@@ -253,17 +381,10 @@
 		}
 	else if (dynamic_cast< CGlxGetRequest *>(aRequest))
 		{
-	    GLX_LOG_INFO("==> CGlxDataSourceMde::CreateTaskL - CGlxDataSourceTaskMdeAttributeMde+");
-#ifdef _DEBUG
-        _LIT( KFormatTimeStamp, "[%H:%T:%S.%*C5]");
-	    TTime time;
-	    time.HomeTime(); // Get home time
-	    TBuf<32> timeStampBuf;
-	    time.FormatL(timeStampBuf, KFormatTimeStamp);
-	    RDebug::Print(_L("%S"), &timeStampBuf);    
-#endif
         CleanupStack::PushL(aRequest);
-        CGlxDataSourceTaskMdeAttributeMde* task = new (ELeave) CGlxDataSourceTaskMdeAttributeMde(static_cast<CGlxGetRequest*>(aRequest), aObserver, this);
+        CGlxDataSourceTaskMdeAttributeMde* task = new (ELeave) 
+        CGlxDataSourceTaskMdeAttributeMde(static_cast<CGlxGetRequest*>(aRequest),
+                aObserver, this);
 		CleanupStack::Pop(aRequest); // now owned by task
         CleanupStack::PushL(task);
         task->ConstructL();
@@ -273,7 +394,9 @@
 	else if (dynamic_cast< CGlxIdListRequest *>(aRequest))
 		{	
         CleanupStack::PushL(aRequest);
-        CGlxDataSourceTaskMdeIdList* task = new (ELeave) CGlxDataSourceTaskMdeIdList(static_cast<CGlxIdListRequest*>(aRequest), aObserver, this);
+        CGlxDataSourceTaskMdeIdList* task = new (ELeave) 
+        CGlxDataSourceTaskMdeIdList(static_cast<CGlxIdListRequest*>(aRequest), 
+                aObserver, this);
         CleanupStack::Pop(aRequest); // now owned by task
         CleanupStack::PushL(task); 
         task->ConstructL();
@@ -282,17 +405,10 @@
 		}
 	else if (dynamic_cast< CGlxThumbnailRequest *>(aRequest))
 		{	
-	    GLX_LOG_INFO("==> CGlxDataSourceMde::CreateTaskL - CGlxDataSourceTaskMdeThumbnail+");
-#ifdef _DEBUG
-        _LIT( KFormatTimeStamp, "[%H:%T:%S.%*C5]");
-	    TTime time;
-	    time.HomeTime(); // Get home time
-	    TBuf<32> timeStampBuf;
-	    time.FormatL(timeStampBuf, KFormatTimeStamp);
-	    RDebug::Print(_L("%S"), &timeStampBuf);    
-#endif
         CleanupStack::PushL(aRequest);
-        CGlxDataSourceTaskMdeThumbnail* task = new (ELeave) CGlxDataSourceTaskMdeThumbnail(static_cast<CGlxThumbnailRequest*>(aRequest), aObserver, this);
+        CGlxDataSourceTaskMdeThumbnail* task = new (ELeave) 
+        CGlxDataSourceTaskMdeThumbnail(static_cast<CGlxThumbnailRequest*>(aRequest), 
+                aObserver, this);
         CleanupStack::Pop(aRequest); // now owned by task
         CleanupStack::PushL(task); 
         task->ConstructL();
@@ -311,9 +427,10 @@
 // ThumbnailAvailable
 // ---------------------------------------------------------------------------
 //
-void CGlxDataSourceMde::ThumbnailAvailable(const TGlxMediaId& /*aId*/, const TSize& /*aSize*/)
+void CGlxDataSourceMde::ThumbnailAvailable(const TGlxMediaId& 
+        /*aId*/, const TSize& /*aSize*/)
 	{
-    TRACER("CGlxDataSourceMde::ThumbnailAvailable(const TGlxMediaId& /*aId*/, const TSize& /*aSize*/)")
+    TRACER("CGlxDataSourceMde::ThumbnailAvailable(const TGlxMediaId& /*aId*/, const TSize& /*aSize*/)");
 	//No implementation
 	}
 
@@ -323,7 +440,7 @@
 //
 void CGlxDataSourceMde::BackgroundThumbnailError(const TGlxMediaId& aId, TInt aError)
 	{
-    TRACER("CGlxDataSourceMde::BackgroundThumbnailError(const TGlxMediaId& aId, TInt aError)")
+    TRACER("CGlxDataSourceMde::BackgroundThumbnailError(const TGlxMediaId& aId, TInt aError)");
 	TSize size(0, 0);
 	TRAP_IGNORE(BackgroundThumbnailMessageL(aId, size, aError));
 	}
@@ -333,9 +450,10 @@
 // BackgroundThumbnailMessageL
 // ---------------------------------------------------------------------------
 //
-void CGlxDataSourceMde::BackgroundThumbnailMessageL(const TGlxMediaId& aId, const TSize& aSize, TInt aError)
+void CGlxDataSourceMde::BackgroundThumbnailMessageL(const TGlxMediaId& aId, 
+        const TSize& aSize, TInt aError)
 	{
-    TRACER("CGlxDataSourceMde::BackgroundThumbnailMessageL(const TGlxMediaId& aId, const TSize& aSize, TInt aError)")
+    TRACER("CGlxDataSourceMde::BackgroundThumbnailMessageL(const TGlxMediaId& aId, const TSize& aSize, TInt aError)");
 	CMPXMessage* message = CMPXMessage::NewL();
 	CleanupStack::PushL(message);
 	message->SetTObjectValueL(KMPXMessageGeneralId, KGlxMessageIdBackgroundThumbnail);
@@ -352,7 +470,7 @@
 //
 void CGlxDataSourceMde::DoSessionInitL()
 	{
-    TRACER("CGlxDataSourceMde::DoSessionInitL()")
+    TRACER("CGlxDataSourceMde::DoSessionInitL()");
 	/// @todo check schema version number
     iNameSpaceDef = &iSession->GetDefaultNamespaceDefL();
     
@@ -396,12 +514,23 @@
 //
 void CGlxDataSourceMde::AddMdEObserversL()
     {
-    TRACER("CGlxDataSourceMde::AddMdEObserversL()")
+    TRACER("CGlxDataSourceMde::AddMdEObserversL()");
 	iSession->AddRelationObserverL(*this);
 	iSession->AddRelationPresentObserverL(*this);
 	
-	iSession->AddObjectObserverL(*this);
-	iSession->AddObjectPresentObserverL(*this);
+	//when setting observing conditions,
+	//add filters for all images, videos, Albums & Tags
+	CMdELogicCondition* addCondition = CMdELogicCondition::NewLC( ELogicConditionOperatorOr );
+	addCondition->AddObjectConditionL( *iImageDef );
+	addCondition->AddObjectConditionL( *iAlbumDef );
+	addCondition->AddObjectConditionL( *iTagDef );
+	
+	iSession->AddObjectObserverL(*this, addCondition );
+	iSession->AddObjectPresentObserverL(*this );
+		
+	// This addCondition should only be popped. 
+	// As the ownership is transferred, the same will be destroyed by MdS.
+	CleanupStack::Pop( addCondition ); 
     }
 
 // ---------------------------------------------------------------------------
@@ -413,13 +542,47 @@
 					TObserverNotificationType aType,
 					const RArray<TItemId>& aObjectIdArray)
 	{
-    TRACER("CGlxDataSourceMde::HandleObjectNotification()")
+    TRACER("CGlxDataSourceMde::HandleObjectNotification()");
+    GLX_LOG_INFO3("CGlxDataSourceMde::HandleObjectNotification() aType=%d, aObjectIdArray.Count()=%d, iHarvestingOngoing=%d", 
+															  aType, aObjectIdArray.Count(),
+															  iHarvestingOngoing);
+   	if (ENotifyAdd == aType)
+		{
+	    for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
+	        {
+			iAddedItems.Append(aObjectIdArray[i]);
+	        }
+	    GLX_LOG_INFO1("ENotifyAdd - iAddedItems.Count()=%d", iAddedItems.Count());
+		}
+    
+   	if (ENotifyModify == aType)
+		{
+	    for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
+	        {
+	        if (iAddedItems.Find(aObjectIdArray[i]) != KErrNotFound)
+	        	{
+		        if (!iHarvestingOngoing)
+		        	{
+		        	GLX_LOG_INFO("ENotifyModify - Harvesting Completed - "
+		        	        "Reset iAddedItems array");
+					iAddedItems.Reset();
+					break;
+		        	}
+		        GLX_LOG_INFO("ENotifyModify - Id found in iAddedItems array, DO NOT PROCESS");
+	        	return;
+	        	}
+	        }
+        }
+
+   	GLX_LOG_INFO("ProcessUpdateArray");
 	ProcessUpdateArray(aObjectIdArray,  MPXChangeEventType(aType), ETrue);
 #ifndef USE_S60_TNM
 	if(MPXChangeEventType(aType) == EMPXItemDeleted )
 		{			
 		TInt count = aObjectIdArray.Count();
 		iDeletedCount += count;
+		GLX_LOG_INFO2("EMPXItemDeleted - aObjectIdArray.Count()=%d, iDeletedCount=%d", 
+		        count, iDeletedCount);
 		if(iDeletedCount > KGlxThumbnailCleanupAfterDeletions)
 		    {
 	    	TRAPD(err, ThumbnailCreator().CleanupThumbnailsL(iThumbnailDatabase));
@@ -429,10 +592,15 @@
 	    	    }
 		    }
 		}
+
+	if(MPXChangeEventType(aType) == EMPXItemModified )
+	    {
+	    GLX_LOG_INFO("EMPXItemModified");
+	    TRAP_IGNORE(ThumbnailCreator().CleanupThumbnailsL(iThumbnailDatabase));
+		}
 #endif		
 	}
 
-
 // ---------------------------------------------------------------------------
 // CGlxDataSourceMde::HandleObjectPresentNotification
 // ---------------------------------------------------------------------------
@@ -441,7 +609,7 @@
 void CGlxDataSourceMde::HandleObjectPresentNotification(CMdESession& /*aSession*/, 
 		TBool aPresent, const RArray<TItemId>& aObjectIdArray)
 	{
-    TRACER("CGlxDataSourceMde::HandleObjectPresentNotification()")
+    TRACER("CGlxDataSourceMde::HandleObjectPresentNotification()");
 	if (aPresent)
 		{
 		ProcessUpdateArray(aObjectIdArray, EMPXItemInserted, ETrue);
@@ -461,7 +629,7 @@
 			TObserverNotificationType aType,
 			const RArray<TItemId>& aRelationIdArray)
 	{
-    TRACER("CGlxDataSourceMde::HandleRelationNotification()")
+    TRACER("CGlxDataSourceMde::HandleRelationNotification()");
 	ProcessUpdateArray(aRelationIdArray, MPXChangeEventType(aType), EFalse);
 	}
 
@@ -473,7 +641,7 @@
 void CGlxDataSourceMde::HandleRelationPresentNotification(CMdESession& /*aSession*/,
 			TBool aPresent, const RArray<TItemId>& aRelationIdArray)
 	{
-    TRACER("CGlxDataSourceMde::HandleRelationPresentNotification()")
+    TRACER("CGlxDataSourceMde::HandleRelationPresentNotification()");
 	if (aPresent)
 		{
 		ProcessUpdateArray(aRelationIdArray, EMPXItemInserted, EFalse);
@@ -488,9 +656,10 @@
 // ProcessUpdateArray
 // ---------------------------------------------------------------------------
 //
-void CGlxDataSourceMde::ProcessUpdateArray(const RArray<TItemId>& aArray, TMPXChangeEventType aType, TBool aIsObject)
+void CGlxDataSourceMde::ProcessUpdateArray(const RArray<TItemId>& aArray, 
+        TMPXChangeEventType aType, TBool aIsObject)
 	{
-    TRACER("CGlxDataSourceMde::ProcessUpdateArray(const RArray<TItemId>& aArray, TMPXChangeEventType aType, TBool aIsObject)")
+    TRACER("CGlxDataSourceMde::ProcessUpdateArray(const RArray<TItemId>& aArray,TMPXChangeEventType aType, TBool aIsObject)");
     // only need one message so process first item
     TUpdateData update;
     update.iId = aArray[0];
@@ -510,12 +679,22 @@
 	}
 	
 // ---------------------------------------------------------------------------
-// MPXChangeEventType
+// CreateSession
+// ---------------------------------------------------------------------------
+//
+void CGlxDataSourceMde::CreateSession()
+    {
+    TRACER("CGlxDataSourceMde::CreateSession()")
+    TRAP_IGNORE(CreateSessionL());
+    }
+    
+// ---------------------------------------------------------------------------
+// CreateSession
 // ---------------------------------------------------------------------------
 //
 TInt CGlxDataSourceMde::CreateSession(TAny* aPtr)
     {
-    TRACER("CGlxDataSourceMde::CreateSession(TAny* aPtr)")
+    TRACER("CGlxDataSourceMde::CreateSession(TAny* aPtr)");
     CGlxDataSourceMde* self
                     = reinterpret_cast<CGlxDataSourceMde*>( aPtr );
     TRAP_IGNORE(self->CreateSessionL());
@@ -528,7 +707,9 @@
 //
 void CGlxDataSourceMde::CreateSessionL()
     {
-    TRACER("CGlxDataSourceMde::CreateSessionL()")
+    TRACER("CGlxDataSourceMde::CreateSessionL()");
+    delete iSession;
+    iSession = NULL;
 	iSession = CMdESession::NewL( *this );
     }
             
@@ -539,7 +720,7 @@
 //
 TInt CGlxDataSourceMde::ProcessItemUpdate(TAny* aPtr)
     {
-    TRACER("CGlxDataSourceMde::ProcessItemUpdate(TAny* aPtr)")
+    TRACER("CGlxDataSourceMde::ProcessItemUpdate(TAny* aPtr)");
     CGlxDataSourceMde* self
                     = reinterpret_cast<CGlxDataSourceMde*>( aPtr );
     TRAP_IGNORE(self->ProcessItemUpdateL());
@@ -552,8 +733,7 @@
 //
 void CGlxDataSourceMde::ProcessItemUpdateL()
     {
-    TRACER("CGlxDataSourceMde::ProcessItemUpdateL()")
-    //__ASSERT_DEBUG(iUpdateData.Count(), Panic(EGlxPanicIllegalState));
+    TRACER("CGlxDataSourceMde::ProcessItemUpdateL()");
 	if ( !iUpdateData.Count() || iPauseUpdate )
         {
         return;
@@ -561,7 +741,8 @@
     CMPXMessage* message = CMPXMessage::NewL();
     CleanupStack::PushL(message);
     message->SetTObjectValueL<TInt>(KMPXMessageGeneralId, KMPXMessageIdItemChanged);
-    message->SetTObjectValueL<TMPXChangeEventType>(KMPXMessageChangeEventType, iUpdateData[0].iType);
+    message->SetTObjectValueL<TMPXChangeEventType>(KMPXMessageChangeEventType,
+            iUpdateData[0].iType);
     TMPXGeneralCategory category = EMPXNoCategory;
 	TMPXItemId id = iUpdateData[0].iId;
 	
@@ -589,7 +770,8 @@
     		    __ASSERT_DEBUG(rightObject, Panic(EGlxPanicIllegalState));
     			TContainerType rightContainer = ContainerType(rightObject);
     			delete rightObject;
-   		    	__ASSERT_DEBUG(( EContainerTypeAlbum != rightContainer), Panic(EGlxPanicIllegalState));
+   		    	__ASSERT_DEBUG(( EContainerTypeAlbum != rightContainer), 
+   		    	        Panic(EGlxPanicIllegalState));
     			if( EContainerTypeTag == rightContainer )
     				{
         			id = leftId;
@@ -607,8 +789,10 @@
     			containerId = leftId;
     	    	containerCategory = EMPXAlbum;
     	    	}
-    		message->SetTObjectValueL<TMPXGeneralCategory>(KGlxCollectionMessageContainerCategory, containerCategory);
-    		message->SetTObjectValueL<TMPXItemId>(KGlxCollectionMessageContainerId, containerId);
+    		message->SetTObjectValueL<TMPXGeneralCategory>(KGlxCollectionMessageContainerCategory,
+    		        containerCategory);
+    		message->SetTObjectValueL<TMPXItemId>(KGlxCollectionMessageContainerId, 
+    		        containerId);
 			}
 	    else
 	        {
@@ -647,7 +831,8 @@
     		}
 	    }
 #endif // __USING_INTELLIGENT_UPDATE_FILTERING
-	message->SetTObjectValueL<TMPXGeneralCategory>(KMPXMessageMediaGeneralCategory, category);
+	message->SetTObjectValueL<TMPXGeneralCategory>(KMPXMessageMediaGeneralCategory,
+	        category);
    	message->SetTObjectValueL<TMPXItemId>(KMPXMessageMediaGeneralId, id);
     BroadcastMessage(*message); 
     CleanupStack::PopAndDestroy(message);
@@ -660,7 +845,7 @@
 //
 CGlxDataSource::TContainerType CGlxDataSourceMde::ContainerType(CMdEObject* aObject)
 	{
-    TRACER("CGlxDataSourceMde::ContainerType(CMdEObject* aObject)")
+    TRACER("CGlxDataSourceMde::ContainerType(CMdEObject* aObject)");
 	TContainerType containerType = EContainerTypeNotAContainer;
  	
 	if( 0 == aObject->Def().Compare(*iAlbumDef) )
@@ -684,9 +869,10 @@
 // ContainerType
 // ---------------------------------------------------------------------------
 //	
-CGlxDataSource::TContainerType CGlxDataSourceMde::ContainerType(CMdEObjectDef* aObjectDef)
+CGlxDataSource::TContainerType CGlxDataSourceMde::ContainerType(CMdEObjectDef* 
+        aObjectDef)
 	{
-    TRACER("CGlxDataSourceMde::ContainerType(CMdEObjectDef* aObjectDef)")
+    TRACER("CGlxDataSourceMde::ContainerType()");
 	TContainerType containerType = EContainerTypeNotAContainer;
  	
 	if( 0 == aObjectDef->Compare(*iAlbumDef) )
@@ -711,7 +897,7 @@
 //
 CGlxDataSource::TItemType CGlxDataSourceMde::ItemType(CMdEObject* aObject)
 	{
-    TRACER("CGlxDataSourceMde::ItemType(CMdEObject* aObject)")
+    TRACER("CGlxDataSourceMde::ItemType(CMdEObject* aObject)");
 	TItemType itemType = EItemTypeNotAnItem;
 	
 	if( 0 == aObject->Def().Compare(*iImageDef) )
@@ -732,7 +918,7 @@
 //
 void CGlxDataSourceMde::PrepareMonthsL()
     {
-    TRACER("CGlxDataSourceMde::PrepareMonthsL()")
+    TRACER("CGlxDataSourceMde::PrepareMonthsL()");
     TTime month(0);
     iFirstMonth = month;
     }
@@ -743,7 +929,7 @@
 //
 const TGlxMediaId CGlxDataSourceMde::GetMonthIdL(const TTime& aMonth)
     {
-    TRACER("CGlxDataSourceMde::GetMonthIdL(const TTime& aMonth)")
+    TRACER("CGlxDataSourceMde::GetMonthIdL()");
     TTime monthStart = iFirstMonth + aMonth.MonthsFrom(iFirstMonth);
     const TTimeIntervalMonths KGlxOneMonth = 1;
     const TTimeIntervalMicroSeconds KGlxOneMicrosecond = 1;
@@ -775,7 +961,8 @@
             month = iSession->NewObjectLC(*iMonthDef, title); 
             
             // A title property def of type text is required.
-            CMdEPropertyDef& titlePropertyDef = iObjectDef->GetPropertyDefL(KPropertyDefNameTitle);
+            CMdEPropertyDef& titlePropertyDef = iObjectDef->GetPropertyDefL(
+                    KPropertyDefNameTitle);
             if (titlePropertyDef.PropertyType() != EPropertyText)
             	{
             	User::Leave(KErrCorrupt);
@@ -784,7 +971,8 @@
             month->AddTextPropertyL (titlePropertyDef, title);
 
             // A size property is required.
-            CMdEPropertyDef& sizePropertyDef = iObjectDef->GetPropertyDefL(KPropertyDefNameSize);
+            CMdEPropertyDef& sizePropertyDef = iObjectDef->GetPropertyDefL(
+                    KPropertyDefNameSize);
             if (sizePropertyDef.PropertyType() != EPropertyUint32)
             	{
             	User::Leave(KErrCorrupt);
@@ -793,7 +981,8 @@
 
             
             // A creation date property is required.
-        	CMdEPropertyDef& creationDateDef = iObjectDef->GetPropertyDefL(KPropertyDefNameCreationDate);
+        	CMdEPropertyDef& creationDateDef = iObjectDef->GetPropertyDefL(
+        	        KPropertyDefNameCreationDate);
             if (creationDateDef.PropertyType() != EPropertyTime)
             	{
             	User::Leave(KErrCorrupt);
@@ -801,7 +990,8 @@
         	month->AddTimePropertyL(creationDateDef, monthStart);
 
             // A last modified date property is required.
-        	CMdEPropertyDef& lmDateDef = iObjectDef->GetPropertyDefL(KPropertyDefNameLastModifiedDate);
+        	CMdEPropertyDef& lmDateDef = iObjectDef->GetPropertyDefL(
+        	        KPropertyDefNameLastModifiedDate);
             if (lmDateDef.PropertyType() != EPropertyTime)
             	{
             	User::Leave(KErrCorrupt);
@@ -865,8 +1055,14 @@
     }	
     
 #ifdef USE_S60_TNM
-void CGlxDataSourceMde::FetchThumbnailL(CGlxRequest* aRequest, MThumbnailFetchRequestObserver& aObserver)
+void CGlxDataSourceMde::FetchThumbnailL(CGlxRequest* aRequest, 
+        MThumbnailFetchRequestObserver& aObserver)
 	{
+    TRACER("CGlxDataSourceMde::FetchThumbnailL()");
+#ifdef _DEBUG
+    iStartTime.HomeTime(); // Get home time
+#endif
+    
 	iTnFetchObserver = &aObserver;
 	
     CGlxThumbnailRequest* request = static_cast<CGlxThumbnailRequest*>(aRequest);
@@ -877,64 +1073,114 @@
 
 	iTnHandle = tnReq.iBitmapHandle;
 	iMediaId = tnReq.iId;
-	if (tnReq.iSizeClass.iWidth < KMaxGridThumbnailWidth)
-	{
-	    iTnEngine->SetFlagsL(CThumbnailManager::ECropToAspectRatio);
+    if (tnReq.iSizeClass.iWidth < KMaxGridThumbnailWidth)
+    	{
+   		iTnEngine->SetFlagsL(CThumbnailManager::ECropToAspectRatio);
 	    iTnEngine->SetThumbnailSizeL(EGridThumbnailSize);
-	    GLX_LOG_INFO("CGlxDataSourceMde::FetchThumbnailL() - Fetch TN attrib - EGridThumbnailSize");
-	}
+	    GLX_LOG_INFO("CGlxDataSourceMde::FetchThumbnailL() - Fetch TN attrib -"
+	            " EGridThumbnailSize");
+    	}
     else
-	{
-	     iTnEngine->SetFlagsL(CThumbnailManager::EDefaultFlags);
-	     iTnEngine->SetThumbnailSizeL(EFullScreenThumbnailSize);
-	     GLX_LOG_INFO("CGlxDataSourceMde::FetchThumbnailL() - Fetch TN attrib - EFullScreenThumbnailSize");
-	}
-    CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(request->ThumbnailInfo()->FilePath(), 0);
-#ifdef _DEBUG
-    iStartTime.UniversalTime();
-#endif
+    	{
+   		iTnEngine->SetFlagsL(CThumbnailManager::EDefaultFlags);
+    	iTnEngine->SetThumbnailSizeL(EFullScreenThumbnailSize);
+    	GLX_LOG_INFO("CGlxDataSourceMde::FetchThumbnailL() - Fetch TN attrib - "
+    	        "EFullScreenThumbnailSize");
+    	}
+
+    if (tnReq.iPriorityMode == TGlxThumbnailRequest::EPrioritizeQuality)
+        {
+        iTnEngine->SetQualityPreferenceL(CThumbnailManager::EOptimizeForQuality);
+        GLX_LOG_INFO("CGlxDataSourceMde::FetchThumbnailL() - Fetch TN attrib -"
+                " EOptimizeForQuality");
+        }
+    else
+        {
+        iTnEngine->SetQualityPreferenceL(CThumbnailManager::EOptimizeForQualityWithPreview);
+        GLX_LOG_INFO("CGlxDataSourceMde::FetchThumbnailL() - Fetch TN attrib -"
+                " EOptimizeForQualityWithPreview");
+        }
+    
+    CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC(
+                                     request->ThumbnailInfo()->FilePath(), 0);
     iTnThumbnailCbId = iTnEngine->GetThumbnailL(*source);
+    CleanupStack::PopAndDestroy(source);
+
     iTnRequestInProgress = ETrue;
-    CleanupStack::PopAndDestroy();
 	}
 
 TInt CGlxDataSourceMde::CancelFetchThumbnail()
 	{
+    TRACER("CGlxDataSourceMde::CancelFetchThumbnail");
 	TInt ret = KErrNone;
 	if (iTnRequestInProgress)
 		{
 		ret = iTnEngine->CancelRequest(iTnThumbnailCbId);
+		iTnRequestInProgress = EFalse;
+        iTnFetchObserver->ThumbnailFetchComplete(KErrCancel,EFalse);
 		}
 	return ret;
 	}
 
-void CGlxDataSourceMde::ThumbnailPreviewReady(MThumbnailData& /*aThumbnail*/, 
-                                                    TThumbnailRequestId /*aId*/)
+// Called when preview thumbnail is created
+void CGlxDataSourceMde::ThumbnailPreviewReady(MThumbnailData& aThumbnail, 
+                                              TThumbnailRequestId aId)
     {
+    TRACER("CGlxDataSourceMde::ThumbnailPreviewReady()");
+    
+    TInt error = KErrNotSupported;
+    if ( aThumbnail.Bitmap() )
+         {
+         GLX_DEBUG1("CGlxDataSourceMde::ThumbnailPreviewReady preview aval");
+         error = KErrNone;
+         }
+    //This function is called number of times as a callback ,
+    //hence not trapping the leaving function which costs time and memory.
+    //Ignoring this for code scanner warnings - Leaving functions called in non-leaving functions.
+    ThumbnailReadyL(error, aThumbnail, aId, EFalse);
     }
 
 // Called when real thumbnail is created
 void CGlxDataSourceMde::ThumbnailReady(TInt aError,
         MThumbnailData& aThumbnail, TThumbnailRequestId aId)
 	{
-	if (iTnThumbnailCbId == aId)
-		{
-		iTnRequestInProgress = EFalse;
+	TRACER("CGlxDataSourceMde::ThumbnailReady");
+	GLX_DEBUG2("GlxDataSourceMde::ThumbnailReady aError=%d", aError);
+	//This function is called number of times as a callback ,
+    //hence not trapping the leaving function which costs time and memory.
+    //Ignoring this for code scanner warnings - Leaving functions called in non-leaving functions.
+	ThumbnailReadyL(aError,aThumbnail, aId, ETrue);
+	}
+
+// ---------------------------------------------------------------------------
+// ThumbnailReadyL
+// ---------------------------------------------------------------------------
+//  
+void CGlxDataSourceMde::ThumbnailReadyL(TInt aError,
+        MThumbnailData& aThumbnail, TThumbnailRequestId aId, TBool aQuality)
+    {
+    TRACER("CGlxDataSourceMde::ThumbnailReadyL()");
+    GLX_DEBUG3("CGlxDataSourceMde::ThumbnailReadyL aError=%d, aQuality=%d",
+                                aError, aQuality);
 #ifdef _DEBUG
-		iStopTime.UniversalTime();
-		GLX_LOG_INFO1("==> S60 TNMan fetch took <%d> us", (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64());
+    iStopTime.HomeTime(); // Get home time
+    GLX_DEBUG2("=>CGlxDataSourceMde::ThumbnailReadyL - TN Fetch took <%d> us",
+                        (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64());
 #endif
-	    if (aError == KErrNone && iTnHandle)
-	    	{
-	    	if (iTnHandle == KGlxMessageIdBackgroundThumbnail)
-	    		{
-	    		BackgroundThumbnailMessageL(iMediaId, TSize(), aError);
-	    		}
-	    	else
-	    		{
+    
+    if (iTnThumbnailCbId == aId)
+        {
+        if (aError == KErrNone && iTnHandle)
+            {
+            if (iTnHandle == KGlxMessageIdBackgroundThumbnail)
+                {
+                BackgroundThumbnailMessageL(iMediaId, TSize(), aError);
+                }
+            else
+                {
                 delete iTnThumbnail;
                 iTnThumbnail = NULL;
-			    iTnThumbnail = aThumbnail.DetachBitmap();
+                iTnThumbnail = aThumbnail.DetachBitmap();
 
 				delete iThumbnail;
                 iThumbnail = NULL;
@@ -948,15 +1194,75 @@
 			    CleanupStack::PushL(context);
 			    context->BitBlt( TPoint(), iTnThumbnail);
 			    CleanupStack::PopAndDestroy(context); 
-			    CleanupStack::PopAndDestroy(device);
-	    		}
-	    	}
+                CleanupStack::PopAndDestroy(device);
+                }
+            }
+        }
+    
+    if (iTnFetchObserver && iTnRequestInProgress)
+        {
+        iTnFetchObserver->ThumbnailFetchComplete(aError, aQuality);
+        iTnHandle = KErrNone;
+        iTnRequestInProgress = EFalse;
+        }
+    }
+#endif
 
-		if (iTnFetchObserver)
-			{
-			iTnFetchObserver->ThumbnailFetchComplete(aError);
-			iTnHandle = KErrNone;
-			}
-		}
-	}
-#endif
+// ---------------------------------------------------------------------------
+// CGlxDataSourceMde
+// HarvestingUpdated
+// ---------------------------------------------------------------------------
+//
+void CGlxDataSourceMde::HarvestingUpdated( 
+            HarvesterEventObserverType /*aHEObserverType*/, 
+            HarvesterEventState aHarvesterEventState,
+            TInt /*aItemsLeft*/)
+    {
+    TRACER("void CGlxDataSourceMde::HarvestingUpdated()");
+    GLX_LOG_INFO1("CGlxDataSourceMde::HarvestingUpdated() aHarvesterEventState=%d",
+            aHarvesterEventState);
+    
+    switch(aHarvesterEventState)
+        {
+        case EHEStateStarted:
+            GLX_LOG_INFO("CGlxDataSourceMde::HarvestingUpdated() - EHEStateStarted");
+        case EHEStateResumed:
+        case EHEStateHarvesting:
+        	 {
+             iHarvestingOngoing = ETrue;
+	         }
+             break;
+        case EHEStatePaused:
+        case EHEStateFinished:
+        	 {
+	         iHarvestingOngoing = EFalse;
+	         GLX_LOG_INFO("CGlxDataSourceMde::HarvestingUpdated() - EHEStateFinished");
+        	 }
+             break;
+        default:
+            break;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// ShutdownNotification
+// ---------------------------------------------------------------------------
+//  
+void CGlxDataSourceMde::ShutdownNotification(TInt aShutdownState)
+    {
+    TRACER("void CGlxDataSourceMde::ShutdownNotification(TInt aShutdownState)")
+    GLX_DEBUG2("CGlxDataSourceMde::ShutdownNotification(aShutdownState=%d)", 
+            aShutdownState);
+
+    if (!iDataSourceReady && 0 == aShutdownState)
+        {
+        GLX_DEBUG1("Photos MdS ShutdownNotification - MdS Server restarted!");
+        CreateSession();
+        }
+
+    if (iDataSourceReady && 1 == aShutdownState)
+        {
+        GLX_DEBUG1("Photos MdS ShutdownNotification - MdS Server Shutdown!");
+        HandleSessionError(*iSession, KErrServerTerminated);
+        }
+    }
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemdsproxy.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemdsproxy.cpp	Fri May 28 21:11:54 2010 +0530
@@ -22,7 +22,7 @@
  * @internal reviewed 11/07/2007 by M Byrne
  */
 
-#include <implementationproxy.h>
+#include <ecom/implementationproxy.h>
 #include "glxdatasourcemds.h"
 #include "glxdatasourcemds.hrh"
 
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmds.cpp	Fri May 28 21:11:54 2010 +0530
@@ -69,8 +69,6 @@
 _LIT(KPropertyDefNameCreationDate, "CreationDate");
 _LIT(KPropertyDefNameLastModifiedDate, "LastModifiedDate");
 _LIT(KPropertyDefNameTitle, "Title");
-//Code commented cout below, so commenting the below line to remove BAD warning
-//_LIT(KPropertyDefNameDRM, "DRM");
 _LIT(KPropertyDefNameFrameCount, "FrameCount");
 _LIT(KPropertyDefNameOrigin, "Origin");
 
@@ -82,7 +80,7 @@
         MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource)
     : CGlxDataSourceTask(aRequest, aObserver, aDataSource)
     {
-    TRACER("CGlxDataSourceTaskMde::CGlxDataSourceTaskMde()")
+    TRACER("CGlxDataSourceTaskMde::CGlxDataSourceTaskMde()");
     // No implementation required
     }
 
@@ -92,7 +90,7 @@
 //  
 CGlxDataSourceTaskMde::~CGlxDataSourceTaskMde()
     {
-    TRACER("CGlxDataSourceTaskMde::~CGlxDataSourceTaskMde()")
+    TRACER("CGlxDataSourceTaskMde::~CGlxDataSourceTaskMde()");
     DestroyQueries();
     }
 
@@ -102,7 +100,7 @@
 //  	
 void CGlxDataSourceTaskMde::ConstructL()
     {
-    TRACER("CGlxDataSourceTaskMde::ConstructL()")
+    TRACER("CGlxDataSourceTaskMde::ConstructL()");
     CreateResponseL();
 #ifdef USE_S60_TNM
     DataSource()->CancelFetchThumbnail();
@@ -117,9 +115,9 @@
 //  
 void CGlxDataSourceTaskMde::CancelRequest()
     {
-    TRACER("CGlxDataSourceTaskMde::CancelRequest()")
-    DestroyQueries();
+    TRACER("CGlxDataSourceTaskMde::CancelRequest()");
     iCancelled = ETrue;
+    DestroyQueries();    
     }
 
 // ----------------------------------------------------------------------------
@@ -130,7 +128,7 @@
                                                      TInt /*aFirstNewItemIndex*/,
                                                      TInt /*aNewItemCount*/ )
     {
-    TRACER("CGlxDataSourceTaskMde::HandleQueryNewResults()")
+    TRACER("CGlxDataSourceTaskMde::HandleQueryNewResults()");
     // Not used.
     }
 
@@ -144,7 +142,7 @@
                                 TInt /*aNewRelationItemCount*/,
                                 TInt /*aNewEventItemCount*/)
     {
-    TRACER("CGlxDataSourceTaskMde::HandleQueryNewResults()")
+    TRACER("CGlxDataSourceTaskMde::HandleQueryNewResults()");
     // Not used.
     }
 
@@ -155,7 +153,7 @@
 //
 void CGlxDataSourceTaskMde::HandleQueryCompleted(CMdEQuery& aQuery, TInt aError)
     {
-    TRACER("CGlxDataSourceTaskMde::HandleQueryCompleted()")
+    TRACER("CGlxDataSourceTaskMde::HandleQueryCompleted()");
     __ASSERT_ALWAYS(&aQuery == iQueries[0], Panic(EGlxPanicQueryLogicError));
 
     TInt err = aError;
@@ -164,7 +162,7 @@
         TRAP(err, HandleQueryCompletedL(aQuery));
         }
 
-    if (err != KErrNone)
+    if (err != KErrNone && !iCancelled)
         {
         HandleRequestComplete(err);
         }
@@ -176,7 +174,7 @@
 //   
 CGlxDataSourceMde* CGlxDataSourceTaskMde::DataSource()
     {
-    TRACER("CGlxDataSourceTaskMde::DataSource()")
+    TRACER("CGlxDataSourceTaskMde::DataSource()");
     return static_cast<CGlxDataSourceMde*>(iDataSource);
     }
 
@@ -184,9 +182,10 @@
 //  CGlxDataSourceTaskMde::AddMonthFilterL
 // ----------------------------------------------------------------------------
 //     
-void CGlxDataSourceTaskMde::AddMonthFilterL(const TGlxMediaId& aContainerId, TGlxFilterProperties& aFilterProperties)
+void CGlxDataSourceTaskMde::AddMonthFilterL(const TGlxMediaId& aContainerId,
+        TGlxFilterProperties& aFilterProperties)
     {
-    TRACER("CGlxDataSourceTaskMde::AddMonthFilterL(const TGlxMediaId& aContainerId, TGlxFilterProperties& aFilterProperties)")
+    TRACER("CGlxDataSourceTaskMde::AddMonthFilterL(const TGlxMediaId& aContainerId, TGlxFilterProperties& aFilterProperties)");
     CMdEObject* month = DataSource()->Session().GetObjectL(aContainerId.Value());
     if( !month )
         {
@@ -204,16 +203,19 @@
 //  CGlxDataSourceTaskMde::AddMonthFilterL
 // ----------------------------------------------------------------------------
 //   
-void CGlxDataSourceTaskMde::AddMonthFilterL(CMdEObject* aMonth, TGlxFilterProperties& aFilterProperties)
+void CGlxDataSourceTaskMde::AddMonthFilterL(CMdEObject* aMonth, TGlxFilterProperties& 
+        aFilterProperties)
     {
-    TRACER("CGlxDataSourceTaskMde::AddMonthFilterL(CMdEObject* aMonth, TGlxFilterProperties& aFilterProperties)")
-    CMdEPropertyDef& creationDateDef = DataSource()->ObjectDef().GetPropertyDefL(KPropertyDefNameCreationDate);
+    TRACER("CGlxDataSourceTaskMde::AddMonthFilterL(CMdEObject* aMonth, TGlxFilterProperties& aFilterProperties)");
+    CMdEPropertyDef& creationDateDef = DataSource()->ObjectDef().GetPropertyDefL(
+            KPropertyDefNameCreationDate);
     if (creationDateDef.PropertyType() != EPropertyTime)
         {
         User::Leave(KErrCorrupt);
         }
 
-    CMdEPropertyDef& lmDateDef = DataSource()->ObjectDef().GetPropertyDefL(KPropertyDefNameLastModifiedDate);
+    CMdEPropertyDef& lmDateDef = DataSource()->ObjectDef().GetPropertyDefL(
+            KPropertyDefNameLastModifiedDate);
     if (lmDateDef.PropertyType() != EPropertyTime)
         {
         User::Leave(KErrCorrupt);
@@ -240,15 +242,21 @@
 //  CGlxDataSourceTaskMde::SetQueryConditionsL
 // ----------------------------------------------------------------------------
 //    
-void CGlxDataSourceTaskMde::SetQueryConditionsL(CMdEQuery& aQuery, const TGlxFilterProperties& aFilterProperties, const TGlxMediaId aContainerId, CMdEObjectDef& aObjectDef)
+void CGlxDataSourceTaskMde::SetQueryConditionsL(CMdEQuery& aQuery,
+        const TGlxFilterProperties& aFilterProperties, const TGlxMediaId aContainerId,
+            CMdEObjectDef& aObjectDef)
     {
-    TRACER("CGlxDataSourceTaskMde::SetQueryConditionsL()")
+    TRACER("CGlxDataSourceTaskMde::SetQueryConditionsL()");
     
     CMdELogicCondition& rootCondition = aQuery.Conditions();
     CMdEObjectDef* objectDef = &aObjectDef;
 
     SetQueryFilterConditionsL(rootCondition, *objectDef, aFilterProperties);
-    SetSortOrderL(aQuery, aObjectDef, aFilterProperties);
+
+    if (aQuery.ResultMode() != EQueryResultModeCount)
+        {
+        SetSortOrderL(aQuery, aObjectDef, aFilterProperties);
+        }
     
     if( KGlxCollectionRootId != aContainerId.Value() )
         {
@@ -257,12 +265,14 @@
         objectDef = &DataSource()->ObjectDef();
         if( DataSource()->ContainerIsLeft(aObjectDef) )
             {
-            relationCondition = &rootCondition.AddRelationConditionL(DataSource()->ContainsDef(), ERelationConditionSideRight);
+            relationCondition = &rootCondition.AddRelationConditionL(
+                    DataSource()->ContainsDef(), ERelationConditionSideRight);
             containerCondition = &relationCondition->LeftL();
             }
         else
             {
-            relationCondition = &rootCondition.AddRelationConditionL(DataSource()->ContainsDef(), ERelationConditionSideLeft);
+            relationCondition = &rootCondition.AddRelationConditionL(
+                    DataSource()->ContainsDef(), ERelationConditionSideLeft);
             containerCondition = &relationCondition->RightL();
             }
         containerCondition->AddObjectConditionL(aContainerId.Value());
@@ -278,7 +288,7 @@
                                    aLogicCondition, CMdEObjectDef& aObjectDef,
                                  const TGlxFilterProperties& aFilterProperties)
     {
-    TRACER("CGlxDataSourceTaskMde::SetQueryFilterConditionsL()")
+    TRACER("CGlxDataSourceTaskMde::SetQueryFilterConditionsL()");
     
     if( aFilterProperties.iUri )
         {
@@ -298,9 +308,12 @@
             }
         }
     
-    if( ( aFilterProperties.iMinCount > 0 ) && ( CGlxDataSource::EContainerTypeNotAContainer != DataSource()->ContainerType(&aObjectDef) ) )
+    if( ( aFilterProperties.iMinCount > 0 ) && ( 
+            CGlxDataSource::EContainerTypeNotAContainer != DataSource()->ContainerType(
+                    &aObjectDef) ) )
         {        
-		TMdEUintRange range(aFilterProperties.iMinCount,aFilterProperties.iMinCount,EMdERangeTypeGreaterOrEqual);
+		TMdEUintRange range(aFilterProperties.iMinCount,
+		        aFilterProperties.iMinCount,EMdERangeTypeGreaterOrEqual);
 		aLogicCondition.AddObjectConditionL(range);
         }
 
@@ -310,12 +323,15 @@
         if( DataSource()->ContainerIsLeft(aObjectDef) )
             {
             CMdERelationCondition& relationCondition = 
-                    aLogicCondition.AddRelationConditionL(DataSource()->ContainsDef(), ERelationConditionSideLeft);
-            relationCondition.RightL().AddObjectConditionL(aFilterProperties.iContainsItem.Value());
+                    aLogicCondition.AddRelationConditionL(
+                            DataSource()->ContainsDef(), ERelationConditionSideLeft);
+            relationCondition.RightL().AddObjectConditionL(
+                    aFilterProperties.iContainsItem.Value());
             }
         else
             {
-            CMdERelationCondition& relationCondition = aLogicCondition.AddRelationConditionL(DataSource()->ContainsDef(), ERelationConditionSideRight);
+            CMdERelationCondition& relationCondition = aLogicCondition.AddRelationConditionL(
+                    DataSource()->ContainsDef(), ERelationConditionSideRight);
             relationCondition.LeftL().AddObjectConditionL(aFilterProperties.iContainsItem.Value());
             }
         }
@@ -326,30 +342,39 @@
         if( EGlxFilterOriginDownload == aFilterProperties.iOrigin )
             {
             // The download collection shows all but captured items
-            aLogicCondition.AddPropertyConditionL(originProperty, TMdEUintNotEqual(MdeConstants::Object::ECamera));
+            aLogicCondition.AddPropertyConditionL(originProperty, TMdEUintNotEqual(
+                    MdeConstants::Object::ECamera));
             }
 		else if(EGlxFilterOriginCamera == aFilterProperties.iOrigin )            
 			{
 			// The camera collection Shows the captured Items
-			aLogicCondition.AddPropertyConditionL(originProperty, TMdEUintEqual(MdeConstants::Object::ECamera));            
+			aLogicCondition.AddPropertyConditionL(originProperty, TMdEUintEqual(
+			        MdeConstants::Object::ECamera));            
 			}
+		else if(EGlxFilterOriginAll == aFilterProperties.iOrigin )            
+			{
+			// The Months Collection Populates All the Items, filter 
+		    // it for Images and Videos only
+            CMdELogicCondition& logicCondition = 
+                aLogicCondition.AddLogicConditionL(ELogicConditionOperatorOr);
+            logicCondition.AddObjectConditionL( DataSource()->ImageDef() ); 
+			}        
         }
         
     if( aFilterProperties.iExcludeAnimation )
         {
-        //__ASSERT_DEBUG((EGlxFilterImage == aFilterProperties.iItemType), Panic(EGlxPanicIllegalArgument));
         // Exclude any image with a frame count > 1
         const TInt excludeAllImagesAboveOrEqualToThisFrameCount = 2;
-        CMdEPropertyDef& frameCountProperty = DataSource()->ImageDef().GetPropertyDefL(KPropertyDefNameFrameCount);
-        aLogicCondition.AddPropertyConditionL(frameCountProperty, TMdEIntLess(excludeAllImagesAboveOrEqualToThisFrameCount));
+        CMdEPropertyDef& frameCountProperty = DataSource()->ImageDef().GetPropertyDefL(
+                KPropertyDefNameFrameCount);
+        aLogicCondition.AddPropertyConditionL(frameCountProperty, TMdEIntLess(
+                excludeAllImagesAboveOrEqualToThisFrameCount));
         }
         
     if( aFilterProperties.iNoDRM )
         {
-        __ASSERT_DEBUG((EGlxFilterImage == aFilterProperties.iItemType), Panic(EGlxPanicIllegalArgument));
-        // Exclude any image which is DRM protected
-        //CMdEPropertyDef& drmProperty = DataSource()->ImageDef().GetPropertyDefL(KPropertyDefNameDRM);
-        //aLogicCondition.AddPropertyConditionL(drmProperty, EFalse);
+        __ASSERT_DEBUG((EGlxFilterImage == aFilterProperties.iItemType), Panic(
+                EGlxPanicIllegalArgument));
         }
         
     if( aFilterProperties.iPath )          // If this is set. Then we need to filter on the Ids it supplies
@@ -373,19 +398,22 @@
         
     if( !aFilterProperties.iIncludeCameraAlbum )
         {
-        CMdEObjectCondition& objectCondition = aLogicCondition.AddObjectConditionL(DataSource()->CameraAlbumId().Value());
+        CMdEObjectCondition& objectCondition = aLogicCondition.AddObjectConditionL(
+        		DataSource()->CameraAlbumId().Value());
         objectCondition.SetNegate(ETrue);
         }
     
     if( TTime(0) != aFilterProperties.iStartDate )
         {
-        CMdEPropertyDef& creationDateDef = aObjectDef.GetPropertyDefL(KPropertyDefNameCreationDate);
+        CMdEPropertyDef& creationDateDef = aObjectDef.GetPropertyDefL(
+                KPropertyDefNameCreationDate);
         if (creationDateDef.PropertyType() != EPropertyTime)
             {
             User::Leave(KErrCorrupt);
             }
 
-        aLogicCondition.AddPropertyConditionL(creationDateDef, TMdETimeBetween(aFilterProperties.iStartDate, aFilterProperties.iEndDate));
+        aLogicCondition.AddPropertyConditionL(creationDateDef, TMdETimeBetween(
+                aFilterProperties.iStartDate, aFilterProperties.iEndDate));
         }
     }
 
@@ -396,13 +424,14 @@
 void CGlxDataSourceTaskMde::SetSortOrderL(CMdEQuery& aQuery, CMdEObjectDef& aObjectDef, 
                                          const TGlxFilterProperties& aFilterProperties)
     {
-    TRACER("CGlxDataSourceTaskMde::SetSortOrderL()")
+    TRACER("CGlxDataSourceTaskMde::SetSortOrderL()");
     switch(aFilterProperties.iSortOrder)
         {
         case EGlxFilterSortOrderAlphabetical:
             {
             CMdEPropertyDef& titleProperty = aObjectDef.GetPropertyDefL(KPropertyDefNameTitle);
-            TMdEOrderRule orderRule(titleProperty, aFilterProperties.iSortDirection == EGlxFilterSortDirectionAscending);
+            TMdEOrderRule orderRule(titleProperty, aFilterProperties.iSortDirection ==
+            EGlxFilterSortDirectionAscending);
             orderRule.SetType(EOrderRuleTypeProperty);
             orderRule.SetCaseSensitive(EFalse);
             aQuery.AppendOrderRuleL(orderRule);
@@ -410,27 +439,35 @@
             }
          case EGlxFilterSortOrderItemCount:
             {            
-            TMdEOrderRule orderRule(EOrderRuleTypeUsageCount, aFilterProperties.iSortDirection == EGlxFilterSortDirectionAscending);
+            //Order rule is needed for tags popularity            
+            TMdEOrderRule orderRule(EOrderRuleTypeUsageCount, aFilterProperties.iSortDirection ==
+            EGlxFilterSortDirectionAscending);
             aQuery.AppendOrderRuleL(orderRule);            
             break;
             }
         case EGlxFilterSortOrderCaptureDate:
             {
-            CMdEPropertyDef& creationDateProperty = aObjectDef.GetPropertyDefL(KPropertyDefNameCreationDate);
-            TMdEOrderRule orderRule(creationDateProperty, aFilterProperties.iSortDirection == EGlxFilterSortDirectionAscending);
+            CMdEPropertyDef& creationDateProperty = aObjectDef.GetPropertyDefL(
+                    KPropertyDefNameCreationDate);
+            TMdEOrderRule orderRule(creationDateProperty, aFilterProperties.iSortDirection ==
+            EGlxFilterSortDirectionAscending);
             orderRule.SetType(EOrderRuleTypeProperty);
             aQuery.AppendOrderRuleL(orderRule);
-            TMdEOrderRule orderRule2(EOrderRuleTypeItemID, aFilterProperties.iSortDirection == EGlxFilterSortDirectionAscending);
+            TMdEOrderRule orderRule2(EOrderRuleTypeItemID, aFilterProperties.iSortDirection ==
+            EGlxFilterSortDirectionAscending);
             aQuery.AppendOrderRuleL(orderRule2);
             break;
             }
          case EGlxFilterSortOrderModifiedDate:
             {
-            CMdEPropertyDef& modifiedDateProperty = aObjectDef.GetPropertyDefL(KPropertyDefNameLastModifiedDate);
-            TMdEOrderRule orderRule(modifiedDateProperty, aFilterProperties.iSortDirection == EGlxFilterSortDirectionAscending);
+            CMdEPropertyDef& modifiedDateProperty = aObjectDef.GetPropertyDefL(
+                    KPropertyDefNameLastModifiedDate);
+            TMdEOrderRule orderRule(modifiedDateProperty, aFilterProperties.iSortDirection == 
+            EGlxFilterSortDirectionAscending);
             orderRule.SetType(EOrderRuleTypeProperty);
             aQuery.AppendOrderRuleL(orderRule);
-            TMdEOrderRule orderRule2(EOrderRuleTypeItemID, aFilterProperties.iSortDirection == EGlxFilterSortDirectionAscending);
+            TMdEOrderRule orderRule2(EOrderRuleTypeItemID, aFilterProperties.iSortDirection == 
+            EGlxFilterSortDirectionAscending);
             aQuery.AppendOrderRuleL(orderRule2);
             break;
             }
@@ -445,14 +482,16 @@
 //  CGlxDataSourceTaskMde::MaxQueryResultsCount
 // ----------------------------------------------------------------------------
 // 
-TInt CGlxDataSourceTaskMde::MaxQueryResultsCount(const TGlxFilterProperties& aFilterProperties) const
+TInt CGlxDataSourceTaskMde::MaxQueryResultsCount(const TGlxFilterProperties& 
+        aFilterProperties) const
     {
-    TRACER("CGlxDataSourceTaskMde::MaxQueryResultsCount()")
+    TRACER("CGlxDataSourceTaskMde::MaxQueryResultsCount()");
     TInt ret = KMdEQueryDefaultMaxCount;
-    if (aFilterProperties.iLastCaptureDate)
+    if (aFilterProperties.iLastCaptureDate || aFilterProperties.iMaxCount == 1)
         {
         ret = 1;
         }
+    GLX_DEBUG2("CGlxDataSourceTaskMde::MaxQueryResultsCount ret=%d", ret);   
     return ret;
     }
 
@@ -462,7 +501,7 @@
 // 
 void CGlxDataSourceTaskMde::RemoveQuery()
     {
-    TRACER("CGlxDataSourceTaskMde::RemoveQuery()")
+    TRACER("CGlxDataSourceTaskMde::RemoveQuery()");
     CMdEQuery* query = iQueries[0];
     iQueryTypes.Remove(0);
     iQueries.Remove(0);
@@ -478,7 +517,7 @@
         TBool aIsContent, TGlxQueryType aQueryType, TQueryResultMode aResultMode, 
                                                 const TGlxMediaId& aContainerId)
     {
-    TRACER("CGlxDataSourceTaskMde::DoQueryL()")
+    TRACER("CGlxDataSourceTaskMde::DoQueryL()");
     
     CMdEObjectDef* queryBaseObject = &aObjectDef;
     if( aIsContent )
@@ -503,11 +542,12 @@
             }
         }
 
-    CMdEQuery* query = DataSource()->Session().NewObjectQueryL(*DataSource()->NamespaceDef(), *queryBaseObject, this);
+    CMdEQuery* query = DataSource()->Session().NewObjectQueryL(*DataSource()->NamespaceDef(),
+            *queryBaseObject, this);
     CleanupStack::PushL(query);
     
+    query->SetResultMode(aResultMode);
     SetQueryConditionsL(*query, iFilterProperties, aContainerId, aObjectDef);   
-    query->SetResultMode(aResultMode);
     
     CleanupStack::Pop(query);
     
@@ -523,7 +563,7 @@
 void CGlxDataSourceTaskMde::QueueImageVideoObjectQueriesL(const RArray<TGlxMediaId>& aObjectIds,
                                           const TGlxFilterProperties& aFilterProperties)
     {
-    TRACER("CGlxDataSourceTaskMde::QueueImageVideoObjectQueriesL()")
+    TRACER("CGlxDataSourceTaskMde::QueueImageVideoObjectQueriesL()");
     if (aFilterProperties.iItemType == EGlxFilterImage)
         {
         // Only perform the image query
@@ -548,7 +588,7 @@
 //
 void CGlxDataSourceTaskMde::QueueTagObjectQueryL(const RArray<TGlxMediaId>& aObjectIds)
     {
-    TRACER("CGlxDataSourceTaskMde::QueueTagObjectQueryL()")
+    TRACER("CGlxDataSourceTaskMde::QueueTagObjectQueryL()");
     QueueObjectQueryL(DataSource()->TagDef(), aObjectIds, EImageVideoQuery);
     }
 
@@ -558,14 +598,14 @@
 //
 void CGlxDataSourceTaskMde::QueueAlbumObjectQueryL(const RArray<TGlxMediaId>& aObjectIds)
     {
-    TRACER("CGlxDataSourceTaskMde::QueueAlbumObjectQueryL()")
+    TRACER("CGlxDataSourceTaskMde::QueueAlbumObjectQueryL()");
     QueueObjectQueryL(DataSource()->AlbumDef(), aObjectIds, EImageVideoQuery);
     }
 
 
 void CGlxDataSourceTaskMde::QueueMonthObjectQueryL(const RArray<TGlxMediaId>& aObjectIds)
     {
-    TRACER("CGlxDataSourceTaskMde::QueueMonthObjectQueryL()")
+    TRACER("CGlxDataSourceTaskMde::QueueMonthObjectQueryL()");
     QueueObjectQueryL(DataSource()->MonthDef(), aObjectIds, EImageVideoQuery);
     }
 
@@ -576,14 +616,15 @@
 void CGlxDataSourceTaskMde::QueueObjectQueryL(CMdEObjectDef& aObjectDef, 
         const RArray<TGlxMediaId>& aObjectIds, const TGlxQueryType& aQueryType)
     {
-    TRACER("CGlxDataSourceTaskMde::QueueObjectQueryL()")
-    CMdEQuery* query = DataSource()->Session().NewObjectQueryL(*DataSource()->NamespaceDef(), aObjectDef,  this);
+    TRACER("CGlxDataSourceTaskMde::QueueObjectQueryL()");
+    CMdEQuery* query = DataSource()->Session().NewObjectQueryL(*DataSource()->NamespaceDef(), 
+            aObjectDef,  this);
     CleanupStack::PushL(query);
  
     CMdELogicCondition& lc = query->Conditions();
     NGlxDataSourceMdsUtility::AddObjectConditionL(lc,aObjectIds);
     
-    query->SetResultMode(EQueryResultModeObjectWithFreetexts);
+    query->SetResultMode(EQueryResultModeItem);
     
     CleanupStack::Pop(query);
     AppendQueryL(query, aQueryType);
@@ -596,7 +637,7 @@
 // 
 void CGlxDataSourceTaskMde::AppendQueryL(CMdEQuery* aQuery, const TGlxQueryType& aQueryType)
     {
-    TRACER("CGlxDataSourceTaskMde::AppendQueryL()")
+    TRACER("CGlxDataSourceTaskMde::AppendQueryL()");
     CleanupStack::PushL(aQuery);
     
     TInt err = iQueryTypes.Append(aQueryType);
@@ -618,7 +659,7 @@
 // 
 void CGlxDataSourceTaskMde::ExecuteQueryL()
     {
-    TRACER("CGlxDataSourceTaskMde::ExecuteQueryL()")
+    TRACER("CGlxDataSourceTaskMde::ExecuteQueryL()");
     __ASSERT_DEBUG(iQueries.Count(), Panic(EGlxPanicQueryLogicError));
     iQueries[0]->FindL();
     }
@@ -629,9 +670,22 @@
 // 
 void CGlxDataSourceTaskMde::HandleQueryCompletedL(CMdEQuery& aQuery)
     {
-    TRACER("CGlxDataSourceTaskMde::HandleQueryCompletedL()")
+    TRACER("CGlxDataSourceTaskMde::HandleQueryCompletedL()");
     DoHandleQueryCompletedL(aQuery);
-    RemoveQuery();
+    
+    // Both the function calls should be executed if any
+    // request is not cancelled before completion.
+    // All the pending Queries are already destroyed in CancelRequest.
+    // Hence we do not have to call RemoveQuery here. That will lead to
+    // User 130 crash. 
+    // DoNextQuery tries to get iQueries.Count(). Since iQueries is destroyed
+    // in CancelRequest 
+    if (iCancelled)
+    	{ 
+    	GLX_LOG_INFO("***Query already Removed. Hence Return***");
+    	return;  	
+    	}  
+    RemoveQuery();  
     DoNextQueryL();
     }
 
@@ -641,7 +695,7 @@
 // 
 void CGlxDataSourceTaskMde::DestroyQueries()
     {
-    TRACER("CGlxDataSourceTaskMde::DestroyQueries()")
+    TRACER("CGlxDataSourceTaskMde::DestroyQueries()");
     for (TInt i = 0; i < iQueries.Count(); i++)
         {
         // Ensure that there are not any running queries
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsattribute.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsattribute.cpp	Fri May 28 21:11:54 2010 +0530
@@ -57,7 +57,7 @@
 #include <mpxmediadrmdefs.h>
 #include <mpxmediageneraldefs.h>
 #include <imageconversion.h>
-
+#include <caf/content.h>
 #include "glxdatasourcemds.h"
 #include "glxdatasourcemds.hrh"
 #include "glxdatasourcemdsutility.h"
@@ -83,7 +83,9 @@
 //  Constructor
 // ----------------------------------------------------------------------------
 //  
-CGlxDataSourceTaskMdeAttributeMde::CGlxDataSourceTaskMdeAttributeMde(CGlxGetRequest* aRequest, MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource)
+CGlxDataSourceTaskMdeAttributeMde::CGlxDataSourceTaskMdeAttributeMde(
+        CGlxGetRequest* aRequest,MGlxDataSourceRequestObserver& aObserver,
+            CGlxDataSource* aDataSource)
     : CGlxDataSourceTaskMde(aRequest, aObserver, aDataSource)
     {
     TRACER("CGlxDataSourceTaskMdeAttribute::CGlxDataSourceTaskMdeAttribute()")
@@ -108,16 +110,14 @@
 void CGlxDataSourceTaskMdeAttributeMde::ExecuteRequestL()
     {
     TRACER("CGlxDataSourceTaskMdeAttribute::ExecuteRequestL()")    
-    GLX_LOG_ENTRY_EXIT("CGlxDataSourceTaskMdeAttribute::ExecuteRequestL");
+#ifdef _DEBUG
+    iStartTime.HomeTime(); 
+#endif
  
     CGlxGetRequest* request = static_cast<CGlxGetRequest*>(iRequest);
         
     __ASSERT_DEBUG(request->MediaIds().Count() > 0, User::Invariant());
-
- 	GLX_LOG_INFO("==> CGlxDataSourceTaskMdeAttributeMde::ExecuteRequestL");
-#ifdef _DEBUG
- 	iStartTime.HomeTime(); // Get home time
-#endif
+    
     if (request->MediaIds().Count() > 1)
         {
         iMediaArray = CMPXMediaArray::NewL();
@@ -130,26 +130,8 @@
     	}
     else
     	{
-        
-     /*  __ASSERT_DEBUG(dynamic_cast<CGlxGetRequest*>(iRequest), Panic(EGlxPanicLogicError));
-        CGlxGetRequest* request = static_cast<CGlxGetRequest*>(iRequest);   
-        
-    	QueueImageVideoObjectQueriesL(request->MediaIds(), iFilterProperties);
-    	QueueAlbumObjectQueryL(request->MediaIds());
-        QueueTagObjectQueryL(request->MediaIds());
-        QueueMonthObjectQueryL(request->MediaIds());
-        
-	    if (LocationAttributeRequested())
-	        {
-	        QueueLocaitonQueryL();
-	        }
-	    
-    	*/
-    	
         __ASSERT_DEBUG(dynamic_cast<CGlxGetRequest*>(iRequest), Panic(EGlxPanicLogicError));
         CGlxGetRequest* request = static_cast<CGlxGetRequest*>(iRequest);   
-// Not used anywhere, commenting out this line to avoid BAD warning
-//        const RArray<TItemId>& mediaIds = reinterpret_cast<const RArray<TItemId>&>(request->MediaIds());
         
         switch(iFilterProperties.iItemType)
             {
@@ -211,6 +193,11 @@
             Panic(EGlxPanicLogicError);
         break;
         }  
+#ifdef _DEBUG
+    iStopTime.HomeTime(); 
+    GLX_DEBUG2("CGlxDataSourceTaskMdeAttributeMde:DoHandleQueryCompletedL() took %d us",
+                     (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64());
+#endif  
     }
 
 // ----------------------------------------------------------------------------
@@ -292,7 +279,8 @@
         {
         if ( request->Attributes()[i] == KMPXMediaGeneralId )
             {
-            aEntry->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, (TMPXItemId)request->CollectionPluginUid().iUid);
+            aEntry->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, (
+                    TMPXItemId)request->CollectionPluginUid().iUid);
             }
         else if ( request->Attributes()[i] == KMPXMediaGeneralType )
             {
@@ -323,12 +311,14 @@
 				{
 				case KGlxCollectionPluginCameraImplementationUid:
 					{   
-#if 0 	/// @todo AB camera album				     		
+#if 0 	/// AB camera album				     		
 					container = DataSource()->CameraAlbumId();
 					objectDef = &DataSource()->AlbumDef();
 #endif					
 					filterProperties.iItemType = EGlxFilterImage;
-					QueueObjectQueryL(*objectDef, isContent, EAttributeQuery, EQueryResultModeCount, container, request->Attributes()[i], aEntry,  filterProperties);
+					QueueObjectQueryL(*objectDef, isContent, EAttributeQuery,
+					        EQueryResultModeCount, container, 
+					        request->Attributes()[i], aEntry,  filterProperties);
 					break;                    	
 					}
 				default:
@@ -350,12 +340,14 @@
 				{
 				case KGlxCollectionPluginCameraImplementationUid:
 					{   
-#if 0 	/// @todo AB camera album					     		
+#if 0 	/// AB camera album					     		
 					container = DataSource()->CameraAlbumId();
 					objectDef = &DataSource()->AlbumDef();
 #endif					
 					filterProperties.iItemType = EGlxFilterVideo;
-					QueueObjectQueryL(*objectDef, isContent, EAttributeQuery, EQueryResultModeCount, container, request->Attributes()[i], aEntry,  filterProperties);
+					QueueObjectQueryL(*objectDef, isContent, EAttributeQuery, 
+					        EQueryResultModeCount, container,
+					        request->Attributes()[i],aEntry,  filterProperties);
 					break;                    	
 					}
 				default:
@@ -366,7 +358,8 @@
 			}
             
             
-        else if ( ( request->Attributes()[i] == KMPXMediaGeneralCount ) || ( request->Attributes()[i] == KGlxMediaCollectionInternalUsageCount ) )
+        else if ( ( request->Attributes()[i] == KMPXMediaGeneralCount ) || 
+                ( request->Attributes()[i] == KGlxMediaCollectionInternalUsageCount ) )
             {
             TGlxMediaId container = TGlxMediaId(KGlxCollectionRootId);
             CMdEObjectDef* objectDef = &DataSource()->ObjectDef();
@@ -395,39 +388,51 @@
                     }
                 case KGlxCollectionPluginMonthsImplementationUid:
                     {
-					filterProperties.iOrigin = EGlxFilterOriginCamera;                    	
+					filterProperties.iOrigin = EGlxFilterOriginAll;
                     break;
                     }
-              /*  case KGlxCollectionPluginDownloadsImplementationUid:
-                    {
-                    filterProperties.iOrigin = EGlxFilterOriginDownload;
-                    break;
-                    }*/
                 default:
                     {
                     // default gallery query returns all objects as per filter
                     break;
                     }
                 }
-            QueueObjectQueryL(*objectDef, isContent, EAttributeQuery, EQueryResultModeCount, container, request->Attributes()[i], aEntry,  filterProperties);
+            QueueObjectQueryL(*objectDef, isContent, EAttributeQuery, 
+                    EQueryResultModeCount, container, request->Attributes()[i], 
+                    aEntry,  filterProperties);
             }
         else if ( request->Attributes()[i] == KMPXMediaColDetailSpaceId )
             {
-            aEntry->SetTObjectValueL(KMPXMediaColDetailSpaceId, KGlxDataSourceMdeImplementationUid);
+            aEntry->SetTObjectValueL(KMPXMediaColDetailSpaceId, 
+                    KGlxDataSourceMdeImplementationUid);
             }
         else if ( request->Attributes()[i] == KGlxMediaCollectionInternalStartDate )
             {
+            GLX_DEBUG1("CGlxDataSourceTaskMdeAttributeMde::AddCollectionAttributesL - KGlxMediaCollectionInternalStartDate");
             TGlxMediaId container = TGlxMediaId(KGlxCollectionRootId);
             TGlxFilterProperties filterProperties = iFilterProperties;
             filterProperties.iSortOrder = EGlxFilterSortOrderCaptureDate;
             filterProperties.iSortDirection = EGlxFilterSortDirectionAscending;
-            filterProperties.iOrigin = EGlxFilterOriginCamera;
+            filterProperties.iOrigin = EGlxFilterOriginAll;
+            filterProperties.iMaxCount = 1 ;             
 
-            QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery, EQueryResultModeObjectWithFreetexts,container, KGlxMediaCollectionInternalStartDate, aEntry, filterProperties);
+            QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery, 
+                    EQueryResultModeItem, container, 
+                    KGlxMediaCollectionInternalStartDate, aEntry, filterProperties);
             }
         else if ( request->Attributes()[i] == KGlxMediaCollectionInternalEndDate )
             {
-            // not necessary to be requested, returned when StartDate requested
+            GLX_DEBUG1("CGlxDataSourceTaskMdeAttributeMde::AddCollectionAttributesL - KGlxMediaCollectionInternalEndDate");
+            TGlxMediaId container = TGlxMediaId(KGlxCollectionRootId);
+            TGlxFilterProperties filterProperties = iFilterProperties;
+            filterProperties.iSortOrder = EGlxFilterSortOrderCaptureDate;
+            filterProperties.iSortDirection = EGlxFilterSortDirectionDescending;
+            filterProperties.iOrigin = EGlxFilterOriginAll;
+            filterProperties.iMaxCount = 1 ;             
+
+            QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery, 
+                    EQueryResultModeItem, container, 
+                    KGlxMediaCollectionInternalEndDate, aEntry, filterProperties);
             }
         else if ( request->Attributes()[i] == KGlxMediaGeneralSlideshowableContent )
             {
@@ -456,7 +461,8 @@
 // CGlxDataSourceTaskMdeAttribute::AddContainerAttributesL
 // ----------------------------------------------------------------------------
 //
-void CGlxDataSourceTaskMdeAttributeMde::AddContainerAttributesL(CMPXMedia* aEntry, CMdEObject* aContainer, CGlxDataSource::TContainerType aType)
+void CGlxDataSourceTaskMdeAttributeMde::AddContainerAttributesL(CMPXMedia* aEntry, 
+        CMdEObject* aContainer, CGlxDataSource::TContainerType aType)
     {
     TRACER("CGlxDataSourceTaskMdeAttribute::AddContainerAttributesL()")
     __ASSERT_DEBUG(aEntry, Panic(EGlxPanicLogicError));
@@ -464,12 +470,13 @@
     __ASSERT_DEBUG(dynamic_cast<CGlxGetRequest*>(iRequest), Panic(EGlxPanicLogicError));
     CGlxGetRequest* request = static_cast<CGlxGetRequest*>(iRequest);
 
-    /// @todo check property defs are valid and type is correct
+    /// check property defs are valid and type is correct
     for ( TInt i = 0; i < request->Attributes().Count(); i++ )
         {
         if ( request->Attributes()[i] == KMPXMediaGeneralId )
             {
-            aEntry->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, (TMPXItemId)aContainer->Id());
+            aEntry->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, 
+                    (TMPXItemId)aContainer->Id());
             }
         else if ( request->Attributes()[i] == KMPXMediaGeneralType )
             {
@@ -501,7 +508,8 @@
         else if ( request->Attributes()[i] == KMPXMediaGeneralTitle )
             {
             CMdEProperty* title;
-            CMdEPropertyDef& titleProperty = aContainer->Def().GetPropertyDefL(KPropertyDefNameTitle);
+            CMdEPropertyDef& titleProperty = aContainer->Def().GetPropertyDefL(
+                    KPropertyDefNameTitle);
             TInt titleIndex = aContainer->Property(titleProperty, title);
             if(titleIndex == KErrNotFound)
                 {
@@ -510,22 +518,26 @@
                 }
             else
                 {
-                aEntry->SetTextValueL(KMPXMediaGeneralTitle, static_cast<CMdETextProperty*>(title)->Value());
+                aEntry->SetTextValueL(KMPXMediaGeneralTitle, static_cast<CMdETextProperty*>
+                (title)->Value());
                 }
             switch (aType)
                 {
                 case CGlxDataSource::EContainerTypeAlbum:
                     {
                     CMdEProperty* albumType;
-                    CMdEPropertyDef& albumTypeProperty = aContainer->Def().GetPropertyDefL(KPropertyDefNameAlbumType);
+                    CMdEPropertyDef& albumTypeProperty = 
+                    aContainer->Def().GetPropertyDefL( KPropertyDefNameAlbumType);
                     TInt albumTypeIndex = aContainer->Property(albumTypeProperty, albumType);
                     if( KErrNotFound != albumTypeIndex )
                         {
-                        TUint16 albumTypeValue = static_cast<CMdEUint16Property*>(albumType)->Value();
+                        TUint16 albumTypeValue = 
+                        static_cast<CMdEUint16Property*>(albumType)->Value();
                         if ( albumTypeValue != MdeConstants::Album::EAlbumUser ) 
                             {
                             request->AppendCpiAttributeL(KMPXMediaGeneralTitle);
-                            aEntry->SetTObjectValueL(KGlxMediaCollectionInternalSystemItemType, albumTypeValue);
+                            aEntry->SetTObjectValueL(KGlxMediaCollectionInternalSystemItemType, 
+                                    albumTypeValue);
                             }
                         }
                     break;
@@ -538,14 +550,16 @@
                     {
                     request->AppendCpiAttributeL(KMPXMediaGeneralTitle);
                     CMdEProperty* time;
-                    CMdEPropertyDef& timeProperty = aContainer->Def().GetPropertyDefL(KPropertyDefNameCreationDate);
+                    CMdEPropertyDef& timeProperty = aContainer->Def().GetPropertyDefL(
+                            KPropertyDefNameCreationDate);
                     TInt timeIndex = aContainer->Property(timeProperty, time);
                     if( KErrNotFound == timeIndex )
                         {
                         User::Leave(KErrCorrupt);
                         }
 
-                    aEntry->SetTObjectValueL(KGlxMediaCollectionInternalStartDate, static_cast<CMdETimeProperty*>(time)->Value());
+                    aEntry->SetTObjectValueL(KGlxMediaCollectionInternalStartDate, 
+                            static_cast<CMdETimeProperty*>(time)->Value());
                     break;
                     }
                 }
@@ -553,21 +567,24 @@
         else if ( request->Attributes()[i] == KMPXMediaGeneralDate )
             {
             CMdEProperty* time;
-            CMdEPropertyDef& timeProperty = aContainer->Def().GetPropertyDefL(KPropertyDefNameCreationDate);
+            CMdEPropertyDef& timeProperty = aContainer->Def().GetPropertyDefL(
+                    KPropertyDefNameCreationDate);
             TInt timeIndex = aContainer->Property(timeProperty, time);
             if( KErrNotFound == timeIndex )
                 {
                 User::Leave(KErrCorrupt);
                 }
 
-            aEntry->SetTObjectValueL(KMPXMediaGeneralDate, static_cast<CMdETimeProperty*>(time)->Value());
+            aEntry->SetTObjectValueL(KMPXMediaGeneralDate, 
+                    static_cast<CMdETimeProperty*>(time)->Value());
             }
         else if ( request->Attributes()[i] == KMPXMediaGeneralSize )
             {
             CMdEProperty* size;
-            CMdEPropertyDef& sizeProperty = aContainer->Def().GetPropertyDefL(KPropertyDefNameSize);
+            CMdEPropertyDef& sizeProperty = aContainer->Def().GetPropertyDefL(
+                    KPropertyDefNameSize);
             TInt sizeIndex = aContainer->Property(sizeProperty, size);
-            TInt sizeValue;
+            TUint sizeValue;
             if(sizeIndex == KErrNotFound)
                 {
                 sizeValue = 0;
@@ -586,7 +603,8 @@
         else if ( request->Attributes()[i] == KMPXMediaGeneralMimeType )
             {
             CMdEProperty* mimeType;
-            CMdEPropertyDef& mimeTypeProperty = aContainer->Def().GetPropertyDefL(KPropertyDefNameItemType);
+            CMdEPropertyDef& mimeTypeProperty = aContainer->Def().GetPropertyDefL(
+                    KPropertyDefNameItemType);
             TInt mimeTypeIndex = aContainer->Property(mimeTypeProperty, mimeType);
             if( KErrNotFound == mimeTypeIndex)
                 {
@@ -594,10 +612,12 @@
                 }
             else
                 {
-                aEntry->SetTextValueL(KMPXMediaGeneralMimeType, static_cast<CMdETextProperty*>(mimeType)->Value());
+                aEntry->SetTextValueL(KMPXMediaGeneralMimeType,
+                        static_cast<CMdETextProperty*>(mimeType)->Value());
                 }
             }
-        else if ( ( request->Attributes()[i] == KMPXMediaGeneralCount ) || ( request->Attributes()[i] == KGlxMediaCollectionInternalUsageCount ) )
+        else if ( ( request->Attributes()[i] == KMPXMediaGeneralCount ) || 
+                ( request->Attributes()[i] == KGlxMediaCollectionInternalUsageCount ) )
             {
             switch (aType)
                 {
@@ -610,10 +630,12 @@
                     }
                 case CGlxDataSource::EContainerTypeMonth:
                     {
-                    iFilterProperties.iOrigin = EGlxFilterOriginCamera;
+                    iFilterProperties.iOrigin = EGlxFilterOriginAll;                    
                     TGlxFilterProperties filterProperties = iFilterProperties;
                     AddMonthFilterL(aContainer, filterProperties);
-                    QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery, EQueryResultModeCount, TGlxMediaId(KGlxCollectionRootId), request->Attributes()[i], aEntry, filterProperties);
+                    QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery,
+                            EQueryResultModeCount, TGlxMediaId(KGlxCollectionRootId),
+                            request->Attributes()[i], aEntry, filterProperties);
                     break;
                     }
                 }
@@ -626,13 +648,16 @@
                 case CGlxDataSource::EContainerTypeAlbum:
                     {
                     CMdEProperty* albumType;
-                    CMdEPropertyDef& albumTypeProperty = aContainer->Def().GetPropertyDefL(KPropertyDefNameAlbumType);
-                    TInt albumTypeIndex = aContainer->Property(albumTypeProperty, albumType);
+                    CMdEPropertyDef& albumTypeProperty = 
+                    aContainer->Def().GetPropertyDefL(   KPropertyDefNameAlbumType);
+                    TInt albumTypeIndex = aContainer->Property(albumTypeProperty,
+                            albumType);
                     if( KErrNotFound != albumTypeIndex )
                         {
-                        TInt albumTypeValue = static_cast<CMdEUint16Property*>(albumType)->Value();
-                        
-                        if( (albumTypeValue == MdeConstants::Album::EAlbumSystemCamera) || (albumTypeValue == MdeConstants::Album::EAlbumSystemFavourite ) )
+                        TInt albumTypeValue = 
+                        static_cast<CMdEUint16Property*>(albumType)->Value();
+                        if( (albumTypeValue == MdeConstants::Album::EAlbumSystemCamera) || 
+                        		(albumTypeValue == MdeConstants::Album::EAlbumSystemFavourite ) )
                             {
                             systemItem = ETrue;
                             }
@@ -663,8 +688,10 @@
 					TGlxFilterProperties filterProperties = iFilterProperties;
 					AddMonthFilterL(aContainer, filterProperties);
 					filterProperties.iItemType = EGlxFilterImage;
-#if 0 	/// @todo AB camera album					
-					QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery, EQueryResultModeCount, DataSource()->CameraAlbumId(), request->Attributes()[i], aEntry, filterProperties);
+#if 0 	/// AB camera album					
+					QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery,
+					        EQueryResultModeCount, DataSource()->CameraAlbumId(), 
+					        request->Attributes()[i], aEntry, filterProperties);
 #endif					
 					break;
 					}			             					
@@ -685,8 +712,10 @@
 					TGlxFilterProperties filterProperties = iFilterProperties;
 					AddMonthFilterL(aContainer, filterProperties);
 					filterProperties.iItemType = EGlxFilterVideo;
-#if 0 	/// @todo AB camera album					
-					QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery, EQueryResultModeCount, DataSource()->CameraAlbumId(), request->Attributes()[i], aEntry, filterProperties);
+#if 0 	/// AB camera album					
+					QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery,
+					        EQueryResultModeCount, DataSource()->CameraAlbumId(),
+					        request->Attributes()[i], aEntry, filterProperties);
 #endif					
 					break;
 					}
@@ -699,7 +728,8 @@
 			
         else if ( request->Attributes()[i] == KMPXMediaColDetailSpaceId )
             {
-            aEntry->SetTObjectValueL(KMPXMediaColDetailSpaceId, KGlxDataSourceMdeImplementationUid);
+            aEntry->SetTObjectValueL(KMPXMediaColDetailSpaceId, 
+                    KGlxDataSourceMdeImplementationUid);
             }
         else if ( request->Attributes()[i] == KGlxMediaCollectionInternalStartDate )
             {
@@ -734,14 +764,18 @@
                 case CGlxDataSource::EContainerTypeAlbum:
                 case CGlxDataSource::EContainerTypeTag:
                     {
-                    QueueObjectQueryL(aContainer->Def(), ETrue, EAttributeQuery, EQueryResultModeCount, TGlxMediaId(aContainer->Id()), request->Attributes()[i], aEntry, filterProperties);
+                    QueueObjectQueryL(aContainer->Def(), ETrue, EAttributeQuery,
+                            EQueryResultModeCount, TGlxMediaId(aContainer->Id()),
+                            request->Attributes()[i], aEntry, filterProperties);
                     break;
                     }
                 case CGlxDataSource::EContainerTypeMonth:
                     {
-                    filterProperties.iOrigin = EGlxFilterOriginCamera;
+                    filterProperties.iOrigin = EGlxFilterOriginAll;               
                     AddMonthFilterL(aContainer, filterProperties);
-                    QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery, EQueryResultModeCount, TGlxMediaId(KGlxCollectionRootId), request->Attributes()[i], aEntry, filterProperties);
+                    QueueObjectQueryL(DataSource()->AlbumDef(), ETrue, EAttributeQuery,
+                            EQueryResultModeCount, TGlxMediaId(KGlxCollectionRootId),
+                            request->Attributes()[i], aEntry, filterProperties);
                     break;
                     }
                 }
@@ -749,13 +783,15 @@
         else if ( request->Attributes()[i] == KGlxMediaGeneralLastModifiedDate )
             {
             CMdEProperty* time;
-            CMdEPropertyDef& timeProperty = aContainer->Def().GetPropertyDefL(KPropertyDefNameLastModifiedDate);
+            CMdEPropertyDef& timeProperty = aContainer->Def().GetPropertyDefL(
+                    KPropertyDefNameLastModifiedDate);
             TInt timeIndex = aContainer->Property(timeProperty, time);
             if( KErrNotFound == timeIndex) 
                 {
                 User::Leave(KErrCorrupt);
                 }
-            aEntry->SetTObjectValueL(KGlxMediaGeneralLastModifiedDate, static_cast<CMdETimeProperty*>(time)->Value());
+            aEntry->SetTObjectValueL(KGlxMediaGeneralLastModifiedDate, 
+                    static_cast<CMdETimeProperty*>(time)->Value());
             }
         else if ( request->Attributes()[i] == KGlxMediaGeneralDimensions )
             {
@@ -778,7 +814,8 @@
 // CGlxDataSourceTaskMdeAttribute::AddItemAttributesL
 // ----------------------------------------------------------------------------
 //
-void CGlxDataSourceTaskMdeAttributeMde::AddItemAttributesL(CMPXMedia* aEntry, CMdEObject* aItem, CGlxDataSource::TItemType aType)
+void CGlxDataSourceTaskMdeAttributeMde::AddItemAttributesL(CMPXMedia* aEntry, 
+        CMdEObject* aItem, CGlxDataSource::TItemType aType)
     {
     TRACER("CGlxDataSourceTaskMdeAttribute::AddItemAttributesL()")
     __ASSERT_DEBUG(aEntry, Panic(EGlxPanicLogicError));
@@ -786,12 +823,13 @@
     __ASSERT_DEBUG(dynamic_cast<CGlxGetRequest*>(iRequest), Panic(EGlxPanicLogicError));
     CGlxGetRequest* request = static_cast<CGlxGetRequest*>(iRequest);
 
-    /// @todo check property defs are valid and type is correct
+    /// check property defs are valid and type is correct
     for ( TInt i = 0; i < request->Attributes().Count(); i++ )
         {   
         if ( request->Attributes()[i] == KMPXMediaGeneralId )
             {
-            aEntry->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, (TMPXItemId)aItem->Id());
+            aEntry->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, 
+                    (TMPXItemId)aItem->Id());
             }
         else if ( request->Attributes()[i] == KMPXMediaGeneralType )
             {
@@ -819,7 +857,8 @@
         else if ( request->Attributes()[i] == KMPXMediaGeneralTitle )
             {
             CMdEProperty* title;
-            CMdEPropertyDef& titleProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameTitle);
+            CMdEPropertyDef& titleProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameTitle);
             TInt titleIndex = aItem->Property(titleProperty, title);
             if( KErrNotFound == titleIndex )
                 {
@@ -828,35 +867,41 @@
                 }
             else
                 {
-                aEntry->SetTextValueL(KMPXMediaGeneralTitle, static_cast<CMdETextProperty*>(title)->Value());
+                aEntry->SetTextValueL(KMPXMediaGeneralTitle, 
+                        static_cast<CMdETextProperty*>(title)->Value());
                 }
             }
         else if ( request->Attributes()[i] == KMPXMediaGeneralDate )
             {
             CMdEProperty* time;
-            CMdEPropertyDef& timeProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameCreationDate);
+            CMdEPropertyDef& timeProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameCreationDate);
             TInt timeIndex = aItem->Property(timeProperty, time);
             if( KErrNotFound == timeIndex) 
                 {
                 User::Leave(KErrCorrupt);
                 }
-            aEntry->SetTObjectValueL(KMPXMediaGeneralDate, static_cast<CMdETimeProperty*>(time)->Value());
+            aEntry->SetTObjectValueL(KMPXMediaGeneralDate,
+                    static_cast<CMdETimeProperty*>(time)->Value());
             }
         else if ( request->Attributes()[i] == KGlxMediaGeneralLastModifiedDate )
             {
             CMdEProperty* time;
-            CMdEPropertyDef& timeProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameLastModifiedDate);
+            CMdEPropertyDef& timeProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameLastModifiedDate);
             TInt timeIndex = aItem->Property(timeProperty, time);
             if( KErrNotFound == timeIndex) 
                 {
                 User::Leave(KErrCorrupt);
                 }
-            aEntry->SetTObjectValueL(KGlxMediaGeneralLastModifiedDate, static_cast<CMdETimeProperty*>(time)->Value());
+            aEntry->SetTObjectValueL(KGlxMediaGeneralLastModifiedDate, 
+                    static_cast<CMdETimeProperty*>(time)->Value());
             }
         else if ( request->Attributes()[i] == KMPXMediaGeneralSize )
             {
             CMdEProperty* size;
-            CMdEPropertyDef& sizeProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameSize);
+            CMdEPropertyDef& sizeProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameSize);
             TInt sizeIndex = aItem->Property(sizeProperty, size);
             User::LeaveIfError(sizeIndex);
             
@@ -870,11 +915,34 @@
         else if ( request->Attributes()[i] == KMPXMediaGeneralMimeType )
             {
             CMdEProperty* mimeType;
-            CMdEPropertyDef& mimeTypeProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameItemType);
+            CMdEPropertyDef& mimeTypeProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameItemType);
             TInt mimeTypeIndex = aItem->Property(mimeTypeProperty, mimeType);
-
-            User::LeaveIfError(mimeTypeIndex); 
-            aEntry->SetTextValueL(KMPXMediaGeneralMimeType, static_cast<CMdETextProperty*>(mimeType)->Value());
+			if(mimeTypeIndex == KErrNotFound)
+				{
+				//MDS retrieves the Mimetype of the file the moment it is notified about 
+				//the new file.But in case of new downloaded video file ,MDS is notified about 
+				//it the moment download starts. As mimetype is available only after the download completes, 
+				//so MDS fails to give the mimetype of the file. But mimetype can also be retrieved 
+				//from CContent class once the download completes.
+				RBuf mimeTypeData;
+				CleanupClosePushL(mimeTypeData);
+				mimeTypeData.CreateL(KMaxFileName);
+				ContentAccess::CContent* content = ContentAccess::CContent::NewLC(aItem->Uri());				  
+				TInt err = content->GetStringAttribute(ContentAccess::EMimeType, mimeTypeData);
+				CleanupStack::PopAndDestroy(content);
+				if(err != KErrNone)
+					{
+					mimeTypeData.Copy(KNullDesC);					
+					}	
+				aEntry->SetTextValueL(KMPXMediaGeneralMimeType,mimeTypeData);
+				CleanupStack::PopAndDestroy(&mimeTypeData);									
+				}
+			else
+				{
+				aEntry->SetTextValueL(KMPXMediaGeneralMimeType, 
+                    static_cast<CMdETextProperty*>(mimeType)->Value());		
+				}				
             }
         else if ( request->Attributes()[i] == KMPXMediaGeneralDuration )
             {
@@ -885,11 +953,18 @@
             else
                 {
                 CMdEProperty* duration;
-                CMdEPropertyDef& durationProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameDuration);
+                CMdEPropertyDef& durationProperty = aItem->Def().GetPropertyDefL(
+                        KPropertyDefNameDuration);
                 TInt durationIndex = aItem->Property(durationProperty, duration);
-                User::LeaveIfError(durationIndex); 
-                
-                aEntry->SetTObjectValueL(KMPXMediaGeneralDuration, static_cast<CMdEReal32Property*>(duration)->Value());
+                if(durationIndex == KErrNotFound)
+	                {	                
+	                aEntry->SetTObjectValueL(KMPXMediaGeneralDuration,0);	                        
+	                }
+                else
+	                {
+	                aEntry->SetTObjectValueL(KMPXMediaGeneralDuration,
+                        static_cast<CMdEReal32Property*>(duration)->Value());	
+	                }                
                 }
             }
         else if ( request->Attributes()[i] == KGlxMediaGeneralSystemItem)
@@ -901,11 +976,12 @@
             TSize dimensions(0,0);
             
             CMdEProperty* xDim;
-            CMdEPropertyDef& xDimProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameWidth);
+            CMdEPropertyDef& xDimProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameWidth);
             TInt xDimIndex = aItem->Property(xDimProperty, xDim);
             if( KErrNotFound == xDimIndex )
                 {
-                //User::Leave(KErrCorrupt);
+                //Do nothing
                 }
             else
                 {
@@ -913,11 +989,12 @@
                 }
             
             CMdEProperty* yDim;
-            CMdEPropertyDef& yDimProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameHeight);
+            CMdEPropertyDef& yDimProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameHeight);
             TInt yDimIndex = aItem->Property(yDimProperty, yDim);
             if( KErrNotFound == yDimIndex )
                 {
-                //User::Leave(KErrCorrupt);
+                //Do nothing
                 }
             else
                 {
@@ -930,7 +1007,9 @@
                     // EXIF header is corrupt, must read size from file.
                     CImageDecoder* decoder = NULL;
 
-                    TRAPD(err, decoder = CImageDecoder::FileNewL( DataSource()->FileServerSession(), aItem->Uri(), CImageDecoder::EOptionNone ));
+                    TRAPD(err, decoder = CImageDecoder::FileNewL( 
+                            DataSource()->FileServerSession(), aItem->Uri(),
+                            CImageDecoder::EOptionNone ));
                     if (err == KErrNone)
                     	{
                     	dimensions = decoder->FrameInfo().iOverallSizeInPixels;
@@ -945,9 +1024,10 @@
             {
             CMdEProperty* framecount;
             TInt fcount = 1;
-            //@todo AB test this
+            // AB test this
             CMdEPropertyDef* framecountProperty = NULL;
-            TRAP_IGNORE(framecountProperty = &aItem->Def().GetPropertyDefL(KPropertyDefNameFrameCount));
+            TRAP_IGNORE(framecountProperty = &aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameFrameCount));
             if( framecountProperty )
                 {
                 TInt framecountIndex = aItem->Property(*framecountProperty, framecount);
@@ -961,7 +1041,8 @@
         else if ( request->Attributes()[i] == KMPXMediaGeneralComment )
             {
             CMdEProperty* comment;
-            CMdEPropertyDef& commentProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameComment); /// @todo using Exif Comment field for comment as spec is not clear
+            CMdEPropertyDef& commentProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameComment); /// using Exif Comment field for comment as spec is not clear
             TInt commentIndex = aItem->Property(commentProperty, comment);
             if( KErrNotFound == commentIndex)
                 {
@@ -969,13 +1050,15 @@
                 }
             else
                 {
-                aEntry->SetTextValueL(KMPXMediaGeneralComment, static_cast<CMdETextProperty*>(comment)->Value());
+                aEntry->SetTextValueL(KMPXMediaGeneralComment, 
+                        static_cast<CMdETextProperty*>(comment)->Value());
                 }
             }
         else if ( request->Attributes()[i] == KMPXMediaDrmProtected )
             {
             CMdEProperty* drmProtected;
-            CMdEPropertyDef& drmProtectedProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameDRM); 
+            CMdEPropertyDef& drmProtectedProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameDRM); 
             TInt drmProtectedIndex = aItem->Property(drmProtectedProperty, drmProtected);
             if( KErrNotFound == drmProtectedIndex)
                 {
@@ -983,27 +1066,32 @@
                 }
             else
                 {
-                aEntry->SetTObjectValueL(KMPXMediaDrmProtected, static_cast<CMdEBoolProperty*>(drmProtected)->Value());
+                aEntry->SetTObjectValueL(KMPXMediaDrmProtected,
+                        static_cast<CMdEBoolProperty*>(drmProtected)->Value());
                 }
             }
 		else if ( request->Attributes()[i] == KGlxMediaGeneralDRMRightsValid )            
 			{
             CMdEProperty* drmProtected;
-            CMdEPropertyDef& drmProtectedProperty = aItem->Def().GetPropertyDefL(KPropertyDefNameDRM); 
+            CMdEPropertyDef& drmProtectedProperty = aItem->Def().GetPropertyDefL(
+                    KPropertyDefNameDRM); 
             TInt drmProtectedIndex = aItem->Property(drmProtectedProperty, drmProtected);
             if( KErrNotFound == drmProtectedIndex)
                 {
-                aEntry->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid, EGlxDrmRightsValidityUnknown); 
+                aEntry->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid,
+                        EGlxDrmRightsValidityUnknown); 
                 }
             else
                 {
                 if( static_cast<CMdEBoolProperty*>(drmProtected)->Value() )
                     {
-                    aEntry->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid, EGlxDrmRightsValidityUnknown); 
+                    aEntry->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid, 
+                            EGlxDrmRightsValidityUnknown); 
                     }
                 else
                     {
-                    aEntry->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid, EGlxDrmRightsValid); 
+                    aEntry->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid,
+                            EGlxDrmRightsValid); 
                     }
                 }
             }
@@ -1013,7 +1101,8 @@
             }
         else if ( request->Attributes()[i] == KMPXMediaColDetailSpaceId )
             {
-            aEntry->SetTObjectValueL(KMPXMediaColDetailSpaceId, KGlxDataSourceMdeImplementationUid);
+            aEntry->SetTObjectValueL(KMPXMediaColDetailSpaceId, 
+                    KGlxDataSourceMdeImplementationUid);
             }
         else if ( request->Attributes()[i] == KGlxMediaGeneralSlideshowableContent )
             {
@@ -1035,25 +1124,30 @@
 // CGlxDataSourceTaskMde::AddLocationAttributeToMediaL
 // ----------------------------------------------------------------------------
 //
-void CGlxDataSourceTaskMdeAttributeMde::AddLocationAttributeToMediaL(CMPXMedia& aMedia, const TItemId& aLocationId)
+void CGlxDataSourceTaskMdeAttributeMde::AddLocationAttributeToMediaL(
+        CMPXMedia& aMedia, const TItemId& aLocationId)
     {
     TRACER("CGlxDataSourceTaskMdeAttribute::AddLocationAttributeToMediaL()")
-    CMdEObject* location = DataSource()->Session().GetObjectL(aLocationId, DataSource()->LocationDef()); 
+    CMdEObject* location = DataSource()->Session().GetObjectL(aLocationId, 
+            DataSource()->LocationDef()); 
     if(!location)
         {
         User::Leave(KErrNotFound);
         }
     CleanupStack::PushL(location);
     CMdEProperty* longitude = NULL;
-    CMdEPropertyDef& longitudePropertyDef = location->Def().GetPropertyDefL(KPropertyDefNameLongitude);
+    CMdEPropertyDef& longitudePropertyDef = location->Def().GetPropertyDefL(
+            KPropertyDefNameLongitude);
     TInt longitudeIndex = location->Property(longitudePropertyDef, longitude);
     CMdEProperty* latitude = NULL;
-    CMdEPropertyDef& latitudePropertyDef = location->Def().GetPropertyDefL(KPropertyDefNameLatitude);
+    CMdEPropertyDef& latitudePropertyDef = location->Def().GetPropertyDefL(
+            KPropertyDefNameLatitude);
     TInt latitudeIndex = location->Property(latitudePropertyDef, latitude);
 
     if (longitudeIndex > KErrNotFound && latitudeIndex > KErrNotFound)
         {
-        TCoordinate coordinate(static_cast< CMdEReal64Property *>(latitude)->Value(),static_cast< CMdEReal64Property *>(longitude)->Value());
+        TCoordinate coordinate(static_cast< CMdEReal64Property *>(latitude)->Value(),
+                static_cast< CMdEReal64Property *>(longitude)->Value());
         aMedia.SetTObjectValueL(KGlxMediaGeneralLocation, coordinate); 
         }
     
@@ -1070,41 +1164,63 @@
     __ASSERT_DEBUG(iQueryAttributes.Count(), Panic(EGlxPanicIllegalState));
     CMdEQuery* query =  iQueries[0];
     
-    if( query->ResultMode() == EQueryResultModeObjectWithFreetexts )
+    if( query->ResultMode() == EQueryResultModeItem )
         {
-        __ASSERT_DEBUG(( iQueryAttributes[0].iAttribute == KGlxMediaCollectionInternalStartDate ), Panic(EGlxPanicIllegalState));
-    	CMdEPropertyDef& creationDateDef = DataSource()->ObjectDef().GetPropertyDefL(KPropertyDefNameCreationDate);
+        __ASSERT_DEBUG(( iQueryAttributes[0].iAttribute == 
+        KGlxMediaCollectionInternalStartDate || iQueryAttributes[0].iAttribute == 
+        KGlxMediaCollectionInternalEndDate), Panic(EGlxPanicIllegalState));
+    	CMdEPropertyDef& creationDateDef = DataSource()->ObjectDef().GetPropertyDefL(
+    	        KPropertyDefNameCreationDate);
         if (creationDateDef.PropertyType() != EPropertyTime)
         	{
         	User::Leave(KErrCorrupt);
         	}
         TTime startMonth(0);	
         TTime endMonth(0);	
+        GLX_DEBUG2("CGlxDataSourceTaskMdeAttributeMde::DoHandleAttributeQueryCompletedL iQueries[0]->Count()=%d", iQueries[0]->Count());    
+        TInt timeIndex(0) ;
         if(iQueries[0]->Count() )
             {
-            CMdEProperty* startTime;
-            CMdEObject& startObject = (CMdEObject&)query->ResultItem(0);
-            TInt timeIndex = startObject.Property(creationDateDef, startTime);
-            if( KErrNotFound == timeIndex )
-                {
-                User::Leave(KErrCorrupt);
-                }
-            startMonth = static_cast<CMdETimeProperty*>(startTime)->Value();
-            CMdEProperty* endTime;
-            CMdEObject& endObject = (CMdEObject&)query->ResultItem(query->Count()-1);
-            timeIndex = endObject.Property(creationDateDef, endTime);
-            if( KErrNotFound == timeIndex )
-                {
-                User::Leave(KErrCorrupt);
-                }
-            endMonth = static_cast<CMdETimeProperty*>(endTime)->Value();
+            GLX_DEBUG2("CGlxDataSourceTaskMdeAttributeMde::DoHandleAttributeQueryCompletedL query->Count()=%d", query->Count());    
+            if(iQueryAttributes[0].iAttribute == KGlxMediaCollectionInternalStartDate)
+            	{
+                CMdEProperty* startTime;
+                CMdEObject& startObject = (CMdEObject&)query->ResultItem(0);
+                TInt timeIndex = startObject.Property(creationDateDef, startTime);
+                if( KErrNotFound == timeIndex )
+                    {
+                    User::Leave(KErrCorrupt);
+                    }
+                startMonth = static_cast<CMdETimeProperty*>(startTime)->Value();
+                iQueryAttributes[0].iMedia->SetTObjectValueL(
+                        KGlxMediaCollectionInternalStartDate, startMonth);
+            	}
+            else if(iQueryAttributes[0].iAttribute == KGlxMediaCollectionInternalEndDate)
+            	{
+                CMdEProperty* endTime;
+                CMdEObject& endObject = (CMdEObject&)query->ResultItem(0);
+                timeIndex = endObject.Property(creationDateDef, endTime);
+                if( KErrNotFound == timeIndex )
+                    {
+                    User::Leave(KErrCorrupt);
+                    }
+                endMonth = static_cast<CMdETimeProperty*>(endTime)->Value();
+                iQueryAttributes[0].iMedia->SetTObjectValueL(
+                        KGlxMediaCollectionInternalEndDate, endMonth);
+            	}
             }
-        iQueryAttributes[0].iMedia->SetTObjectValueL(KGlxMediaCollectionInternalStartDate, startMonth);
-        iQueryAttributes[0].iMedia->SetTObjectValueL(KGlxMediaCollectionInternalEndDate, endMonth);
+        else
+            {
+            iQueryAttributes[0].iMedia->SetTObjectValueL(
+                    KGlxMediaCollectionInternalStartDate, startMonth);
+            iQueryAttributes[0].iMedia->SetTObjectValueL(
+                    KGlxMediaCollectionInternalEndDate, endMonth);
+            }
         }
     else if( EQueryResultModeCount == query->ResultMode() )
         {
-        iQueryAttributes[0].iMedia->SetTObjectValueL(iQueryAttributes[0].iAttribute, query->Count());
+        iQueryAttributes[0].iMedia->SetTObjectValueL(
+                iQueryAttributes[0].iAttribute, query->Count());
         }
     else
         {
@@ -1124,7 +1240,8 @@
     
     for (TInt queryResultsPos = 0; queryResultsPos < queryResultsCount; queryResultsPos++)
         {
-        CMdERelation& relation = static_cast<CMdERelation&>(iQueries[0]->ResultItem(queryResultsPos));
+        CMdERelation& relation = static_cast<CMdERelation&>(
+                iQueries[0]->ResultItem(queryResultsPos));
         CMPXMedia* targetMedia = NULL;
         if (iMediaArray)
             {
@@ -1165,14 +1282,9 @@
 	CMdEQuery* query = iQueries[0];
 	
     TInt queryResultsCount = query->Count();
-   	GLX_LOG_INFO1("==> CGlxDataSourceTaskMdeAttributeMde::DoHandleImageVideoQueryCompletedL - queryResultsCount=%d", queryResultsCount);
-#ifdef _DEBUG
-    iStopTime.HomeTime(); // Get home time
-   	if (queryResultsCount)
-   		{
-   		GLX_LOG_INFO1("==> CGlxDataSourceTaskMdeAttributeMde::DoHandleImageVideoQueryCompletedL took <%d> us", (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64());
-   		}
-#endif
+    GLX_DEBUG2("CGlxDataSourceTaskMdeAttributeMde::DoHandleImageVideoQueryCompletedL()"
+            " queryResultsCount=%d", queryResultsCount);
+    
     if( ( queryResultsCount == 1 ) && ( !iMediaArray ) )
         {
         CMdEObject& object = static_cast<CMdEObject&>(query->ResultItem(0));
@@ -1188,10 +1300,11 @@
         for (TInt i = 0; i < queryResultsCount; i++)
             {
             CMdEObject& object = static_cast<CMdEObject&>(query->ResultItem(i));
+            
             CMPXMedia* entry = CMPXMedia::NewL();
             CleanupStack::PushL(entry);
-            iMediaArray->AppendL(*entry);
-            CleanupStack::PopAndDestroy(entry);
+            iMediaArray->AppendL(entry);
+            CleanupStack::Pop(entry);
             AddAttributesL(object, (*iMediaArray)[iMediaArray->Count() - 1]);
             }
         }    
@@ -1207,11 +1320,14 @@
     __ASSERT_DEBUG(dynamic_cast<CGlxGetRequest*>(iRequest), Panic(EGlxPanicLogicError));
     CGlxGetRequest* request = static_cast<CGlxGetRequest*>(iRequest);
         
-    CMdEQuery* query = DataSource()->Session().NewRelationQueryL(*DataSource()->NamespaceDef(), this); 
+    CMdEQuery* query = DataSource()->Session().NewRelationQueryL(
+            *DataSource()->NamespaceDef(), this); 
     CleanupStack::PushL(query);
     
     CMdELogicCondition& rootCondition = query->Conditions();
-    CMdERelationCondition& containerRelationCondition = rootCondition.AddRelationConditionL(DataSource()->ContainsLocationDef(), ERelationConditionSideRight);
+    CMdERelationCondition& containerRelationCondition = 
+    rootCondition.AddRelationConditionL(DataSource()->ContainsLocationDef(),
+            ERelationConditionSideRight);
     CMdELogicCondition& itemLogicCondition  = containerRelationCondition.LeftL();
     CMdELogicCondition&  locationLogicCondition = containerRelationCondition.RightL();
     locationLogicCondition.AddObjectConditionL(DataSource()->LocationDef());
@@ -1290,8 +1406,10 @@
 // CGlxDataSourceTask::QueueObjectQueryL
 // ----------------------------------------------------------------------------
 //  
-void CGlxDataSourceTaskMdeAttributeMde::QueueObjectQueryL(CMdEObjectDef& aObjectDef, TBool aIsContent, TGlxQueryType aQueryType, 
-        TQueryResultMode aResultMode, const TGlxMediaId& aContainerId, TMPXAttribute aAttribute, CMPXMedia* aEntry, 
+void CGlxDataSourceTaskMdeAttributeMde::QueueObjectQueryL(CMdEObjectDef& aObjectDef,
+        TBool aIsContent, TGlxQueryType aQueryType, 
+        TQueryResultMode aResultMode, const TGlxMediaId& aContainerId, 
+        TMPXAttribute aAttribute, CMPXMedia* aEntry, 
         const TGlxFilterProperties& aFilterProperties)
     {
     TRACER("CGlxDataSourceTaskMdeAttribute::QueueObjectQueryL()")   
@@ -1318,10 +1436,11 @@
             }
         }
 
-    CMdEQuery* query = DataSource()->Session().NewObjectQueryL(*DataSource()->NamespaceDef(), *queryBaseObject, this);
+    CMdEQuery* query = DataSource()->Session().NewObjectQueryL(*DataSource()->NamespaceDef(), 
+            *queryBaseObject, this);
     CleanupStack::PushL(query);
+    query->SetResultMode(aResultMode);
     SetQueryConditionsL(*query, aFilterProperties, aContainerId, aObjectDef);
-    query->SetResultMode(aResultMode);
   
     iQueryAttributes.AppendL(TGlxQueryAttribute(aAttribute, aEntry, aFilterProperties));
 
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdscommand.cpp	Fri May 28 21:11:54 2010 +0530
@@ -90,18 +90,28 @@
 _LIT(KColonBackslash, ":\\");
 _LIT(KFileNameFormatString, "(%+02u)");
 
+// Items to be deleted from File server at a time before calling scheduler wait
+const TInt KDeletedItemCount = 10;
+const TInt KDeleteOperationInterval = 1000;
+
 // ----------------------------------------------------------------------------
 // Destructor
 // ----------------------------------------------------------------------------
 //
 CGlxDataSourceTaskMdeCommand::~CGlxDataSourceTaskMdeCommand()
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::~CGlxDataSourceTaskMdeCommand()")
+    TRACER("CGlxDataSourceTaskMdeCommand::~CGlxDataSourceTaskMdeCommand()");
 	iLeftIds.Close();
     iRightIds.Close();
     delete iTitle;
     delete iObjectToRename;
     delete iStringCache;
+    if(iTimer && iTimer->IsActive())
+		{
+		iTimer->Cancel();
+		}
+	delete iTimer;
+    delete iSchedulerWait;    
     }
 
 
@@ -114,7 +124,7 @@
        CGlxDataSource* aDataSource)
     : CGlxDataSourceTaskMde(aRequest, aObserver, aDataSource) 
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::CGlxDataSourceTaskMdeCommand()")
+    TRACER("CGlxDataSourceTaskMdeCommand::CGlxDataSourceTaskMdeCommand()");
 	// No implementation required
 	}
 
@@ -124,13 +134,16 @@
 //
 void CGlxDataSourceTaskMdeCommand::ConstructL()
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::ConstructL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::ConstructL()");
 	iResponse = CMPXCommand::NewL(static_cast<CGlxCommandRequest*>(iRequest)->Command());
 #ifdef USE_S60_TNM
     DataSource()->CancelFetchThumbnail();
 #else    
     DataSource()->ThumbnailCreator().CancelRequest( TGlxMediaId(0) );
-#endif
+#endif    
+    
+    iTimer = CPeriodic::NewL(CActive::EPriorityStandard);
+    iSchedulerWait = new (ELeave) CActiveSchedulerWait();
 	}
 
 /// @todo minor: Rowland Cook 12/06/2007 Add method decription.
@@ -140,7 +153,7 @@
 //
 void CGlxDataSourceTaskMdeCommand::ExecuteRequestL()
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::ExecuteRequestL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::ExecuteRequestL()");
     __ASSERT_DEBUG(DataSource()->NamespaceDef(), Panic(EGlxPanicIllegalState));
     
 	const CMPXCommand& command = static_cast<CGlxCommandRequest*>(iRequest)->Command();
@@ -164,7 +177,7 @@
 //
 void CGlxDataSourceTaskMdeCommand::AddContainerL(const TDesC& aContainerName)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::AddContainerL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::AddContainerL()");
 	iTitle = aContainerName.AllocL();
 	AppendContainerTitleCountQueryL(ECommandAddContainer, aContainerName);
     ExecuteQueryL();
@@ -174,19 +187,24 @@
 // Add items to container by id
 // ----------------------------------------------------------------------------
 //
-void CGlxDataSourceTaskMdeCommand::AddToContainerL(const RArray<TGlxMediaId>& aSourceIds, const RArray<TGlxMediaId>& aTargetContainers)
+void CGlxDataSourceTaskMdeCommand::AddToContainerL(const RArray<TGlxMediaId>& aSourceIds,
+        const RArray<TGlxMediaId>& aTargetContainers)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::AddToContainerL(const RArray<TGlxMediaId>& aSourceIds, const RArray<TGlxMediaId>& aTargetContainers)")	
-	__ASSERT_DEBUG(aSourceIds.Count() && aTargetContainers.Count(), Panic(EGlxPanicEmptyArray));
+    TRACER("CGlxDataSourceTaskMdeCommand::AddToContainerL(const RArray<TGlxMediaId>& aSourceIds,const RArray<TGlxMediaId>& aTargetContainers)");	
+	__ASSERT_DEBUG(aSourceIds.Count() && aTargetContainers.Count(), 
+	        Panic(EGlxPanicEmptyArray));
 	
     iLeftIds.Reset();
     iRightIds.Reset();
 
-	CMdEQuery* query = DataSource()->Session().NewRelationQueryL(*DataSource()->NamespaceDef(), this); 
+	CMdEQuery* query = DataSource()->Session().NewRelationQueryL(
+	        *DataSource()->NamespaceDef(), this); 
 	AppendQueryL(query, ECommandAddToContainer);
     
     CMdELogicCondition& rootCondition = query->Conditions();
-    CMdERelationCondition& containerRelationCondition = rootCondition.AddRelationConditionL(DataSource()->ContainsDef(), ERelationConditionSideLeft);
+    CMdERelationCondition& containerRelationCondition = 
+    rootCondition.AddRelationConditionL(DataSource()->ContainsDef(),
+            ERelationConditionSideLeft);
     CMdELogicCondition& leftLogicCondition = containerRelationCondition.LeftL();
     CMdELogicCondition& rightLogicCondition = containerRelationCondition.RightL();
     leftLogicCondition.SetOperator(ELogicConditionOperatorOr);
@@ -236,7 +254,7 @@
 void CGlxDataSourceTaskMdeCommand::AddToContainerL(const TDesC& aSourceUri, 
 		                        const RArray< TGlxMediaId >& aTargetContainers)
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::AddToContainerL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::AddToContainerL()");
     CMdEObject* sourceObject = DataSource()->Session().GetObjectL(aSourceUri);
     if (!sourceObject)
         {
@@ -254,10 +272,10 @@
 // Copy files to another drive.
 // ----------------------------------------------------------------------------
 //
-/// @todo minor: Rowland Cook 12/06/2007 Has this method been tested? If so remove comments
-void CGlxDataSourceTaskMdeCommand::CopyL(const RArray<TGlxMediaId>& aSourceIds, const TDesC& aDrive)
+void CGlxDataSourceTaskMdeCommand::CopyL(const RArray<TGlxMediaId>& aSourceIds, 
+        const TDesC& aDrive)
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::CopyL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::CopyL()");
     FileOperationL(aSourceIds.Array(), aDrive, ECopy);
     }
 
@@ -265,10 +283,10 @@
 // Move files to another drive.
 // ----------------------------------------------------------------------------
 //
-/// @todo minor: Rowland Cook 12/06/2007 Has this method been tested? If so remove comments
-void CGlxDataSourceTaskMdeCommand::MoveL(const RArray<TGlxMediaId>& aSourceIds, const TDesC& aDrive)
+void CGlxDataSourceTaskMdeCommand::MoveL(const RArray<TGlxMediaId>& aSourceIds, 
+        const TDesC& aDrive)
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::MoveL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::MoveL()");
     FileOperationL(aSourceIds.Array(), aDrive, EMove);
     }
 
@@ -276,9 +294,10 @@
 // Remove items from a container.
 // ----------------------------------------------------------------------------
 //
-void CGlxDataSourceTaskMdeCommand::RemoveFromContainerL(const RArray<TGlxMediaId>& aItemIds, const TGlxMediaId& aContainerId)
+void CGlxDataSourceTaskMdeCommand::RemoveFromContainerL(
+        const RArray<TGlxMediaId>& aItemIds, const TGlxMediaId& aContainerId)
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::RemoveFromContainerL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::RemoveFromContainerL()");
     // Answer to question in @bug above: No
     
 	CMdEObject* object = NULL;
@@ -289,12 +308,15 @@
     	User::Leave(KErrNotFound);
     	}
 	
-	CMdEQuery* query = DataSource()->Session().NewRelationQueryL(*DataSource()->NamespaceDef(), this); 
+	CMdEQuery* query = DataSource()->Session().NewRelationQueryL(
+	        *DataSource()->NamespaceDef(), this); 
 	AppendQueryL(query, ECommandRemoveFromContainer); // query is now owned by the query array.
     
     CMdELogicCondition& rootCondition = query->Conditions();
 
-    CMdERelationCondition& containerRelationCondition = rootCondition.AddRelationConditionL(DataSource()->ContainsDef(), ERelationConditionSideLeft);
+    CMdERelationCondition& containerRelationCondition = 
+    rootCondition.AddRelationConditionL(
+            DataSource()->ContainsDef(), ERelationConditionSideLeft);
     CMdELogicCondition* containerLogicCondition = NULL;
     CMdELogicCondition* itemLogicCondition = NULL;
     // Containers are on the left for albums, right for tags
@@ -326,7 +348,7 @@
 //
 void CGlxDataSourceTaskMdeCommand::DeleteL(const RArray<TGlxMediaId>& aItemIds)
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::DeleteL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::DeleteL()");
     CMdEObjectDef* containerObjectDef = NULL;
     TInt err = ContainerObjectDef(containerObjectDef);
     if (err == KErrNone)
@@ -348,10 +370,10 @@
 //
 // ----------------------------------------------------------------------------
 //
-/// @todo minor: Rowland Cook 12/06/2007 Has this method been tested? If so remove comments
-void CGlxDataSourceTaskMdeCommand::RenameL(const TGlxMediaId& aSourceItemId, const TDesC& aTitle)
+void CGlxDataSourceTaskMdeCommand::RenameL(const TGlxMediaId& aSourceItemId, 
+        const TDesC& aTitle)
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::RenameL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::RenameL()");
     delete iTitle;
     iTitle = NULL;
 	iTitle = aTitle.AllocL();
@@ -370,10 +392,12 @@
 // Set description.
 // ----------------------------------------------------------------------------
 //
-void CGlxDataSourceTaskMdeCommand::SetDescriptionL(const RArray<TGlxMediaId>& aItemIds, const TDesC& aDescription)
+void CGlxDataSourceTaskMdeCommand::SetDescriptionL(const RArray<TGlxMediaId>& aItemIds, 
+        const TDesC& aDescription)
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::SetDescriptionL()")
-    CMdEPropertyDef& descriptionPropertyDef = DataSource()->MediaDef().GetPropertyDefL(KPropertyDefNameDescription);
+    TRACER("CGlxDataSourceTaskMdeCommand::SetDescriptionL()");
+    CMdEPropertyDef& descriptionPropertyDef = DataSource()->MediaDef().GetPropertyDefL(
+            KPropertyDefNameDescription);
     if (descriptionPropertyDef.PropertyType() != EPropertyText)
     	{
     	User::Leave(KErrCorrupt);
@@ -430,9 +454,10 @@
 // Set capture location.
 // ----------------------------------------------------------------------------
 //
-void CGlxDataSourceTaskMdeCommand::SetCaptureLocationL(const RArray<TGlxMediaId>& aItemIds, const TCoordinate& aCoordinate)
+void CGlxDataSourceTaskMdeCommand::SetCaptureLocationL(const RArray<TGlxMediaId>& aItemIds, 
+        const TCoordinate& aCoordinate)
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::SetCaptureLocationL()")    
+    TRACER("CGlxDataSourceTaskMdeCommand::SetCaptureLocationL()") ;   
     if (!Math::IsNaN(aCoordinate.Latitude()) || !Math::IsNaN(aCoordinate.Longitude()))
     	{
     	User::Leave(KErrArgument);
@@ -443,7 +468,8 @@
     
     CMdELogicCondition& rootCondition = query->Conditions();
 
-    CMdERelationCondition& containerRelationCondition = rootCondition.AddRelationConditionL(ERelationConditionSideLeft);
+    CMdERelationCondition& containerRelationCondition = rootCondition.AddRelationConditionL(
+            ERelationConditionSideLeft);
     CMdELogicCondition& locationLogicCondition = containerRelationCondition.RightL();
     CMdELogicCondition& itemLogicCondition = containerRelationCondition.LeftL();
     locationLogicCondition.AddObjectConditionL(DataSource()->LocationDef());
@@ -463,7 +489,7 @@
 //
 void CGlxDataSourceTaskMdeCommand::ThumbnailCleanupL()
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::ThumbnailCleanupL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::ThumbnailCleanupL()");
 #ifndef USE_S60_TNM
     CGlxDataSourceMde* ds = DataSource();
     ds->ThumbnailCreator().CleanupThumbnailsL(&ds->ThumbnailDatabase());
@@ -477,7 +503,7 @@
 //
 void CGlxDataSourceTaskMdeCommand::DoHandleQueryCompletedL(CMdEQuery& aQuery)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleQueryCompletedL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleQueryCompletedL()");
     TGlxQueryType queryType = iQueryTypes[0];
 	
     switch (queryType)
@@ -502,7 +528,8 @@
 			
 			if (queryCount)
 				{
-				User::LeaveIfError(DataSource()->Session().RemoveRelationsL(relationsToRemove, successfullyRemovedReleations));
+				User::LeaveIfError(DataSource()->Session().RemoveRelationsL(
+				        relationsToRemove, successfullyRemovedReleations));
 				}
 			
 			CleanupStack::PopAndDestroy(&successfullyRemovedReleations);
@@ -547,7 +574,7 @@
 //
 void CGlxDataSourceTaskMdeCommand::DoNextQueryL()
     {
-    TRACER("CGlxDataSourceTaskMdeCommand::DoNextQueryL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::DoNextQueryL()");
     if (iQueries.Count())
         {
         ExecuteQueryL();
@@ -562,9 +589,10 @@
 // CGlxDataSourceTaskMdeCommand::FileOperationL
 // ----------------------------------------------------------------------------
 //
-void CGlxDataSourceTaskMdeCommand::FileOperationL(const TArray<TGlxMediaId>& aSourceIds, const TDesC& aDrive, TFileOperation aFileOperation)
+void CGlxDataSourceTaskMdeCommand::FileOperationL(const TArray<TGlxMediaId>& aSourceIds, 
+        const TDesC& aDrive, TFileOperation aFileOperation)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::FileOperationL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::FileOperationL()");
 	ContentAccess::CManager *manager = ContentAccess::CManager::NewL();
 	CleanupStack::PushL(manager);
 	// The following line causes a code scanner warning advising use of EikonEnv RFs instance.
@@ -593,7 +621,8 @@
     		// the drive that it is located on. (For the C:, the root is C:\data, 
     		// for the D: the root is D:\)
     		{
-    		fileNameWithoutRoot.Set(sourceFileName.Right(sourceFileName.Length() - sourceRootPath.Length()));
+    		fileNameWithoutRoot.Set(sourceFileName.Right(sourceFileName.Length() - 
+    		        sourceRootPath.Length()));
     		}
     	else
     		{
@@ -606,7 +635,6 @@
     	// Append the file name
     	destinationFileName.Append(fileNameWithoutRoot);
     	
-/// @todo minor: Rowland Cook 12/06/2007 majic number.
     	if (destinationFileName.CompareF(sourceFileName) != 0)
     		{
     		// If source and destination are not identical, perform the copy.	
@@ -615,7 +643,8 @@
 				// If the destination file name already exists find an available file name.
 				TParse destinationFileNameParse;
 				destinationFileNameParse.Set(destinationFileName,NULL,NULL); // this is a copy of the data
-				TInt destinationFileNameWithoutExtensionLength = destinationFileName.Length() - destinationFileNameParse.Ext().Length();
+				TInt destinationFileNameWithoutExtensionLength = destinationFileName.Length()
+				- destinationFileNameParse.Ext().Length();
 				TInt i = 1;
 				do
 					{
@@ -658,16 +687,7 @@
 TItemId CGlxDataSourceTaskMdeCommand::ContainerItemId(const TGlxMediaId& aMediaId)
     {
     TRACER("TMdEItemId CGlxDataSourceTaskMdeCommand::ContainerItemId()");    
-    TItemId containerId = aMediaId.Value();
-    if (aMediaId == KGlxCollectionRootId)
-        {
-        // Check the collection plugin uid
-        if (iCollectionUid == TUid::Uid(KGlxCollectionPluginCameraImplementationUid))
-            {
-          //  containerId = DataSource()->CameraAlbumId().Value();
-            }  
-        }
-    return containerId;
+    return aMediaId.Value();
     }
 
 // ----------------------------------------------------------------------------
@@ -676,16 +696,19 @@
 //
 void CGlxDataSourceTaskMdeCommand::RootPath(const TDesC& aDrive, TDes& aRootPath)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::RootPath()")
-	if (aDrive.Left(KDriveLetterLength).CompareF(PathInfo::PhoneMemoryRootPath().Left(KDriveLetterLength)) == 0)
+    TRACER("CGlxDataSourceTaskMdeCommand::RootPath()");
+	if (aDrive.Left(KDriveLetterLength).CompareF(PathInfo::PhoneMemoryRootPath().Left(
+	        KDriveLetterLength)) == 0)
 		{
 		aRootPath = PathInfo::PhoneMemoryRootPath();
 		}
-	else if (aDrive.Left(KDriveLetterLength).CompareF(PathInfo::MemoryCardRootPath().Left(KDriveLetterLength)) == 0)
+	else if (aDrive.Left(KDriveLetterLength).CompareF(PathInfo::MemoryCardRootPath().Left(
+	        KDriveLetterLength)) == 0)
 		{
 		aRootPath = PathInfo::MemoryCardRootPath();
 		}
-	else if (aDrive.Left(KDriveLetterLength).CompareF(PathInfo::RomRootPath().Left(KDriveLetterLength)) == 0)
+	else if (aDrive.Left(KDriveLetterLength).CompareF(PathInfo::RomRootPath().Left(
+	        KDriveLetterLength)) == 0)
 		{
 		aRootPath = PathInfo::RomRootPath();
 		}
@@ -702,19 +725,23 @@
 //
 void CGlxDataSourceTaskMdeCommand::SendProgressMessageL(TInt aCurrentStep, TInt aStepCount)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::SendProgressMessageL()")
-	MGlxDataSourceUpdateObserver& observer = static_cast<CGlxCommandRequest*>(iRequest)->DataSourceUpdateObserver();
+    TRACER("CGlxDataSourceTaskMdeCommand::SendProgressMessageL()");
+	MGlxDataSourceUpdateObserver& observer = 
+	static_cast<CGlxCommandRequest*>(iRequest)->DataSourceUpdateObserver();
 	
 	const CMPXCommand& command = static_cast<CGlxCommandRequest*>(iRequest)->Command();
-	__ASSERT_DEBUG(command.IsSupported(KMPXCommandGeneralSessionId), Panic(EGlxPanicCommandHasNoGeneralSessionId));
+	__ASSERT_DEBUG(command.IsSupported(KMPXCommandGeneralSessionId), Panic(
+	        EGlxPanicCommandHasNoGeneralSessionId));
 	
 	TAny* sessionId = command.ValueTObjectL<TAny*>(KMPXCommandGeneralSessionId);
 	
 	CMPXMessage* progressMessage = CMPXMessage::NewL();
 	CleanupStack::PushL(progressMessage);
 	progressMessage->SetTObjectValueL<TInt>(KMPXMessageGeneralId, KMPXMessageContentIdProgress);	
-	progressMessage->SetTObjectValueL<TInt>(TMPXAttribute(KMPXMessageContentIdProgress, EMPXMessageProgressCurrentCount), aCurrentStep);
-	progressMessage->SetTObjectValueL<TInt>(TMPXAttribute(KMPXMessageContentIdProgress, EMPXMessageProgressTotalCount), aStepCount);
+	progressMessage->SetTObjectValueL<TInt>(TMPXAttribute(KMPXMessageContentIdProgress, 
+	        EMPXMessageProgressCurrentCount), aCurrentStep);
+	progressMessage->SetTObjectValueL<TInt>(TMPXAttribute(KMPXMessageContentIdProgress,
+	        EMPXMessageProgressTotalCount), aStepCount);
 	progressMessage->SetTObjectValueL<TAny*>(KMPXCommandGeneralSessionId, sessionId);
 	
 	observer.HandleMessage(*progressMessage);
@@ -728,8 +755,7 @@
 //
 TInt CGlxDataSourceTaskMdeCommand::ContainerObjectDef(CMdEObjectDef*& aContainerObjectDef)
 {
-    TRACER("CGlxDataSourceTaskMdeCommand::ContainerObjectDef()")
-    //__ASSERT_DEBUG( (iCollectionUid == TUid::Uid(KGlxTagCollectionPluginImplementationUid) || iCollectionUid == TUid::Uid(KGlxCollectionPluginAlbumsImplementationUid)), Panic(EGlxPanicInvalidCollectionUid));
+    TRACER("CGlxDataSourceTaskMdeCommand::ContainerObjectDef()");
     TInt err = KErrNone;
 	if (iCollectionUid == TUid::Uid(KGlxTagCollectionPluginImplementationUid))
         {
@@ -757,7 +783,7 @@
 void CGlxDataSourceTaskMdeCommand::DoHandleAddToContainerQueryCompletedL
 															(CMdEQuery& aQuery)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleAddToContainerQueryCompletedL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleAddToContainerQueryCompletedL()");
 	RPointerArray<CMdEInstanceItem> relations;
 	CleanupClosePushL(relations);
 	 
@@ -783,7 +809,8 @@
             
             if (!alreadyExists)
                 {
-                CMdERelation* relation = DataSource()->Session().NewRelationL(DataSource()->ContainsDef(), iLeftIds[leftPos], iRightIds[rightPos]);
+                CMdERelation* relation = DataSource()->Session().NewRelationL(
+                        DataSource()->ContainsDef(), iLeftIds[leftPos], iRightIds[rightPos]);
                 CleanupStack::PushL(relation);
                 relations.AppendL(relation);
                 CleanupStack::Pop(relation);
@@ -811,13 +838,14 @@
 															(CMdEQuery& aQuery)
 
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleAddContainerQueryCompletedL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleAddContainerQueryCompletedL()");
    	
    	//Duplicate albums check for the default albums i.e. Favourites 
    	//as title property is left blank in MDS 2.5
    	if(iCollectionUid == TUid::Uid(KGlxCollectionPluginAlbumsImplementationUid))
    		{
-   		if(SearchStringL(R_ALBUM_FAVORITES_TITLE) == 0)
+   		if(SearchStringL(R_ALBUM_FAVORITES_TITLE) == 0 || 
+   				SearchStringL(R_ALBUM_CAMERA_TITLE) == 0 )
     		{
     		User::Leave(KErrAlreadyExists);	
     		}        	
@@ -837,7 +865,8 @@
     object = DataSource()->Session().NewObjectLC(*containerObjectDef, KNullDesC);
     
     // A title property def of type text is required.
-    CMdEPropertyDef& titlePropertyDef = containerObjectDef->GetPropertyDefL(KPropertyDefNameTitle);
+    CMdEPropertyDef& titlePropertyDef = containerObjectDef->GetPropertyDefL(
+            KPropertyDefNameTitle);
     if (titlePropertyDef.PropertyType() != EPropertyText)
         {
         User::Leave(KErrCorrupt);
@@ -846,7 +875,8 @@
     object->AddTextPropertyL(titlePropertyDef, *iTitle);
     
       //ItemType property def of type text is required.
-    CMdEPropertyDef& itemTypePropertyDef = containerObjectDef->GetPropertyDefL(KPropertyDefItemType);
+    CMdEPropertyDef& itemTypePropertyDef = containerObjectDef->GetPropertyDefL(
+            KPropertyDefItemType);
     if (itemTypePropertyDef.PropertyType() != EPropertyText)
     	{
     	User::Leave(KErrCorrupt);
@@ -865,7 +895,8 @@
    
     // A size property is required.
   
-    CMdEPropertyDef& sizePropertyDef = containerObjectDef->GetPropertyDefL(KPropertyDefNameSize);
+    CMdEPropertyDef& sizePropertyDef = containerObjectDef->GetPropertyDefL(
+            KPropertyDefNameSize);
     if (sizePropertyDef.PropertyType() != EPropertyUint32)
         {
         User::Leave(KErrCorrupt);
@@ -874,14 +905,16 @@
 
     
     // A creation date property is required.
-    CMdEPropertyDef& creationDateDef = containerObjectDef->GetPropertyDefL(KPropertyDefNameCreationDate);
+    CMdEPropertyDef& creationDateDef = containerObjectDef->GetPropertyDefL(
+            KPropertyDefNameCreationDate);
     if (creationDateDef.PropertyType() != EPropertyTime)
         {
         User::Leave(KErrCorrupt);
         }
 
     // A last modified date property is required.
-    CMdEPropertyDef& lmDateDef = containerObjectDef->GetPropertyDefL(KPropertyDefNameLastModifiedDate);
+    CMdEPropertyDef& lmDateDef = containerObjectDef->GetPropertyDefL(
+            KPropertyDefNameLastModifiedDate);
     if (lmDateDef.PropertyType() != EPropertyTime)
         {
         User::Leave(KErrCorrupt);
@@ -897,7 +930,8 @@
     
     iResponse->SetTObjectValueL<TMPXItemId>(KMPXMediaGeneralId, id);
     iResponse->SetTObjectValueL<TMPXItemId>(KMPXMessageMediaGeneralId, id);  
-    iResponse->SetTObjectValueL<TMPXChangeEventType>(KMPXMessageChangeEventType, EMPXItemInserted); 
+    iResponse->SetTObjectValueL<TMPXChangeEventType>(KMPXMessageChangeEventType,
+            EMPXItemInserted); 
 	}
 // ----------------------------------------------------------------------------
 // CGlxDataSourceTaskMdeCommand::DoHandleDeleteContainersQueryCompletedL
@@ -906,8 +940,9 @@
 void CGlxDataSourceTaskMdeCommand::DoHandleDeleteContainersQueryCompletedL
 															(CMdEQuery& aQuery)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleDeleteContainersQueryCompletedL()")
-    CMdEPropertyDef& albumTypeProperty = DataSource()->AlbumDef().GetPropertyDefL(KPropertyDefNameAlbumType);
+    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleDeleteContainersQueryCompletedL()");
+    CMdEPropertyDef& albumTypeProperty = DataSource()->AlbumDef().GetPropertyDefL(
+            KPropertyDefNameAlbumType);
     TInt queryCount = aQuery.Count();
     
     RArray<TItemId> objectsForRemoval;
@@ -928,8 +963,8 @@
         if (KErrNotFound != albumTypeIndex)
             {
             TInt albumTypeValue = static_cast<CMdEUint16Property*>(albumType)->Value();
-            
-            if ((albumTypeValue == MdeConstants::Album::EAlbumSystemFavourite) || (albumTypeValue == MdeConstants::Album::EAlbumSystemCamera))
+            if ((albumTypeValue == MdeConstants::Album::EAlbumSystemFavourite) || 
+            		(albumTypeValue == MdeConstants::Album::EAlbumSystemCamera))
                {
                User::Leave(KErrAccessDenied); 
                }
@@ -939,7 +974,8 @@
     
     if (queryCount)
     	{
-    	User::LeaveIfError(DataSource()->Session().RemoveObjectsL(objectsForRemoval, sucessfullyRemovedObjects));
+    	User::LeaveIfError(DataSource()->Session().RemoveObjectsL(objectsForRemoval, 
+    	        sucessfullyRemovedObjects));
     	}
     
     CleanupStack::PopAndDestroy(&sucessfullyRemovedObjects);
@@ -952,7 +988,8 @@
 void CGlxDataSourceTaskMdeCommand::DoHandleDeleteItemsQueryCompletedL
 															(CMdEQuery& aQuery)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleDeleteItemsQueryCompletedL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleDeleteItemsQueryCompletedL()");
+    TInt deleteItemCounter = 0;
     ContentAccess::CManager *manager = ContentAccess::CManager::NewL();
     CleanupStack::PushL(manager);
     TInt queryCount = aQuery.Count();
@@ -971,7 +1008,10 @@
     User::LeaveIfError( fs.Connect() );
     
     TInt lastErr = KErrNone;
-    for(TInt queryPos = queryCount - 1; queryPos >= 0; queryPos--)
+    
+    // If Delete operation is cancelled before completion, 
+    // iCancelled because ETrue, break out of for loop.
+    for(TInt queryPos = queryCount - 1; (queryPos >= 0 && !iCancelled); queryPos--)
         {
         CMdEObject& object = static_cast<CMdEObject&>(aQuery.ResultItem(queryPos));
         //Removes the Read Only attributes of the file 
@@ -981,7 +1021,22 @@
         	{
         	lastErr = err;
         	}    
-        objectsForRemoval.AppendL(object.Id());
+        else
+            {    
+            // On successful deletion, delete the same from database
+            objectsForRemoval.AppendL(object.Id());
+            }
+			 
+        // After every 50 items are deleted, break from the for loop 
+        // and process other pending requests if any
+        if(deleteItemCounter == KDeletedItemCount)
+			{	
+			iTimer->Start( KDeleteOperationInterval, KDeleteOperationInterval,
+							TCallBack( &SchedulerStopCallback, (TAny *)this ) );	
+			iSchedulerWait->Start();  
+			deleteItemCounter = 0;
+			}     
+        deleteItemCounter++;     
         }
     // Calling Close() on file server session 
     CleanupStack::PopAndDestroy( &fs );
@@ -1007,7 +1062,7 @@
 void CGlxDataSourceTaskMdeCommand::DoHandleRenameConainerQueryCompletedL
                                                             (CMdEQuery& aQuery)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleRenameConainerQueryCompletedL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleRenameConainerQueryCompletedL()");
 	__ASSERT_DEBUG(iObjectToRename, Panic(EGlxPanicLogicError));
 	if (aQuery.Count())
 		{
@@ -1035,8 +1090,8 @@
             // the type to be a non-localised user defined album
             static_cast<CMdEUint16Property*>(albumType)->SetValueL(MdeConstants::Album::EAlbumUser);
             }
-        
-		else if ((albumTypeValue == MdeConstants::Album::EAlbumSystemFavourite) || (albumTypeValue == MdeConstants::Album::EAlbumSystemCamera))
+		else if ((albumTypeValue == MdeConstants::Album::EAlbumSystemFavourite) || 
+				(albumTypeValue == MdeConstants::Album::EAlbumSystemCamera))
 		    {
             // Cannot rename system albums
 		    User::Leave(KErrAccessDenied); 
@@ -1107,7 +1162,7 @@
 void CGlxDataSourceTaskMdeCommand::DoHandleRenameQueryCompletedL
                                                            (CMdEQuery& aQuery)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleRenameQueryCompletedL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::DoHandleRenameQueryCompletedL()");
 	__ASSERT_DEBUG(aQuery.Count() == 1, Panic(EGlxPanicUnexpectedQueryResultCount ));
 	delete iObjectToRename;
 	iObjectToRename = static_cast<CMdEObject*>(aQuery.TakeOwnershipOfResult(0));
@@ -1127,20 +1182,23 @@
 void  CGlxDataSourceTaskMdeCommand::AppendContainerTitleCountQueryL
                         (const TGlxQueryType& aQueryType, const TDesC& aTitle)
 	{
-    TRACER("CGlxDataSourceTaskMdeCommand::AppendContainerTitleCountQueryL()")
+    TRACER("CGlxDataSourceTaskMdeCommand::AppendContainerTitleCountQueryL()");
 	// Test to see if a container alerady exists in the database with aContainerName
     CMdEObjectDef* containerObjectDef = NULL;
     TInt err = ContainerObjectDef(containerObjectDef);
     __ASSERT_ALWAYS(err == KErrNone, Panic(EGlxPanicInvalidCollectionUid));
     
-    CMdEQuery* query = DataSource()->Session().NewObjectQueryL(*DataSource()->NamespaceDef(), *containerObjectDef, this);
+    CMdEQuery* query = DataSource()->Session().NewObjectQueryL(*DataSource()->NamespaceDef(),
+            *containerObjectDef, this);
     CleanupStack::PushL(query);
     
-    CMdEPropertyDef& titlePropertyDef = DataSource()->ObjectDef().GetPropertyDefL(KPropertyDefNameTitle);
+    CMdEPropertyDef& titlePropertyDef = DataSource()->ObjectDef().GetPropertyDefL(
+            KPropertyDefNameTitle);
     
     query->SetResultMode(EQueryResultModeCount);
     
-    query->Conditions().AddPropertyConditionL(titlePropertyDef, ETextPropertyConditionCompareEquals, aTitle);
+    query->Conditions().AddPropertyConditionL(titlePropertyDef, 
+            ETextPropertyConditionCompareEquals, aTitle);
     
     CleanupStack::Pop(query);
     
@@ -1153,7 +1211,7 @@
 //	
 TInt CGlxDataSourceTaskMdeCommand::SearchStringL(TInt aResourceId)
 	{
-	
+	TRACER("CGlxDataSourceTaskMdeCommand::SearchStringL()");
 	_LIT(KResourceFile, "z:glxpluginalbums.rsc");	
    	
    	if (!iStringCache)
@@ -1170,3 +1228,39 @@
     return result;    
         	
 	}
+
+// ----------------------------------------------------------------------------
+//  CGlxDataSourceTaskMdeCommand::SchedulerStopCallback
+// ----------------------------------------------------------------------------
+//
+TInt CGlxDataSourceTaskMdeCommand::SchedulerStopCallback(TAny* aPtr)
+    {
+    TRACER("CGlxDataSourceTaskMdeCommand::SchedulerStopCallback");
+    
+    CGlxDataSourceTaskMdeCommand* self = (CGlxDataSourceTaskMdeCommand*) aPtr;
+    if ( self )
+        {
+        self->SchedulerStopComplete();
+        }
+
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// SchedulerStopComplete
+// -----------------------------------------------------------------------------
+//
+void CGlxDataSourceTaskMdeCommand::SchedulerStopComplete()
+    {
+    TRACER("CGlxDataSourceTaskMdeCommand::SchedulerStopComplete");  
+    
+    if(iTimer && iTimer->IsActive())
+    	{
+    	iTimer->Cancel();
+    	}
+    
+    if(iSchedulerWait)
+		{		
+		iSchedulerWait->AsyncStop();    
+		}  
+    }
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsidlist.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsidlist.cpp	Fri May 28 21:11:54 2010 +0530
@@ -74,7 +74,8 @@
 //  Constructor
 // ----------------------------------------------------------------------------
 //	
-CGlxDataSourceTaskMdeIdList::CGlxDataSourceTaskMdeIdList(CGlxIdListRequest* aRequest, MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource)
+CGlxDataSourceTaskMdeIdList::CGlxDataSourceTaskMdeIdList(CGlxIdListRequest* aRequest,
+        MGlxDataSourceRequestObserver& aObserver, CGlxDataSource* aDataSource)
     : CGlxDataSourceTaskMde(aRequest, aObserver, aDataSource)
     {
     TRACER("CGlxDataSourceTaskMdeIdList::CGlxDataSourceTaskMdeIdList()")
@@ -109,6 +110,9 @@
 void CGlxDataSourceTaskMdeIdList::ExecuteRequestL()
     {
     TRACER("CGlxDataSourceTaskMdeIdList::ExecuteRequestL()") 
+#ifdef _DEBUG
+    iStartTime.HomeTime(); 
+#endif    
     CGlxIdListRequest* request = static_cast<CGlxIdListRequest*>(iRequest);
     TGlxMediaId container = request->ContainerId();
     TGlxQueryType queryType = EIdListQuery;
@@ -140,9 +144,9 @@
                 }
             case KGlxCollectionPluginMonthsImplementationUid:
                 {
-                iFilterProperties.iOrigin = EGlxFilterOriginCamera;
+                iFilterProperties.iOrigin = EGlxFilterOriginAll;          
                 container = TGlxMediaId(KGlxCollectionRootId);
-                resultMode = EQueryResultModeObjectWithFreetexts;
+                resultMode = EQueryResultModeItem;
                 break;
                 }
             case KGlxCollectionPluginImageViewerImplementationUid:
@@ -177,7 +181,7 @@
                 }
             case KGlxCollectionPluginMonthsImplementationUid: 
                 {
-				iFilterProperties.iOrigin = EGlxFilterOriginCamera;
+				iFilterProperties.iOrigin = EGlxFilterOriginAll;
                 AddMonthFilterL(container, iFilterProperties);
                 container = TGlxMediaId(KGlxCollectionRootId);
                 break;
@@ -202,6 +206,11 @@
     TRACER("CGlxDataSourceTaskMdeIdList::DoHandleQueryCompletedL()")
     __ASSERT_DEBUG(iQueryTypes[0] == EIdListQuery, Panic(EGlxPanicLogicError));
     DoHandleListQueryCompletedL();
+#ifdef _DEBUG
+    iStopTime.HomeTime(); 
+    GLX_DEBUG2("GlxDataSrcTaskMdeIdList:DoHandleQueryCompletedL() took %d us",
+                     (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64());
+#endif    
     }
 
 // ----------------------------------------------------------------------------
@@ -211,7 +220,7 @@
 void CGlxDataSourceTaskMdeIdList::DoHandleListQueryCompletedL()
     {
     TRACER("CGlxDataSourceTaskMdeIdList::DoHandleListQueryCompletedL()")
-    if(iQueries[0]->ResultMode() == EQueryResultModeObjectWithFreetexts)
+    if(iQueries[0]->ResultMode() == EQueryResultModeItem)
         {
         DoMonthListCreationL(*iQueries[0], iFilterProperties);
         }
@@ -245,6 +254,7 @@
     TTime lastMonth;
     TTime currentMonth;
     TInt count = aQuery.Count();
+    GLX_DEBUG2("CGlxDataSourceTaskMdeIdList::DoMonthListCreationL count=%d", count);    
     for( TInt i = 0 ; i < count ; i++ )
         {
         CMdEObject& object = (CMdEObject&)aQuery.ResultItem(i);
@@ -254,13 +264,17 @@
             User::Leave(KErrCorrupt);
             }
         currentMonth = static_cast<CMdETimeProperty*>(time)->Value();
-        if( !DataSource()->SameMonth(lastMonth, currentMonth) )
+
+        // Also Checking for a Valid Month Entry Based on a Year Greater than 0000.
+        if( !DataSource()->SameMonth(lastMonth, currentMonth) && (currentMonth.DateTime().Year() > 0) )
             {
             const TGlxMediaId monthId = DataSource()->GetMonthIdL(currentMonth);
             monthList.AppendL(monthId);
+            GLX_DEBUG2("CGlxDataSourceTaskMdeIdList::DoMonthListCreationL monthId=%d", monthId.Value());    
             lastMonth = currentMonth;
             }
         }
+    GLX_DEBUG2("CGlxDataSourceTaskMdeIdList::DoMonthListCreationL monthList.Count=%d", monthList.Count());    
     PostFilterL(monthList, aFilterProperties);
     CleanupStack::PopAndDestroy(&monthList);
     }
--- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsthumbnail.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsthumbnail.cpp	Fri May 28 21:11:54 2010 +0530
@@ -156,14 +156,17 @@
 void CGlxDataSourceTaskMdeThumbnail::ExecuteRequestL()
     {
     TRACER("CGlxDataSourceTaskMdeThumbnail::ExecuteRequestL()") 
+#ifdef _DEBUG
+    iStartTime.HomeTime(); 
+#endif
     CGlxThumbnailRequest* request = static_cast<CGlxThumbnailRequest*>(iRequest);
     
     TGlxThumbnailRequest tnReq;
     request->ThumbnailRequest(tnReq);
-#ifdef _DEBUG
-	RDebug::Print(_L("==> CGlxDataSourceTaskMdeThumbnail::ExecuteRequestL - FetchThumbnailL(Id=%d), W(%d), H(%d)"), request->ItemId().Value(), tnReq.iSizeClass.iWidth, tnReq.iSizeClass.iHeight);
-	iStartTime.HomeTime(); // Get home time
-#endif
+    GLX_DEBUG4("*** CGlxDataSourceTaskMdeThumbnail::ExecuteRequestL() Id=%d, TN Size w(%d) h(%d) ***", tnReq.iId.Value(),
+    						tnReq.iSizeClass.iWidth, tnReq.iSizeClass.iHeight);
+    GLX_DEBUG2("CGlxDataSourceTaskMdeThumbnail::ExecuteRequestL() iPriorityMode=%d", tnReq.iPriorityMode);
+	
 #ifdef USE_S60_TNM
 	if(request->ThumbnailInfo())
 		{
@@ -173,7 +176,7 @@
 			}
 		else
 			{
-			ThumbnailFetchComplete(KErrNone);
+			ThumbnailFetchComplete(KErrNone, ETrue);
 			}
 		}
 	else
@@ -241,11 +244,13 @@
     {
     TRACER("CGlxDataSourceTaskMdeThumbnail::HandleThumbnailFetchCompleteL()")
     __ASSERT_DEBUG(dynamic_cast<CGlxThumbnailRequest*>(iRequest), Panic(EGlxPanicLogicError));
+    CGlxThumbnailRequest* req = static_cast<CGlxThumbnailRequest*>(iRequest);
+    GLX_DEBUG2("*** CGlxDataSourceTaskMdeThumbnail::HandleThumbnailFetchCompleteL() Id=%d ***", req->ItemId().Value());
 #ifdef _DEBUG
-    iStopTime.HomeTime(); // Get home time
-	RDebug::Print(_L("==> ThumbnailFetchComplete <%d> us"), (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64());
-#endif
-    CGlxThumbnailRequest* req = static_cast<CGlxThumbnailRequest*>(iRequest);
+    iStopTime.HomeTime(); 
+    GLX_DEBUG2("CGlxDataSourceTaskMdeThumbnail:HandleThumbnailFetchCompleteL() took %d us",
+                     (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64());
+#endif    
     delete iResponse;
     iResponse = NULL;
     iResponse = CMPXMedia::NewL();
@@ -257,6 +262,7 @@
     tnAttribute->iDimensions = size;
     tnAttribute->iCroppingRect = tnRequest.iCroppingRect;
     tnAttribute->iThumbnailQuality = aQuality;
+    GLX_DEBUG2("CGlxDataSourceTaskMdeThumbnail::HandleThumbnailFetchCompleteL() aQuality=%d", aQuality);
 
     TUint attributeId = req->AttributeId();
     if ( GlxIsFullThumbnailAttribute(attributeId) )
@@ -273,7 +279,8 @@
     }
 
 #ifdef USE_S60_TNM
-void CGlxDataSourceTaskMdeThumbnail::ThumbnailFetchComplete(TInt aError)
+void CGlxDataSourceTaskMdeThumbnail::ThumbnailFetchComplete(TInt aError, 
+                                                            TBool aQuality)
 	{
     TRACER("CGlxDataSourceTaskMdeThumbnail::ThumbnailFetchComplete(TNM)")
     CGlxThumbnailRequest* request = static_cast<CGlxThumbnailRequest*>(iRequest);
@@ -282,7 +289,12 @@
     TInt err = aError;
     if(!err)
         {
-        TRAP(err, HandleThumbnailFetchCompleteL(tnRequest.iId, EGlxThumbnailQualityHigh));
+        TGlxThumbnailQuality tnQuality = EGlxThumbnailQualityHigh;
+        if (!aQuality)
+            {
+            tnQuality = EGlxThumbnailQualityLow;
+            }
+        TRAP(err, HandleThumbnailFetchCompleteL(tnRequest.iId, tnQuality));
         }
     HandleRequestComplete(err);
 	}
@@ -297,6 +309,7 @@
     const TGlxMediaId& aItemId, TGlxThumbnailQuality aQuality, TInt aErrorCode)
     {
     TRACER("CGlxDataSourceTaskMdeThumbnail::ThumbnailFetchComplete()")
+    GLX_DEBUG2("CGlxDataSourceTaskMdeThumbnail::ThumbnailFetchComplete() aErrorCode=%d", aErrorCode);
     iTnRequestInProgress = EFalse;
     TInt err = aErrorCode;
     if(!err)
@@ -368,18 +381,19 @@
         
         /// @todo: use default filter so we can ensure we always get correct first item if filters change
         iFilterProperties.iSortOrder = EGlxFilterSortOrderCaptureDate;
-        iFilterProperties.iSortDirection = EGlxFilterSortDirectionAscending;
+        iFilterProperties.iSortDirection = EGlxFilterSortDirectionOverrideToDescendingIfDate;
         iFilterProperties.iLastCaptureDate = ETrue;
 
         if( CGlxDataSource::EContainerTypeMonth == containerType )
             {
-            iFilterProperties.iOrigin = EGlxFilterOriginCamera;
+            iFilterProperties.iOrigin = EGlxFilterOriginAll;
             AddMonthFilterL(item, iFilterProperties);
             container = TGlxMediaId(KGlxCollectionRootId);
             objectDef = &DataSource()->ObjectDef();
             }
             
-        DoQueryL(*objectDef, ETrue, EContainerFirstItemQuery,  EQueryResultModeObjectWithFreetexts, container);        
+        DoQueryL(*objectDef, ETrue, EContainerFirstItemQuery,  
+                EQueryResultModeItem, container);        
         }
     else
         {
@@ -433,7 +447,8 @@
         }
 
     CMdEProperty* lastModifiedDateProperty;
-    CMdEPropertyDef& lastModifiedDatePropertyDef = aItem->Def().GetPropertyDefL(KPropertyDefNameLastModifiedDate);
+    CMdEPropertyDef& lastModifiedDatePropertyDef = aItem->Def().GetPropertyDefL(
+            KPropertyDefNameLastModifiedDate);
 
 #ifdef _DEBUG
     TInt index = // This variable is only required for the assert debug below. If it is not wrapped in an  
@@ -467,7 +482,8 @@
         // i.e. background thumbnail generation
         // so we get status from CAF to avoid forcing second stage harvest
         TRAP(err, 
-            ContentAccess::CContent* content = ContentAccess::CContent::NewLC(iTnFileInfo->FilePath());
+            ContentAccess::CContent* content = ContentAccess::CContent::NewLC(
+                    iTnFileInfo->FilePath());
             content->GetAttribute(ContentAccess::EIsProtected, iTnFileInfo->iIsProtected);
             CleanupStack::PopAndDestroy(content);
             );
@@ -512,10 +528,11 @@
 void CGlxDataSourceTaskMdeThumbnail::CompleteThumbnailRequest(TInt aError)
 	{
     TRACER("CGlxDataSourceTaskMdeThumbnail::CompleteThumbnailRequest(TInt aError)")
+    GLX_DEBUG2("CGlxDataSourceTaskMdeThumbnail::CompleteThumbnailRequest  aError=%d", aError);
 #ifdef USE_S60_TNM
 	if (aError != KErrNone)
 		{
-		ThumbnailFetchComplete(aError);
+		ThumbnailFetchComplete(aError, EFalse);
 		}
 	else
 		{
@@ -526,11 +543,15 @@
 		if (tnReq.iSizeClass.iWidth > 0 && tnReq.iSizeClass.iHeight > 0 )
 			{
 		    request->SetThumbnailInfo(iTnFileInfo);
+		    //This function is called number of times as a callback ,
+            //hence not trapping the leaving function which costs time and memory.
+            //Ignoring this for code scanner warnings - Leaving functions called in non-leaving functions.
 			DataSource()->FetchThumbnailL(iRequest, *this);
 			}
 		else
 			{
-			ThumbnailFetchComplete(KErrArgument);
+		    GLX_LOG_INFO("CGlxDataSourceTaskMdeThumbnail::CompleteThumbnailRequest KErrArgument");
+			ThumbnailFetchComplete(KErrArgument, EFalse);
 			}
 			}
 #else
@@ -571,18 +592,19 @@
         
         /// @todo: use default filter so we can ensure we always get correct first item if filters change
         iFilterProperties.iSortOrder = EGlxFilterSortOrderCaptureDate;
-        iFilterProperties.iSortDirection = EGlxFilterSortDirectionAscending;
+        iFilterProperties.iSortDirection = EGlxFilterSortDirectionOverrideToDescendingIfDate;
         iFilterProperties.iLastCaptureDate = ETrue;
 
         if( CGlxDataSource::EContainerTypeMonth == containerType )
             {
-            iFilterProperties.iOrigin = EGlxFilterOriginCamera;
+            iFilterProperties.iOrigin = EGlxFilterOriginAll;
             AddMonthFilterL(item, iFilterProperties);
             container = TGlxMediaId(KGlxCollectionRootId);
             objectDef = &DataSource()->ObjectDef();
             }
             
-        DoQueryL(*objectDef, ETrue, EContainerFirstItemQuery,  EQueryResultModeObjectWithFreetexts, container);        
+        DoQueryL(*objectDef, ETrue, EContainerFirstItemQuery, 
+                EQueryResultModeItem, container);        
         }
     else
         {
--- a/engine/collectionframework/plugins/glxcollectionpluginimageviewer/src/glxcollectionpluginimageviewer.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/plugins/glxcollectionpluginimageviewer/src/glxcollectionpluginimageviewer.cpp	Fri May 28 21:11:54 2010 +0530
@@ -92,8 +92,8 @@
     }
 
 void CGlxCollectionPluginImageViewer::CpiAttributeAdditionalAttributes(
-        const TMPXAttribute& aCpiAttribute, 
-        RArray<TMPXAttribute>& aAttributeArray)
+        const TMPXAttribute& /*aCpiAttribute*/, 
+        RArray<TMPXAttribute>& /*aAttributeArray*/)
     {
     // Nothing to be shared apart from the ones that are commonly loaded.
     }
@@ -146,8 +146,8 @@
     }
 
 void CGlxCollectionPluginImageViewer::HandleCpiAttributeResponseL(
-        CMPXMedia* aResponse, TArray<TMPXAttribute> aCpiAttributes,
-        TGlxMediaId aMediaId)
+        CMPXMedia* /*aResponse*/, TArray<TMPXAttribute> aCpiAttributes,
+        TGlxMediaId /*aMediaId*/)
     {
     const TInt attribCount = aCpiAttributes.Count();
 
--- a/engine/collectionframework/plugins/glxcollectionpluginmonths/inc/glxcollectionpluginmonths.h	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/plugins/glxcollectionpluginmonths/inc/glxcollectionpluginmonths.h	Fri May 28 21:11:54 2010 +0530
@@ -78,7 +78,8 @@
 	 * @param aCpiAttribute CPI specific attribute to be constructed later
 	 * @param aAttributeArray modifiable list of attributes to be retrieved from data source
 	 */	 
-	void CpiAttributeAdditionalAttributes(const TMPXAttribute& aCpiAttribute, RArray<TMPXAttribute>& aAttributeArray);     	
+	void CpiAttributeAdditionalAttributes(const TMPXAttribute& aCpiAttribute,
+			RArray<TMPXAttribute>& aAttributeArray);
 
 	/**
 	 * Modifies the response to include all requested CPI specific attributes or Leaves.
@@ -86,7 +87,8 @@
 	 * @param aResponse Data Source constructed response to which CPI specific attributes should be added (also contains any required data)
 	 * @param aCpiAttributes list of CPI specific attributes to be constructed
 	 */	 
-	void HandleCpiAttributeResponseL(CMPXMedia* aResponse, TArray<TMPXAttribute> aCpiAttributes, TArray<TGlxMediaId> aMediaIds);
+	void HandleCpiAttributeResponseL(CMPXMedia* aResponse,
+			TArray<TMPXAttribute> aCpiAttributes, TArray<TGlxMediaId> aMediaIds);
 
 	/**
 	 * Modifies the response to include all requested CPI specific attributes or Leaves.
@@ -95,7 +97,8 @@
 	 * @param aCpiAttributes list of CPI specific attributes to be constructed
 	 * @param aMediaId CPI specific media Id
 	 */	 
-    void HandleCpiAttributeResponseL(CMPXMedia* aResponse, TArray<TMPXAttribute> aCpiAttributes, TGlxMediaId aMediaId);
+    void HandleCpiAttributeResponseL(CMPXMedia* aResponse,
+    		TArray<TMPXAttribute> aCpiAttributes, TGlxMediaId aMediaId);
 
 	TBool IsUpdateMessageIgnored(CMPXMessage& aMessage);
 
--- a/engine/collectionframework/plugins/glxcollectionpluginmonths/src/glxcollectionpluginmonths.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/plugins/glxcollectionpluginmonths/src/glxcollectionpluginmonths.cpp	Fri May 28 21:11:54 2010 +0530
@@ -46,6 +46,13 @@
  * @internal reviewed 14/06/2007 by Alex Birkett
  */
 // CONSTANTS
+const TInt KYearBufferSize = 8;
+const TInt KDateBufferPaddingMin = 10;
+const TInt KDateBufferPaddingMax = 20;
+const TInt KDateFormat1 = 1;
+
+const TInt KDateFormat2 = 2;
+const TInt KDateFormat3 = 3;
 
 // ============================ LOCAL FUNCTIONS ==============================
     
@@ -96,7 +103,8 @@
 // CpiAttributeAdditionalAttributes
 // ----------------------------------------------------------------------------
 //
-void CGlxCollectionPluginMonths::CpiAttributeAdditionalAttributes(const TMPXAttribute& aCpiAttribute, RArray<TMPXAttribute>& aAttributeArray)
+void CGlxCollectionPluginMonths::CpiAttributeAdditionalAttributes(
+	const TMPXAttribute& aCpiAttribute, RArray<TMPXAttribute>& aAttributeArray)
 	{
     TRACER("CGlxCollectionPluginMonths::CpiAttributeAdditionalAttributes");
     // Only need to process KGlxMediaCollectionPluginSpecificSubTitle here as all the others are reading straight from resource files
@@ -185,7 +193,8 @@
 // HandleCpiAttributeResponseL
 // ----------------------------------------------------------------------------
 // 
-void CGlxCollectionPluginMonths::HandleCpiAttributeResponseL(CMPXMedia* aResponse, TArray<TMPXAttribute> aCpiAttributes, TArray<TGlxMediaId> aMediaIds)
+void CGlxCollectionPluginMonths::HandleCpiAttributeResponseL(CMPXMedia* aResponse,
+		TArray<TMPXAttribute> aCpiAttributes, TArray<TGlxMediaId> aMediaIds)
     {
     TRACER("CGlxCollectionPluginMonths::HandleCpiAttributeResponseL");
     
@@ -211,7 +220,8 @@
                 User::Leave(KErrNotSupported);
                 }
                 
-            CMPXMediaArray* mediaArray = aResponse->ValueCObjectL<CMPXMediaArray>(KMPXMediaArrayContents);
+            CMPXMediaArray* mediaArray =
+            	aResponse->ValueCObjectL<CMPXMediaArray>(KMPXMediaArrayContents);
             CleanupStack::PushL(mediaArray);
 
             const TInt arrayCount = mediaArray->Count();
@@ -224,7 +234,8 @@
             
             for (TInt index = 0; index < arrayCount; index++)
                 {
-                HandleCpiAttributeResponseL((*mediaArray)[index], aCpiAttributes, aMediaIds[index]);
+                HandleCpiAttributeResponseL((*mediaArray)[index],
+                		aCpiAttributes, aMediaIds[index]);
                 }
 
             aResponse->SetCObjectValueL(KMPXMediaArrayContents, mediaArray);
@@ -239,7 +250,8 @@
 // HandleCpiAttributeResponseL
 // ----------------------------------------------------------------------------
 // 
-void CGlxCollectionPluginMonths::HandleCpiAttributeResponseL(CMPXMedia* aResponse, TArray<TMPXAttribute> aCpiAttributes, TGlxMediaId aMediaId)
+void CGlxCollectionPluginMonths::HandleCpiAttributeResponseL(CMPXMedia* aResponse,
+		TArray<TMPXAttribute> aCpiAttributes, TGlxMediaId aMediaId)
     {
     TRACER("CGlxCollectionPluginMonths::HandleCpiAttributeResponseL");
     
@@ -297,7 +309,7 @@
 						TPtr formatString = tempTitle->Des();
 
 						// Now create a buffer that will contain the result. needs to be length of format string plus a few extra for the number
-						HBufC* title = HBufC::NewLC(formatString.Length() + 10);
+						HBufC* title = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMin);
 						TPtr ptr = title->Des();
 						StringLoader::Format(ptr, formatString, -1, usageCount);
 
@@ -393,7 +405,7 @@
                         break;
                         }
                     }
-                TBuf<8> yearTitle2;
+                TBuf<KYearBufferSize> yearTitle2;
                 end.FormatL(yearTitle2, KGlxTempMonthYearTitleFormat);
                 HBufC* monthTitle2 = NULL;
                 switch(end.DateTime().Month())
@@ -460,20 +472,20 @@
                         }
                     }
 
-                HBufC* title1 = HBufC::NewLC(formatString.Length() + 20);
+                HBufC* title1 = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMax);
                 TPtr ptr1 = title1->Des();
-                HBufC* title2 = HBufC::NewLC(formatString.Length() + 20);
+                HBufC* title2 = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMax);
                 TPtr ptr2 = title2->Des();
-                HBufC* title3 = HBufC::NewLC(formatString.Length() + 20);
+                HBufC* title3 = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMax);
                 TPtr ptr3 = title3->Des();
-                HBufC* title4 = HBufC::NewLC(formatString.Length() + 20);
+                HBufC* title4 = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMax);
                 TPtr ptr4 = title4->Des();
                 TPtr monthPtr = monthTitle->Des();
                 TPtr monthPtr2 = monthTitle2->Des();
                 StringLoader::Format(ptr1, formatString, 0, monthPtr);
-                StringLoader::Format(ptr2, ptr1, 1, yearTitle);
-                StringLoader::Format(ptr3, ptr2, 2, monthPtr2);
-                StringLoader::Format(ptr4, ptr3, 3, yearTitle2);
+                StringLoader::Format(ptr2, ptr1, KDateFormat1, yearTitle);
+                StringLoader::Format(ptr3, ptr2, KDateFormat2, monthPtr2);
+                StringLoader::Format(ptr4, ptr3, KDateFormat3, yearTitle2);
                 
 
                 aResponse->SetTextValueL(attr, *title4);  
@@ -502,7 +514,8 @@
 					{  
 					GLX_LOG_INFO("VideoCount:0,ImageCount:0");
 					              	
-					tempTitle = LoadLocalizedStringLC(KResourceFile, R_MONTHS_SUB_TITLE_NO_IMAGE_NO_VIDEO);
+					tempTitle = LoadLocalizedStringLC(KResourceFile,
+										R_MONTHS_SUB_TITLE_NO_IMAGE_NO_VIDEO);
 					aResponse->SetTextValueL(attr, *tempTitle);	
 					}
 				else
@@ -512,12 +525,13 @@
 						{
 						GLX_LOG_INFO1("ImageCount:1,VideoCount:%d",videoCount);
 						
-						tempTitle = LoadLocalizedStringLC(KResourceFile, R_MONTHS_SUB_TITLE_ONE_IMAGE_MULTI_VIDEO);
+						tempTitle = LoadLocalizedStringLC(KResourceFile,
+										R_MONTHS_SUB_TITLE_ONE_IMAGE_MULTI_VIDEO);
 
 						TPtr formatString = tempTitle->Des();
 
 						// Now create a buffer that will contain the result. needs to be length of format string plus a few extra for the number
-						HBufC* title = HBufC::NewLC(formatString.Length() + 10);
+						HBufC* title = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMin);
 						TPtr ptr = title->Des();
 
 						StringLoader::Format(ptr, formatString, -1, videoCount);
@@ -533,12 +547,13 @@
 						{
 						GLX_LOG_INFO1("ImageCount: %d,VideoCount:1",imageCount);
 						
-						tempTitle = LoadLocalizedStringLC(KResourceFile, R_MONTHS_SUB_TITLE_MULTI_IMAGE_ONE_VIDEO);                	
+						tempTitle = LoadLocalizedStringLC(KResourceFile,
+									R_MONTHS_SUB_TITLE_MULTI_IMAGE_ONE_VIDEO);
 
 						TPtr formatString = tempTitle->Des();
 
 						// Now create a buffer that will contain the result. needs to be length of format string plus a few extra for the number
-						HBufC* title = HBufC::NewLC(formatString.Length() + 10);
+						HBufC* title = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMin);
 						TPtr ptr = title->Des();
 
 						StringLoader::Format(ptr, formatString, -1, imageCount);
@@ -554,17 +569,19 @@
 						{						
 						GLX_LOG_INFO2("ImageCount %d,VideoCount %d",imageCount,videoCount);
 						
-						tempTitle = LoadLocalizedStringLC(KResourceFile, R_MONTHS_SUB_TITLE_MULTI_IMAGE_MULTI_VIDEO);                	
+						tempTitle = LoadLocalizedStringLC(KResourceFile,
+									R_MONTHS_SUB_TITLE_MULTI_IMAGE_MULTI_VIDEO);
+
 						TPtr formatString = tempTitle->Des();	
 
-						HBufC* title = HBufC::NewLC(formatString.Length() + 10);
+						HBufC* title = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMin);
 						TPtr ptr = title->Des();
 
-						HBufC* title1 = HBufC::NewLC(formatString.Length() + 10);
+						HBufC* title1 = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMin);
 						TPtr ptr1 = title1->Des();
 
 						StringLoader::Format(ptr, formatString, 0, imageCount);
-						StringLoader::Format(ptr1, ptr, 1, videoCount);	
+						StringLoader::Format(ptr1, ptr, KDateFormat1, videoCount);
 
 						// Set the title in the response.	
 						aResponse->SetTextValueL(attr, *title1);
@@ -584,36 +601,41 @@
                     }
                 else if ( aResponse->IsSupported(KGlxMediaCollectionInternalUsageCount) )
                     {
-                    usageCount = aResponse->ValueTObjectL<TInt>(KGlxMediaCollectionInternalUsageCount);
+                    usageCount =
+                    aResponse->ValueTObjectL<TInt>(KGlxMediaCollectionInternalUsageCount);
                     }
                 else
                     {
                     User::Leave(KErrNotSupported);
                     }
                 HBufC* tempTitle = NULL;
-                
+
             	if(0 == usageCount)
             		{
-                	tempTitle = LoadLocalizedStringLC(KResourceFile, R_MONTHS_SUB_TITLE_NO_IMAGE_NO_VIDEO);                	
+                	tempTitle = LoadLocalizedStringLC(KResourceFile,
+                				R_MONTHS_SUB_TITLE_NO_IMAGE_NO_VIDEO);
+
                 	// Set the title in the response.
             		aResponse->SetTextValueL(attr, *tempTitle);  
             		CleanupStack::PopAndDestroy(tempTitle);
-            		continue;                	
-            		}  
-                
+            		continue;
+            		}
+
             	else if (1 == usageCount)
                     {
-                    tempTitle = LoadLocalizedStringLC(KResourceFile, R_MONTHS_SUB_TITLE_SINGLE);
+                    tempTitle = LoadLocalizedStringLC(KResourceFile,
+                    			R_MONTHS_SUB_TITLE_SINGLE);
                     }
                 else
                     {
-                    tempTitle = LoadLocalizedStringLC(KResourceFile, R_MONTHS_SUB_TITLE_MULTI);
+                    tempTitle = LoadLocalizedStringLC(KResourceFile,
+                    			R_MONTHS_SUB_TITLE_MULTI);
                     }
                 
                 TPtr formatString = tempTitle->Des();
                 
                 // Now create a buffer that will contain the result. needs to be length of format string plus a few extra for the number
-                HBufC* title = HBufC::NewLC(formatString.Length() + 10);
+                HBufC* title = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMin);
                 TPtr ptr = title->Des();
                 StringLoader::Format(ptr, formatString, -1, usageCount);
                 
@@ -651,7 +673,8 @@
                 {
                 GLX_LOG_INFO("Attribute : GeneralTitle:RootId");
                 
-                HBufC* title = LoadLocalizedStringLC(KResourceFile, R_MONTHS_GENERAL_TITLE);
+                HBufC* title = LoadLocalizedStringLC(KResourceFile,
+                			R_MONTHS_GENERAL_TITLE);
                 aResponse->SetTextValueL(attr, *title);  
                 CleanupStack::PopAndDestroy(title); 
                 }
@@ -659,11 +682,13 @@
                 {
                 if( aResponse->IsSupported(KGlxMediaCollectionInternalStartDate) )
                     {
-                    HBufC* tempTitle = LoadLocalizedStringLC(KResourceFile, R_MONTHS_ITEM_TITLE);
+                    HBufC* tempTitle = LoadLocalizedStringLC(KResourceFile,
+                    			R_MONTHS_ITEM_TITLE);
                     TPtr formatString = tempTitle->Des();
-                    TTime month = aResponse->ValueTObjectL<TInt64>(KGlxMediaCollectionInternalStartDate);
+                    TTime month =
+                    aResponse->ValueTObjectL<TInt64>(KGlxMediaCollectionInternalStartDate);
                     _LIT(KGlxTempMonthYearTitleFormat, "%F%Y");
-                    TBuf<8> yearTitle;
+                    TBuf<KYearBufferSize> yearTitle;
                     month.FormatL(yearTitle, KGlxTempMonthYearTitleFormat);
                     HBufC* monthTitle = NULL;
                     switch(month.DateTime().Month())
@@ -730,13 +755,13 @@
                             }
                         }
 
-                    HBufC* title1 = HBufC::NewLC(formatString.Length() + 20);
+                    HBufC* title1 = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMax);
                     TPtr ptr = title1->Des();
-                    HBufC* title = HBufC::NewLC(formatString.Length() + 20);
+                    HBufC* title = HBufC::NewLC(formatString.Length() + KDateBufferPaddingMax);
                     TPtr ptr2 = title->Des();
                     TPtr monthPtr = monthTitle->Des();
                     StringLoader::Format(ptr, formatString, 0, monthPtr);
-                    StringLoader::Format(ptr2, ptr, 1, yearTitle);
+                    StringLoader::Format(ptr2, ptr, KDateFormat1, yearTitle);
                     
 
                     aResponse->SetTextValueL(attr, *title);  
--- a/engine/collectionframework/plugins/tagcollectionplugin/src/glxcollectionplugintags.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/engine/collectionframework/plugins/tagcollectionplugin/src/glxcollectionplugintags.cpp	Fri May 28 21:11:54 2010 +0530
@@ -102,7 +102,7 @@
 	    TInt attrCount = aAttributeArray.Count();
 	    TBool found = EFalse;
 	    
-	    //GLX_DEBUG1("CGlxCollectionPluginTags::CpiAttributeAdditionalAttributes-AttributesCount");  
+	    GLX_DEBUG1("CGlxCollectionPluginTags::CpiAttributeAdditionalAttributes-AttributesCount");  
 	    
 	    for ( TInt index = 0 ; index < attrCount ; index++)
 	        {
@@ -169,8 +169,6 @@
                 HandleCpiAttributeResponseL((*mediaArray)[index], aCpiAttributes, 
                 						aMediaIds[index]);
                 }
-
-			 /// @todo - Can we reset a value. Does it overwrite the original or does it leak? Must test
             aResponse->SetCObjectValueL(KMPXMediaArrayContents, mediaArray);        
             CleanupStack::PopAndDestroy(mediaArray);
             }
@@ -225,6 +223,9 @@
                     	{
                     	tempTitle = LoadLocalizedStringLC(KResourceFile,
                    			 R_TAG_SUB_TITLE_SINGLE);
+                        aResponse->SetTextValueL(attr, *tempTitle);  
+                        CleanupStack::PopAndDestroy(tempTitle);
+                        continue;
                     	}
                     else 
                     	{
@@ -247,6 +248,9 @@
                 		{
                 		tempTitle = LoadLocalizedStringLC(KResourceFile,
                    			 R_TAG_ITEM_SUB_TITLE_SINGLE);
+                        aResponse->SetTextValueL(attr, *tempTitle);  
+                        CleanupStack::PopAndDestroy(tempTitle);
+                        continue;
                 		}
                     else
                         {
--- a/gallery/sis/photos.pkg	Mon May 17 13:35:26 2010 +0530
+++ b/gallery/sis/photos.pkg	Fri May 28 21:11:54 2010 +0530
@@ -20,7 +20,7 @@
 &EN
 
 ; Package header
-#{"photos"},(0x20000A14),1,1,0, TYPE=SA ,RU
+#{"photos"},(0x20000A14),2, 1, 0, TYPE=SA ,RU
 
 ; Localised Vendor name
 %{"Nokia, Qt"}
@@ -109,6 +109,8 @@
 "\epoc32\release\armv5\urel\glxmodelwrapper.dll"           -"!:\sys\bin\glxmodelwrapper.dll"
 "\epoc32\release\armv5\urel\glxloggerqt.dll"               -"!:\sys\bin\glxloggerqt.dll"
 "\epoc32\release\armv5\urel\glxviews.dll"                  -"!:\sys\bin\glxviews.dll"
+"\epoc32\release\armv5\urel\glxviewutilities.dll"          -"!:\sys\bin\glxviewutilities.dll"
+"\epoc32\release\armv5\urel\glxzoomwidget.dll"          -"!:\sys\bin\glxzoomwidget.dll"
 
 ;translations
 "\epoc32\data\z\resource\qt\translations\photos_en.qm"     -"!:\resource\qt\translations\photos.qm"
@@ -116,4 +118,7 @@
 ;cenrep
 "\epoc32\data\Z\private\10202BE9\20007194.txt"			   -"!:\private\10202BE9\20007194.txt"		
 
+;splash screen
+"\epoc32\data\z\resource\hb\splashml\photos.splashml"  				-"!:\resource\hb\splashml\photos.splashml"
+"\epoc32\data\z\resource\hb\splashml\photos.docml"  					-"!:\resource\hb\splashml\photos.docml"
 
--- a/gallery/sis/photos_stub.pkg	Mon May 17 13:35:26 2010 +0530
+++ b/gallery/sis/photos_stub.pkg	Fri May 28 21:11:54 2010 +0530
@@ -98,9 +98,14 @@
 "" - "z:\sys\bin\glxlistmodel.dll"
 "" - "z:\sys\bin\glxmodelwrapper.dll"
 "" - "z:\sys\bin\glxviews.dll"
+"" - "z:\sys\bin\glxviewutilities.dll"
+"" - "z:\sys\bin\glxzoomwidget.dll"
 
 "" - "z:\private\10202BE9\20007194.txt"
 
 "" - "z:\resource\qt\translations\photos.qm"
 
 
+;splashscreen
+"" - "z:\resource\hb\splashml\photos.splashml"
+"" - "z:\resource\hb\splashml\photos.docml"
--- a/inc/glxfiltergeneraldefs.h	Mon May 17 13:35:26 2010 +0530
+++ b/inc/glxfiltergeneraldefs.h	Fri May 28 21:11:54 2010 +0530
@@ -86,6 +86,7 @@
 const TMPXAttributeData KGlxFilterGeneralOrigin = { KGlxFilterIdGeneral, EGlxFilterOrigin }; /// TGlxFilterOrigin
 const TMPXAttributeData KGlxFilterGeneralNoDRM = { KGlxFilterIdGeneral, EGlxFilterNoDRM }; /// TBool
 const TMPXAttributeData KGlxFilterGeneralNavigationalStateOnly = { KGlxFilterIdGeneral, 0x4000 }; /// TBool
+const TMPXAttributeData KGlxFilterGeneralMaxCount = { KGlxFilterIdGeneral, 0x8000 }; // TInt
 
 enum TGlxFilterSortOrder
     {
@@ -122,7 +123,8 @@
 	{
 	EGlxFilterOriginNotUsed=0,
 	EGlxFilterOriginCamera,
-	EGlxFilterOriginDownload
+	EGlxFilterOriginDownload,
+	EGlxFilterOriginAll
 	};
 
 #endif // __T_GLXFILTERGENERALDEFS_H__
--- a/inc/glxfilterproperties.h	Mon May 17 13:35:26 2010 +0530
+++ b/inc/glxfilterproperties.h	Fri May 28 21:11:54 2010 +0530
@@ -43,6 +43,7 @@
 				iContainsItem(0),
 				iExcludeAnimation(EFalse),
 				iLastCaptureDate(EFalse),
+				iMaxCount(KMaxTUint),
 				iThumbnailLoadability(0,0),
 				iPath(NULL),
 				iItemType(EGlxFilterVideoAndImages),
@@ -62,6 +63,7 @@
 	TGlxMediaId iContainsItem;
 	TBool iExcludeAnimation;
 	TBool iLastCaptureDate;
+	TInt iMaxCount;
 	TSize iThumbnailLoadability;
 	CMPXCollectionPath* iPath; 
 	TGlxFilterItemType iItemType;
--- a/inc/glxlocalisationstrings.h	Mon May 17 13:35:26 2010 +0530
+++ b/inc/glxlocalisationstrings.h	Fri May 28 21:11:54 2010 +0530
@@ -18,6 +18,7 @@
 #ifndef GLXLOCALISATIONSTRINGS_H_
 #define GLXLOCALISATIONSTRINGS_H_
 
+#include "hbglobal.h"
 
 //OPTIONS MENU
 //Options list item
@@ -108,4 +109,12 @@
 
 #define GLX_BUTTON_HIDE              hbTrId("txt_common_button_hide")
 
+#define GLX_LABEL_TRANSITION_EFFECT  hbTrId("txt_photos_setlabel_transistion_effect")
+#define GLX_VAL_SMOOTH_FADE          hbTrId("txt_photos_setlabel_transistion_effect_val_smooth")
+
+#define GLX_LABEL_TRANSITION_DELAY   hbTrId("txt_photos_setlabel_transistion_delay")
+#define GLX_VAL_SLOW                 hbTrId("txt_photos_setlabel_transistion_delay_val_slow")
+#define GLX_VAL_MEDIUM               hbTrId("txt_photos_setlabel_transistion_delay_val_medium")
+#define GLX_VAL_FAST                 hbTrId("txt_photos_setlabel_transistion_delay_val_fast")
+
 #endif /* GLXLOCALISATIONSTRINGS_H_ */
--- a/inc/glxtvconstants.h	Mon May 17 13:35:26 2010 +0530
+++ b/inc/glxtvconstants.h	Fri May 28 21:11:54 2010 +0530
@@ -30,7 +30,8 @@
     {
     ETvConnectionChanged = 0,
     ETvDisplayIsVisible,
-    ETvDisplayNotVisible
+    ETvDisplayNotVisible,
+    EDisconnected
     };
 
 /** TV size constants */
--- a/photos.qrc	Mon May 17 13:35:26 2010 +0530
+++ b/photos.qrc	Fri May 28 21:11:54 2010 +0530
@@ -7,6 +7,8 @@
         <file>data/transitiondown.fxml</file>
         <file>data/opacity_activate.fxml</file>
         <file>data/opacity_deactivate.fxml</file>
+        <file>data/zoomin.fxml</file>
+        <file>data/zoomout.fxml</file>
         <file>data/view_flip_hide.fxml</file>
         <file>data/view_flip_show.fxml</file>
         <file>data/fullscreentogrid.fxml</file>
@@ -17,10 +19,6 @@
         <file>data/albumlisttogrid.fxml</file>
         <file>data/albumlisttogridshow.fxml</file>
         <file>data/photos.css</file>
-        <file>data/transitionrotate0.fxml</file>
-        <file>data/transitionrotate90.fxml</file>
-        <file>data/transitionrotate180.fxml</file>
-        <file>data/transitionrotate270.fxml</file>
         <file>data/grid.docml</file>
         <file>data/listview.docml</file>
         <file>data/fullscreen.docml</file>
--- a/rom/photos.iby	Mon May 17 13:35:26 2010 +0530
+++ b/rom/photos.iby	Fri May 28 21:11:54 2010 +0530
@@ -76,6 +76,8 @@
 file=ABI_DIR/BUILD_DIR/glxmodelwrapper.dll              	SHARED_LIB_DIR/glxmodelwrapper.dll
 file=ABI_DIR/BUILD_DIR/glxlistmodel.dll                    	SHARED_LIB_DIR/glxlistmodel.dll
 file=ABI_DIR/BUILD_DIR/glxviews.dll                        	SHARED_LIB_DIR/glxviews.dll
+file=ABI_DIR/BUILD_DIR/glxviewutilities.dll                	SHARED_LIB_DIR/glxviewutilities.dll
+file=ABI_DIR/BUILD_DIR/glxzoomwidget.dll                	SHARED_LIB_DIR/glxzoomwidget.dll
 
 
 S60_APP_EXE(photos)
@@ -84,4 +86,6 @@
 data=/epoc32/data/Z/private/10202BE9/20007194.txt						private/10202BE9/20007194.txt
 data=/epoc32/data/z/system/install/photos_stub.sis        				/system/install/photos_stub.sis
 
+data=ZRESOURCE/hb/splashml/photos.splashml  RESOURCE_FILES_DIR/hb/splashml/photos.splashml
+data=ZRESOURCE/hb/splashml/photos.docml  RESOURCE_FILES_DIR/hb/splashml/photos.docml
 #endif //__PHOTOS_IBY__
\ No newline at end of file
--- a/tvout/bwins/glxtvoutwrapperu.def	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/bwins/glxtvoutwrapperu.def	Fri May 28 21:11:54 2010 +0530
@@ -2,10 +2,11 @@
 	?itemNotSupported@GlxTvOutWrapper@@QAEXXZ @ 1 NONAME ; void GlxTvOutWrapper::itemNotSupported(void)
 	??1GlxTvOutWrapper@@QAE@XZ @ 2 NONAME ; GlxTvOutWrapper::~GlxTvOutWrapper(void)
 	?activateZoom@GlxTvOutWrapper@@QAEX_N@Z @ 3 NONAME ; void GlxTvOutWrapper::activateZoom(bool)
-	?setModel@GlxTvOutWrapper@@QAEXPAVQAbstractItemModel@@@Z @ 4 NONAME ; void GlxTvOutWrapper::setModel(class QAbstractItemModel *)
-	??0GlxTvOutWrapper@@QAE@XZ @ 5 NONAME ; GlxTvOutWrapper::GlxTvOutWrapper(void)
-	?deactivateZoom@GlxTvOutWrapper@@QAEXXZ @ 6 NONAME ; void GlxTvOutWrapper::deactivateZoom(void)
-	?setImagetoHDMI@GlxTvOutWrapper@@QAEXXZ @ 7 NONAME ; void GlxTvOutWrapper::setImagetoHDMI(void)
+	??0GlxTvOutWrapper@@QAE@XZ @ 4 NONAME ; GlxTvOutWrapper::GlxTvOutWrapper(void)
+	?deactivateZoom@GlxTvOutWrapper@@QAEXXZ @ 5 NONAME ; void GlxTvOutWrapper::deactivateZoom(void)
+	?fadeSurface@GlxTvOutWrapper@@QAEX_N@Z @ 6 NONAME ; void GlxTvOutWrapper::fadeSurface(bool)
+	?setModel@GlxTvOutWrapper@@QAEXPAVQAbstractItemModel@@_N@Z @ 7 NONAME ; void GlxTvOutWrapper::setModel(class QAbstractItemModel *, bool)
 	?setToCloningMode@GlxTvOutWrapper@@QAEXXZ @ 8 NONAME ; void GlxTvOutWrapper::setToCloningMode(void)
-	?setToNativeMode@GlxTvOutWrapper@@QAEXXZ @ 9 NONAME ; void GlxTvOutWrapper::setToNativeMode(void)
+	?setImagetoHDMI@GlxTvOutWrapper@@QAEXXZ @ 9 NONAME ; void GlxTvOutWrapper::setImagetoHDMI(void)
+	?setToNativeMode@GlxTvOutWrapper@@QAEXXZ @ 10 NONAME ; void GlxTvOutWrapper::setToNativeMode(void)
 
--- a/tvout/eabi/glxtvoutwrapperu.def	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/eabi/glxtvoutwrapperu.def	Fri May 28 21:11:54 2010 +0530
@@ -1,13 +1,14 @@
 EXPORTS
-	_ZN15GlxTvOutWrapper12activateZoomEb @ 1 NONAME
-	_ZN15GlxTvOutWrapper14deactivateZoomEv @ 2 NONAME
-	_ZN15GlxTvOutWrapper14setImagetoHDMIEv @ 3 NONAME
-	_ZN15GlxTvOutWrapper15setToNativeModeEv @ 4 NONAME
-	_ZN15GlxTvOutWrapper16itemNotSupportedEv @ 5 NONAME
-	_ZN15GlxTvOutWrapper16setToCloningModeEv @ 6 NONAME
-	_ZN15GlxTvOutWrapper8setModelEP18QAbstractItemModel @ 7 NONAME
-	_ZN15GlxTvOutWrapperC1Ev @ 8 NONAME
-	_ZN15GlxTvOutWrapperC2Ev @ 9 NONAME
-	_ZN15GlxTvOutWrapperD1Ev @ 10 NONAME
-	_ZN15GlxTvOutWrapperD2Ev @ 11 NONAME
+	_ZN15GlxTvOutWrapper11fadeSurfaceEb @ 1 NONAME
+	_ZN15GlxTvOutWrapper12activateZoomEb @ 2 NONAME
+	_ZN15GlxTvOutWrapper14deactivateZoomEv @ 3 NONAME
+	_ZN15GlxTvOutWrapper14setImagetoHDMIEv @ 4 NONAME
+	_ZN15GlxTvOutWrapper15setToNativeModeEv @ 5 NONAME
+	_ZN15GlxTvOutWrapper16itemNotSupportedEv @ 6 NONAME
+	_ZN15GlxTvOutWrapper16setToCloningModeEv @ 7 NONAME
+	_ZN15GlxTvOutWrapper8setModelEP18QAbstractItemModelb @ 8 NONAME
+	_ZN15GlxTvOutWrapperC1Ev @ 9 NONAME
+	_ZN15GlxTvOutWrapperC2Ev @ 10 NONAME
+	_ZN15GlxTvOutWrapperD1Ev @ 11 NONAME
+	_ZN15GlxTvOutWrapperD2Ev @ 12 NONAME
 
--- a/tvout/tvoutengine/bwins/glxtvoutu.def	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/bwins/glxtvoutu.def	Fri May 28 21:11:54 2010 +0530
@@ -1,16 +1,17 @@
 EXPORTS
 	?ActivateZoom@CGlxHdmiController@@QAEXH@Z @ 1 NONAME ; void CGlxHdmiController::ActivateZoom(int)
 	?ScreenSizeL@CGlxTv@@QBE?AVTSize@@XZ @ 2 NONAME ; class TSize CGlxTv::ScreenSizeL(void) const
-	?SetImageL@CGlxHdmiController@@QAEXABVTDesC16@@PAVCFbsBitmap@@H@Z @ 3 NONAME ; void CGlxHdmiController::SetImageL(class TDesC16 const &, class CFbsBitmap *, int)
-	??1CGlxTv@@UAE@XZ @ 4 NONAME ; CGlxTv::~CGlxTv(void)
-	??1CGlxHdmiController@@UAE@XZ @ 5 NONAME ; CGlxHdmiController::~CGlxHdmiController(void)
-	?NewL@CGlxHdmiController@@SAPAV1@XZ @ 6 NONAME ; class CGlxHdmiController * CGlxHdmiController::NewL(void)
+	?NewL@CGlxHdmiController@@SAPAV1@H@Z @ 3 NONAME ; class CGlxHdmiController * CGlxHdmiController::NewL(int)
+	?SetImageL@CGlxHdmiController@@QAEXABVTDesC16@@PAVCFbsBitmap@@H@Z @ 4 NONAME ; void CGlxHdmiController::SetImageL(class TDesC16 const &, class CFbsBitmap *, int)
+	??1CGlxTv@@UAE@XZ @ 5 NONAME ; CGlxTv::~CGlxTv(void)
+	??1CGlxHdmiController@@UAE@XZ @ 6 NONAME ; CGlxHdmiController::~CGlxHdmiController(void)
 	?IsWidescreen@CGlxTv@@QBEHXZ @ 7 NONAME ; int CGlxTv::IsWidescreen(void) const
 	?ShiftToPostingMode@CGlxHdmiController@@QAEXXZ @ 8 NONAME ; void CGlxHdmiController::ShiftToPostingMode(void)
 	?ShiftToCloningMode@CGlxHdmiController@@QAEXXZ @ 9 NONAME ; void CGlxHdmiController::ShiftToCloningMode(void)
-	?NewL@CGlxTv@@SAPAV1@AAVMGlxTvObserver@@@Z @ 10 NONAME ; class CGlxTv * CGlxTv::NewL(class MGlxTvObserver &)
-	?IsConnected@CGlxTv@@QBEHXZ @ 11 NONAME ; int CGlxTv::IsConnected(void) const
-	?ItemNotSupported@CGlxHdmiController@@QAEXXZ @ 12 NONAME ; void CGlxHdmiController::ItemNotSupported(void)
-	?IsHDMIConnected@CGlxTv@@QBEHXZ @ 13 NONAME ; int CGlxTv::IsHDMIConnected(void) const
-	?DeactivateZoom@CGlxHdmiController@@QAEXXZ @ 14 NONAME ; void CGlxHdmiController::DeactivateZoom(void)
+	?IsConnected@CGlxTv@@QBEHXZ @ 10 NONAME ; int CGlxTv::IsConnected(void) const
+	?ItemNotSupported@CGlxHdmiController@@QAEXXZ @ 11 NONAME ; void CGlxHdmiController::ItemNotSupported(void)
+	?NewL@CGlxTv@@SAPAV1@AAVMGlxTvObserver@@@Z @ 12 NONAME ; class CGlxTv * CGlxTv::NewL(class MGlxTvObserver &)
+	?FadeSurface@CGlxHdmiController@@QAEXH@Z @ 13 NONAME ; void CGlxHdmiController::FadeSurface(int)
+	?IsHDMIConnected@CGlxTv@@QBEHXZ @ 14 NONAME ; int CGlxTv::IsHDMIConnected(void) const
+	?DeactivateZoom@CGlxHdmiController@@QAEXXZ @ 15 NONAME ; void CGlxHdmiController::DeactivateZoom(void)
 
--- a/tvout/tvoutengine/eabi/glxtvoutu.def	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/eabi/glxtvoutu.def	Fri May 28 21:11:54 2010 +0530
@@ -1,28 +1,29 @@
 EXPORTS
-	_ZN18CGlxHdmiController12ActivateZoomEi @ 1 NONAME
-	_ZN18CGlxHdmiController14DeactivateZoomEv @ 2 NONAME
-	_ZN18CGlxHdmiController16ItemNotSupportedEv @ 3 NONAME
-	_ZN18CGlxHdmiController18ShiftToCloningModeEv @ 4 NONAME
-	_ZN18CGlxHdmiController18ShiftToPostingModeEv @ 5 NONAME
-	_ZN18CGlxHdmiController4NewLEv @ 6 NONAME
-	_ZN18CGlxHdmiController9SetImageLERK7TDesC16P10CFbsBitmapi @ 7 NONAME
-	_ZN18CGlxHdmiControllerD0Ev @ 8 NONAME
-	_ZN18CGlxHdmiControllerD1Ev @ 9 NONAME
-	_ZN18CGlxHdmiControllerD2Ev @ 10 NONAME
-	_ZN6CGlxTv4NewLER14MGlxTvObserver @ 11 NONAME
-	_ZN6CGlxTvD0Ev @ 12 NONAME
-	_ZN6CGlxTvD1Ev @ 13 NONAME
-	_ZN6CGlxTvD2Ev @ 14 NONAME
-	_ZNK6CGlxTv11IsConnectedEv @ 15 NONAME
-	_ZNK6CGlxTv11ScreenSizeLEv @ 16 NONAME
-	_ZNK6CGlxTv12IsWidescreenEv @ 17 NONAME
-	_ZNK6CGlxTv15IsHDMIConnectedEv @ 18 NONAME
-	_ZTI17CGlxHdmiContainer @ 19 NONAME
-	_ZTI17CGlxHdmiDecoderAO @ 20 NONAME
-	_ZTI18CGlxHdmiController @ 21 NONAME
-	_ZTI22CGlxHdmiSurfaceUpdater @ 22 NONAME
-	_ZTV17CGlxHdmiContainer @ 23 NONAME
-	_ZTV17CGlxHdmiDecoderAO @ 24 NONAME
-	_ZTV18CGlxHdmiController @ 25 NONAME
-	_ZTV22CGlxHdmiSurfaceUpdater @ 26 NONAME
+	_ZN18CGlxHdmiController11FadeSurfaceEi @ 1 NONAME
+	_ZN18CGlxHdmiController12ActivateZoomEi @ 2 NONAME
+	_ZN18CGlxHdmiController14DeactivateZoomEv @ 3 NONAME
+	_ZN18CGlxHdmiController16ItemNotSupportedEv @ 4 NONAME
+	_ZN18CGlxHdmiController18ShiftToCloningModeEv @ 5 NONAME
+	_ZN18CGlxHdmiController18ShiftToPostingModeEv @ 6 NONAME
+	_ZN18CGlxHdmiController4NewLEi @ 7 NONAME
+	_ZN18CGlxHdmiController9SetImageLERK7TDesC16P10CFbsBitmapi @ 8 NONAME
+	_ZN18CGlxHdmiControllerD0Ev @ 9 NONAME
+	_ZN18CGlxHdmiControllerD1Ev @ 10 NONAME
+	_ZN18CGlxHdmiControllerD2Ev @ 11 NONAME
+	_ZN6CGlxTv4NewLER14MGlxTvObserver @ 12 NONAME
+	_ZN6CGlxTvD0Ev @ 13 NONAME
+	_ZN6CGlxTvD1Ev @ 14 NONAME
+	_ZN6CGlxTvD2Ev @ 15 NONAME
+	_ZNK6CGlxTv11IsConnectedEv @ 16 NONAME
+	_ZNK6CGlxTv11ScreenSizeLEv @ 17 NONAME
+	_ZNK6CGlxTv12IsWidescreenEv @ 18 NONAME
+	_ZNK6CGlxTv15IsHDMIConnectedEv @ 19 NONAME
+	_ZTI17CGlxHdmiContainer @ 20 NONAME
+	_ZTI17CGlxHdmiDecoderAO @ 21 NONAME
+	_ZTI18CGlxHdmiController @ 22 NONAME
+	_ZTI22CGlxHdmiSurfaceUpdater @ 23 NONAME
+	_ZTV17CGlxHdmiContainer @ 24 NONAME
+	_ZTV17CGlxHdmiDecoderAO @ 25 NONAME
+	_ZTV18CGlxHdmiController @ 26 NONAME
+	_ZTV22CGlxHdmiSurfaceUpdater @ 27 NONAME
 
--- a/tvout/tvoutengine/group/glxtvout.mmp	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/group/glxtvout.mmp	Fri May 28 21:11:54 2010 +0530
@@ -64,6 +64,7 @@
 LIBRARY                 apgrfx.lib // 
 LIBRARY			apmime.lib // For ImageViewer mime type extraction
 LIBRARY 		glxlogging.lib
+LIBRARY		      alfdecoderserverclient.lib
 LIBRARY		AccPolicy.lib //For RAccessoryConnection status ID's	
 // Other Dependency Libraries
 #ifdef __MARM
--- a/tvout/tvoutengine/inc/glxhdmicontainer.h	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/inc/glxhdmicontainer.h	Fri May 28 21:11:54 2010 +0530
@@ -63,10 +63,10 @@
     void CreateHdmiWindowL();
     
 private:
-    TRect iRect;
-    RWsSession iSession;
+    TRect               iRect;
+    RWsSession          iSession;
     RWindow             iWsWindow;
-    CWsScreenDevice* iScreenDevice;    
+    CWsScreenDevice*    iScreenDevice;    
     RWindowGroup        iWsWindowGroup;
     CWindowGc*          iWindowGc;
     TInt                iWsWindowGroupID;
--- a/tvout/tvoutengine/inc/glxhdmicontroller.h	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/inc/glxhdmicontroller.h	Fri May 28 21:11:54 2010 +0530
@@ -33,7 +33,7 @@
      * NewLC 
      * @param1 - Image file path default to NULL
      */
-    IMPORT_C static CGlxHdmiController* NewL();
+    IMPORT_C static CGlxHdmiController* NewL(TBool aEfectsOn = EFalse);
 
     /*
      * Destructor
@@ -71,11 +71,18 @@
      */
     IMPORT_C void ShiftToPostingMode();
 
+    /*
+     * Fadeing of the Surface
+     * @param1 ETrue - FadeIn ( as in gaining brightness )
+     *         EFalse - FadeOut ( as in loosing brightness ) 
+     */
+    IMPORT_C void FadeSurface(TBool aFadeInOut);
+    
 private:
     /*
      * Constructor
      */
-    CGlxHdmiController();
+    CGlxHdmiController(TBool aEfectsOn);
     
     /*
      * ConstructL 
@@ -116,6 +123,7 @@
     CGlxHdmiContainer*      iHdmiContainer;
     CGlxHdmiSurfaceUpdater* iSurfaceUpdater;
     TBool   iIsImageSupported;          // Flag to see if Image is supported
+    TBool   iEffectsOn;
     };
 
 #endif /* GLXHDMICONTROLLER_H_ */
--- a/tvout/tvoutengine/inc/glxhdmisurfaceupdater.h	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/inc/glxhdmisurfaceupdater.h	Fri May 28 21:11:54 2010 +0530
@@ -30,7 +30,9 @@
 class CGlxActiveCallBack;
 class CGlxHdmiDecoderAO;
 class CImageDecoder;
+class CAlfCompositionSource;
 class TSurfaceConfiguration;
+
 class MGlxGenCallback
     {
 public:
@@ -44,7 +46,7 @@
      * NewL
      */
     static CGlxHdmiSurfaceUpdater* NewL(RWindow* aWindow, const TDesC& aImageFile, 
-            CFbsBitmap* aFsBitmap, MGlxGenCallback* aCallBack);
+            CFbsBitmap* aFsBitmap, MGlxGenCallback* aCallBack,TBool aEffectsOn);
 
     /*
      * Destructor
@@ -70,10 +72,6 @@
      * Deactivate Zoom 
      */
     void DeactivateZoom();
-    /*
-     * Zoom in our out depending on parameter 
-     */
-    void Zoom(TBool aZoom);
 
     /*
 	ShiftToCloningMOde
@@ -85,11 +83,18 @@
      */
     void ShiftToPostingMode();
 
+    /*
+     * Fadeing of the Surface
+     * @param1 ETrue - FadeIn ( as in gaining brightness )
+     *         EFalse - FadeOut ( as in loosing brightness ) 
+     */
+    void FadeTheSurface(TBool aFadeInOut);
+
 private:
     /*
      * Constructor 
      */
-    CGlxHdmiSurfaceUpdater(RWindow* aWindow, MGlxGenCallback* aCallBack);
+    CGlxHdmiSurfaceUpdater(RWindow* aWindow, MGlxGenCallback* aCallBack,TBool aEffectsOn);
 
     /*
      * ConstructL()
@@ -145,10 +150,20 @@
     void CreateHdmiL(TBool aCreateSurface = ETrue);
 
     /*
+     * Zoom in our out depending on parameter 
+     */
+    void Zoom(TBool aZoom);
+
+    /*
      * This if for zoom timer timeout
      */
     static TInt TimeOut(TAny* aSelf);
-
+    
+    /*
+     * Animation time out timer
+     */
+    static TInt AnimationTimeOut(TAny* aSelf);
+    
     /*
      * ModifySurface positions of the surface to be displayed on screen
      */
@@ -189,12 +204,22 @@
      */
     void InitiateHdmiL(CFbsBitmap* aFsBitmap,const TDesC& aImageFile);
 
+    /*
+     * Animate untill loop is complete 
+     */
+    void Animate();
+
 private:
-    RWindow*        iWindow;                        // window object
-    CFbsBitmap*     iFsBitmap;                      // FS bitmap
-    MGlxGenCallback* iCallBack;                     // callback to the HdmiContainer window
-    HBufC*          iImagePath;                     // To store the image uri path
+    RWindow*            iWindow;                    // window object
+    CFbsBitmap*         iFsBitmap;                  // FS bitmap
+    MGlxGenCallback*    iCallBack;                  // callback to the HdmiContainer window
+    HBufC*              iImagePath;                 // To store the image uri path
+    TBool               iEffectsOn;
 
+    TBool       iShwFsThumbnail;                    // If the Fs thumbnail is to be shown before decoding HD images
+    TBool       iIsNonJpeg;                         // If the item is non jpeg
+    TBool       iFadeIn;                            // If FadeIn or Out for only SLideshow animation
+    
     // GCE Surface
     RSurfaceUpdateSession iSurfUpdateSession;
     TSurfaceId              iSurfId;                // TSurfaceId                             
@@ -210,14 +235,18 @@
     void*               iSurfBuffer;               // Surface buffer
     CGlxActiveCallBack* iSurfBufferAO;             // Surface buffer AO 
 
+    CAlfCompositionSource* ialfCompositionSurface;
+
     //ICL
     CGlxHdmiDecoderAO*  iGlxDecoderAO;              // Internal Image decoder AO              
     CImageDecoder*      iImageDecoder;              // Image Decoder
     RFs                 iFsSession;                 // RFs
 
     TPoint      iLeftCornerForZoom;                 //  
-    CPeriodic*  iTimer;                             // Timer for Zoom   
-    
+    CPeriodic*  iTimer;                             // Timer for Zoom 
+    CPeriodic*  iAnimTimer;                         // Timer for Animation
+    TInt        iAnimCounter;
+
     // Various objects to store sizes and count
     TSize       iTvScreenSize;                      // to store the Tv screen size
     TSize       iTargetBitmapSize;                  // To Store the target bitmap size to display(as per Aspect Ratio)
@@ -227,10 +256,7 @@
     TBool       iBitmapReady;                       // If the bitmap is decoded and ready
     TBool       iAutoZoomOut;                       // If the UI has asked for auto zoomout
     TBool       iSurfSessionConnected;              // If surface session is connected
-	TBool iShiftToCloning;
-    TBool       iShwFsThumbnail;                    // If the Fs thumbnail is to be shown before decoding HD images
-    TBool       iIsNonJpeg;                         // If the item is non jpeg
-
+	TBool       iShiftToCloning;
 #ifdef _DEBUG
     TTime iStartTime;
     TTime iStopTime;
--- a/tvout/tvoutengine/inc/glxtv.h	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/inc/glxtv.h	Fri May 28 21:11:54 2010 +0530
@@ -56,9 +56,10 @@
     {
 public:
     /**
-     * Handle TV connection state changes
+     * Handle TV/HDMI/Headset connection state changes
+     * @param aChangeType The connection change type
      */
-    virtual void HandleTvConnectionStatusChangedL( ) = 0;
+    virtual void HandleTvConnectionStatusChangedL(TTvChangeType aChangeType) = 0;
     };
         
         
@@ -135,7 +136,7 @@
     /**
      * @ref MGlxTvConnectionObserver::HandleTvConnectionStatusChangedL
      */
-    void HandleTvConnectionStatusChangedL( );
+    void HandleTvConnectionStatusChangedL(TTvChangeType aChangeType);
     
 private: // new private methods
     /**
--- a/tvout/tvoutengine/inc/glxtvconnectionmonitor.h	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/inc/glxtvconnectionmonitor.h	Fri May 28 21:11:54 2010 +0530
@@ -84,7 +84,6 @@
      */
     TBool IsHDMIConnected() const;
 
-
 private: // From CActive
     /**
      * @ref CActive::RunL
@@ -130,6 +129,9 @@
     // TVout The Connection state
     TBool iIsHDMIConnected;
 
+    // Headset The Connection state
+    TBool iIsHeadSetConnected;
+
     // The (external device) Accessory Server
     RAccessoryServer iTvAccServer;
 
--- a/tvout/tvoutengine/src/glxhdmicontainer.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/src/glxhdmicontainer.cpp	Fri May 28 21:11:54 2010 +0530
@@ -75,7 +75,7 @@
 RWindow* CGlxHdmiContainer::GetWindow()
     {
     TRACER("CGlxHdmiContainer::GetWindow()");
-    return &Window();   
+    return &iWsWindow;   
     }
 
 // -----------------------------------------------------------------------------
--- a/tvout/tvoutengine/src/glxhdmicontroller.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/src/glxhdmicontroller.cpp	Fri May 28 21:11:54 2010 +0530
@@ -28,10 +28,10 @@
 // -----------------------------------------------------------------------------
 // NewLC
 // -----------------------------------------------------------------------------
-EXPORT_C CGlxHdmiController* CGlxHdmiController::NewL()
+EXPORT_C CGlxHdmiController* CGlxHdmiController::NewL(TBool aEfectsOn)
     {
     TRACER("CGlxHdmiController* CGlxHdmiController::NewL()");
-    CGlxHdmiController* self = new (ELeave) CGlxHdmiController();
+    CGlxHdmiController* self = new (ELeave) CGlxHdmiController(aEfectsOn);
     CleanupStack::PushL(self);
     self->ConstructL();
     CleanupStack::Pop(self);
@@ -167,12 +167,26 @@
         }
     }
 
+
+// -----------------------------------------------------------------------------
+// FadeSurface 
+// -----------------------------------------------------------------------------
+EXPORT_C void CGlxHdmiController::FadeSurface(TBool aFadeInOut)
+    {
+    TRACER("CGlxHdmiController::FadeSurface()");
+    if (iSurfaceUpdater)
+        {
+        iSurfaceUpdater->FadeTheSurface(aFadeInOut);
+        }
+    }
+
 // -----------------------------------------------------------------------------
 // Constructor
 // -----------------------------------------------------------------------------
-CGlxHdmiController::CGlxHdmiController():
+CGlxHdmiController::CGlxHdmiController(TBool aEffectsOn):
             iFsBitmap(NULL),
-            iStoredImagePath(NULL)
+            iStoredImagePath(NULL),
+            iEffectsOn(aEffectsOn)
     {
     TRACER("CGlxHdmiController::CGlxHdmiController()");
     // Implement nothing here
@@ -229,9 +243,9 @@
 void CGlxHdmiController::CreateSurfaceUpdaterL(const TDesC& aImageFile)
     {
     TRACER("CGlxHdmiController::CreateSurfaceUpdater()");
-    RWindow* window = iHdmiContainer->GetWindow();
-    iSurfaceUpdater = CGlxHdmiSurfaceUpdater::NewL(window, aImageFile, iFsBitmap,
-                                                    iHdmiContainer);
+    iSurfaceUpdater = CGlxHdmiSurfaceUpdater::NewL(iHdmiContainer->GetWindow(), 
+                                                aImageFile, iFsBitmap,iHdmiContainer,
+                                                iEffectsOn);
     iHdmiContainer->DrawNow();
     }
 
--- a/tvout/tvoutengine/src/glxhdmisurfaceupdater.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/src/glxhdmisurfaceupdater.cpp	Fri May 28 21:11:54 2010 +0530
@@ -18,8 +18,10 @@
 #include <graphics/surface.h>
 #include <graphics/surfacemanager.h>
 #include <graphics/surfaceupdateclient.h>
+#include <graphics/surface_hints.h>
 #include <e32math.h>
 #include <apgcli.h>
+#include "alf/alfcompositionclient.h" 
 
 #include <imageconversion.h> 
 #include <fbs.h>
@@ -33,11 +35,19 @@
 
 const TInt KMulFactorToCreateBitmap = 4;
 const TInt KZoomDelay = 10000;
+const TInt KAnimationTicker = 26000;
+const TInt KAnimationTickerFadeIn = 45000; 
 //100 , is decide for 20 steps of zooming , with each step being 5 pixels.
 const TInt KMaxZoomLimit = 100;
 //evey time we zoom , there is a increase in the ht amd width by 10 pixels.
 const TInt KSingleStepForZoom = 10;
 
+// constants for fade effect
+const TInt KFadeSteps = 19;
+const TReal32 KFadeEachStep = 0.05f;
+const TReal32 KFullTransparent = 0.0f;
+const TReal32 KFullOpaque = 1.0f;
+
 _LIT(KMimeJpeg,"image/jpeg");
 _LIT(KMimeJpg,"image/jpg");
 
@@ -46,10 +56,11 @@
 // -----------------------------------------------------------------------------
 CGlxHdmiSurfaceUpdater* CGlxHdmiSurfaceUpdater::NewL(RWindow* aWindow, const TDesC& aImageFile, 
                                                       CFbsBitmap* aFsBitmap, 
-                                                      MGlxGenCallback* aCallBack)
+                                                      MGlxGenCallback* aCallBack,
+                                                      TBool aEffectsOn)
     {
     TRACER("CGlxHdmiSurfaceUpdater* CGlxHdmiSurfaceUpdater::NewL()");
-    CGlxHdmiSurfaceUpdater* self = new (ELeave) CGlxHdmiSurfaceUpdater(aWindow, aCallBack);
+    CGlxHdmiSurfaceUpdater* self = new (ELeave) CGlxHdmiSurfaceUpdater(aWindow, aCallBack, aEffectsOn);
     CleanupStack::PushL(self);
     self->ConstructL(aFsBitmap,aImageFile);
     CleanupStack::Pop(self);
@@ -63,6 +74,13 @@
     {
     TRACER("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater()");
     ReleaseContent();
+    if(iAnimTimer && iAnimTimer->IsActive())             // Check for a CPeriodic Instance
+        {
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater() - cancel iAnimTimer");
+        iAnimTimer->Cancel();
+        }
+    GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater() - deleteing ialfCompositionSurface");
+    delete ialfCompositionSurface;
     if(iWindow)
         {
         iWindow->RemoveBackgroundSurface(ETrue);
@@ -72,11 +90,7 @@
         iTimer->Cancel();
         }
     delete iTimer;   
-    if (iGlxDecoderAO)
-        {
-        delete iGlxDecoderAO;
-        }        
-    iGlxDecoderAO = NULL;
+    delete iGlxDecoderAO;
     iFsSession.Close();
     if (iSurfManager)
         {
@@ -151,9 +165,11 @@
 // CTor 
 // -----------------------------------------------------------------------------
 CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater(RWindow* aWindow,
-                          MGlxGenCallback* aCallBack): 
+                          MGlxGenCallback* aCallBack,TBool aEffectsOn): 
                           iWindow(aWindow), iCallBack(aCallBack), 
-                          iShwFsThumbnail(ETrue), iIsNonJpeg(EFalse)
+                          iEffectsOn(aEffectsOn),
+                          iShwFsThumbnail(ETrue), iIsNonJpeg(EFalse),
+                          iAnimCounter(0)
     {
     TRACER("CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater()");
     // Implement nothing here
@@ -167,7 +183,12 @@
     TRACER("CGlxHdmiSurfaceUpdater::ConstructL()");
     // Initiate the HDMI by assigning the necessary values
     InitiateHdmiL(aFsBitmap,aImageFile);
-    
+    if (iEffectsOn)
+        {
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ConstructL() Creating iAnimTimer");
+        iAnimTimer = CPeriodic::NewL( CActive::EPriorityStandard-1 );
+        }
+
     TInt error = iFsSession.Connect ();
     GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ConstructL() FsSession Connect error = %d", error);
     User::LeaveIfError(error);
@@ -213,7 +234,7 @@
     //Cancel the zoom timers if any
     if(iTimer->IsActive())
         {
-        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::UpdateNewImageL() - Cancel Timer");
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::UpdateNewImageL() - Cancel Zoom Timer");
         iTimer->Cancel();
         }
 
@@ -296,6 +317,15 @@
     GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::CreateSurfaceL Open Surface manager error = %d", error);
     User::LeaveIfError(error);
     
+    //Need to set the surface Hint for the surface to indicate
+    //that photos do not need overscan compensation and the image will
+    //be displayed in 720p resolution. 
+    //Refer error: HJVA-85DD25 for more info.
+    RSurfaceManager::THintPair surfHint;
+    TUid uid(KNullUid);
+    uid.iUid = surfaceHints::KSurfaceContent;
+    surfHint.Set(uid, surfaceHints::EStillImage, EFalse);
+    
     RSurfaceManager::TSurfaceCreationAttributesBuf attributes;
     attributes().iPixelFormat           = EUidPixelFormatARGB_8888;// EUidPixelFormatYUV_420Planar;
     attributes().iSize                  = iTvScreenSize;
@@ -305,7 +335,9 @@
     attributes().iAlignment             = KMulFactorToCreateBitmap;
     attributes().iContiguous            = EFalse;
     attributes().iMappable              = ETrue;
-        
+    attributes().iSurfaceHints          = &surfHint;
+    attributes().iHintCount             = 1;
+            
     error = iSurfManager->CreateSurface(attributes, iSurfId);
     GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::CreateSurfaceL, Creating surface error : %d",error);
     if(error == KErrNoMemory)
@@ -720,7 +752,24 @@
 void CGlxHdmiSurfaceUpdater::ShiftToCloningMode()
 	{
 	TRACER("CGlxHdmiSurfaceUpdater::ShiftToCloningMode()");
-	iWindow->RemoveBackgroundSurface(ETrue);
+	if (iAnimTimer)
+	    {
+	    GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ShiftToCloningMode() - cancel iAnimTimer");
+	    iAnimTimer->Cancel();
+	    delete iAnimTimer;
+	    iAnimTimer = NULL;
+	    }
+	if (ialfCompositionSurface)
+	    {
+	    GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ShiftToCloningMode() - deleteing ialfCompositionSurface");
+	    delete ialfCompositionSurface;
+	    ialfCompositionSurface= NULL;
+	    }
+    if (iWindow)
+        {
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ShiftToCloningMode() - window present");
+        iWindow->RemoveBackgroundSurface(ETrue);
+        }
 	}
 	
 // -----------------------------------------------------------------------------
@@ -729,6 +778,11 @@
 void CGlxHdmiSurfaceUpdater::ShiftToPostingMode()
 	{
 	TRACER("CGlxHdmiSurfaceUpdater::ShiftToPostingMode()");
+    if (iEffectsOn && !iAnimTimer)
+        {
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() Creating iAnimTimer");
+        iAnimTimer = CPeriodic::NewL( CActive::EPriorityStandard-1 );
+        }
 	if(iSurfManager)
 		{
 #ifdef _DEBUG
@@ -762,6 +816,18 @@
     ProcessTvImage();
     // set the surface onto background
     iWindow->SetBackgroundSurface(iConfig, ETrue); 
+    if (iEffectsOn)
+        {
+        //Cancel the Animation timer if any
+        if(!iAnimTimer->IsActive())
+            {
+            iAnimCounter = 0;
+            GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ShowFsThumbnailL() - Cancel iAnimTimer Timer");
+            iAnimTimer->Cancel();
+            }
+
+        FadeTheSurface(ETrue);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -825,5 +891,91 @@
         }
     }
 
+// -----------------------------------------------------------------------------
+// FadeTheSurface 
+// -----------------------------------------------------------------------------
+void CGlxHdmiSurfaceUpdater::FadeTheSurface(TBool aFadeInOut)
+    {
+    TRACER("CGlxHdmiSurfaceUpdater::FadeTheSurface()");
+    iFadeIn = aFadeInOut;
+    if (iEffectsOn && !iAnimTimer)
+        {
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::FadeTheSurface() Creating iAnimTimer");
+        iAnimTimer = CPeriodic::NewL( CActive::EPriorityStandard-1 );
+        }
+    if (!ialfCompositionSurface)
+        {
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ShowFsThumbnailL() - Creating alfcompositionsurface");
+        ialfCompositionSurface = CAlfCompositionSource::NewL(*iWindow);
+        }
+    if(!iAnimTimer->IsActive())
+        {
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::FadeTheSurface() - Start Timer");
+        if (iFadeIn)
+            iAnimTimer->Start(0,KAnimationTickerFadeIn,TCallBack( AnimationTimeOut,this ));
+        else
+            {
+            for (TInt i=0;i<=KFadeSteps;i++)
+                {
+                GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::Animate - Fading Out %d",i);
+                ialfCompositionSurface->SetOpacity(KFullOpaque -(i*KFadeEachStep));
+                User::After(KAnimationTicker);
+                }
+            }
+        }
+    else
+        {
+        iAnimCounter = 0;
+        // this case can be when fast swipe in Slideshow
+        ialfCompositionSurface->SetOpacity(KFullOpaque);       // set the opacity to maximum when fast swipe
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::FadeTheSurface() - cancel iAnimTimer");
+        iAnimTimer->Cancel();
+        }
+    }
 
+// ---------------------------------------------------------------------------
+// AnimationTimeOut
+// ---------------------------------------------------------------------------
+//  
+TInt CGlxHdmiSurfaceUpdater::AnimationTimeOut(TAny* aSelf)
+    {
+    TRACER("CGlxHdmiSurfaceUpdater::AnimationTimeOut");
+    if(aSelf)
+        {
+        CGlxHdmiSurfaceUpdater* self = static_cast <CGlxHdmiSurfaceUpdater*> (aSelf);
+        if (self)
+            {            
+            self->Animate();
+            }
+        }
+    return KErrNone;
+    }
 
+// -----------------------------------------------------------------------------
+// Animate 
+// -----------------------------------------------------------------------------
+void CGlxHdmiSurfaceUpdater::Animate()
+    {
+    TRACER("CGlxHdmiSurfaceUpdater::Animate");
+    iAnimCounter++;
+    if (!ialfCompositionSurface)
+        {
+        // createing alfcompositiosource
+        ialfCompositionSurface = CAlfCompositionSource::NewL(*iWindow);
+        }
+    if (iAnimCounter <=KFadeSteps && iFadeIn)
+        {
+        GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::Animate - iAnimCounter=%d",iAnimCounter);
+        // gaining brightness
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::Animate - Fading In");
+        ialfCompositionSurface->SetOpacity( KFullTransparent +(iAnimCounter*KFadeEachStep));
+        }
+    else
+        {
+        GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::Animate() - cancel iAnimTimer");
+        iAnimCounter = 0;
+        // end the timer , as animation of fade in/out is complete
+        iAnimTimer->Cancel();
+        }
+    }
+
--- a/tvout/tvoutengine/src/glxtv.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/src/glxtv.cpp	Fri May 28 21:11:54 2010 +0530
@@ -356,25 +356,24 @@
 // Called when TV connection state changes
 //-----------------------------------------------------------------------------
 //
-void CGlxTv::HandleTvConnectionStatusChangedL( )
+void CGlxTv::HandleTvConnectionStatusChangedL(TTvChangeType aChangeType)
     {
-    TRACER("CGlxTv::HandleTvConnectionStatusChangedL()");
+	TRACER("CGlxTv::HandleTvConnectionStatusChangedL()");
 
-    if ( iTvConnectionMonitor->IsConnected() )
-        {
-        // Start monitoring the environment for changes
-        MonitorEnvironmentL();
-        // Calculate the TV Out screen buffer
-        CalcTvScreenSzL();
-        }
-    else
-        {
-        StopMonitoringEnvironment();
-        }
-    iTvObserver.HandleTvStatusChangedL( ETvConnectionChanged );
-    }
-    
-        
+	if (iTvConnectionMonitor->IsConnected())
+		{
+		// Start monitoring the environment for changes
+		MonitorEnvironmentL();
+		// Calculate the TV Out screen buffer
+		CalcTvScreenSzL();
+		}
+	else
+		{
+		StopMonitoringEnvironment();
+		}
+	
+	iTvObserver.HandleTvStatusChangedL(aChangeType);
+	}
    
 //-----------------------------------------------------------------------------
 // Retrieve the TV display aspect ratio
--- a/tvout/tvoutengine/src/glxtvconnectionmonitor.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutengine/src/glxtvconnectionmonitor.cpp	Fri May 28 21:11:54 2010 +0530
@@ -68,7 +68,8 @@
 CGlxTvConnectionMonitor::CGlxTvConnectionMonitor(
 		MGlxTvConnectionObserver& aConnectionObserver) :
 	CActive(EPriorityStandard), iConnectionObserver(aConnectionObserver),
-			iIsTvOutConnected(EFalse), iIsHDMIConnected(EFalse)
+			iIsTvOutConnected(EFalse), iIsHDMIConnected(EFalse),
+			iIsHeadSetConnected(EFalse)
 
 	{
 	TRACER("CGlxTvConnectionMonitor");
@@ -179,17 +180,31 @@
 	TRACER("CGlxTvConnectionMonitor::IssueNotificationL");
 	TBool previousTvState = iIsTvOutConnected;
 	TBool previousHDMIState = iIsHDMIConnected;
-
+	TBool previousHeadSetState = iIsHeadSetConnected;
+	TTvChangeType changeType = EDisconnected;
+	
 	// Update the connection status
 	UpdateConnectionStatusL();
 
 	// trigger tvstatus change only when there is actually a change the in the connection and not 
 	// for spurious events
-	if (previousTvState != iIsTvOutConnected || previousHDMIState
-			!= iIsHDMIConnected)
+	if (previousTvState != iIsTvOutConnected)
+		{
+		changeType = iIsTvOutConnected == EFalse ? EDisconnected : ETvConnectionChanged;
+		GLX_LOG_INFO1("CGlxTvConnectionMonitor::IssueNotificationL - TVOut Connection Changed %d", changeType);
+		iConnectionObserver.HandleTvConnectionStatusChangedL(changeType);	
+		}
+	else if (previousHDMIState != iIsHDMIConnected)
 		{
-		GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueNotificationL - Connection Altered");
-		iConnectionObserver.HandleTvConnectionStatusChangedL();
+		changeType = iIsHDMIConnected == EFalse ? EDisconnected : ETvConnectionChanged;
+		GLX_LOG_INFO1("CGlxTvConnectionMonitor::IssueNotificationL - HDMI Connection Changed %d", changeType);
+		iConnectionObserver.HandleTvConnectionStatusChangedL(changeType);	
+		}
+	else if (previousHeadSetState != iIsHeadSetConnected)
+		{
+		changeType = iIsHeadSetConnected == EFalse ? EDisconnected : ETvConnectionChanged;
+		GLX_LOG_INFO1("CGlxTvConnectionMonitor::IssueNotificationL - Headset Connection Changed %d", changeType);
+		iConnectionObserver.HandleTvConnectionStatusChangedL(changeType);	
 		}
 	}
 
@@ -201,12 +216,13 @@
     {
     TRACER("CGlxTvConnectionMonitor::UpdateConnectionStatusL()");
 
-    GLX_LOG_INFO2("CGlxTvConnectionMonitor::UpdateConnectionStatusL previousTvState = %d , previousHDMIState = %d",
-            iIsTvOutConnected,iIsHDMIConnected);
+    GLX_LOG_INFO3("CGlxTvConnectionMonitor::UpdateConnectionStatusL previousTvState = %d , previousHDMIState = %d iIsHeadSetConnected=%d",
+            iIsTvOutConnected,iIsHDMIConnected,iIsHeadSetConnected);
 
     // reset the states
     iIsHDMIConnected = EFalse;
     iIsTvOutConnected = EFalse;
+    iIsHeadSetConnected = EFalse;
 
     //gets the TV status in to the iCurrentAccArray and haves the Latest Accesory in 0-index
     User::LeaveIfError(iTvAccCon.GetAccessoryConnectionStatus(iCurrentAccArray));
@@ -257,9 +273,15 @@
                     }
                 }
             }
-        }
+		else if (genId.DeviceTypeCaps(KDTHeadset)
+				&& genId.PhysicalConnectionCaps(KPCWired))
+			{
+			GLX_LOG_INFO("CGlxTvConnectionMonitor::UpdateConnectionStatusL HeadSet connect");
+			iIsHeadSetConnected = ETrue;
+			}
+		}
     CleanupStack::PopAndDestroy(nameArray);
 
-    GLX_LOG_INFO2("CGlxTvConnectionMonitor::UpdateConnectionStatusL CurrentTvState = %d , CurrentHDMIState = %d",
-            iIsTvOutConnected,iIsHDMIConnected);
+    GLX_LOG_INFO3("CGlxTvConnectionMonitor::UpdateConnectionStatusL CurrentTvState = %d , CurrentHDMIState = %d, iIsHeadSetConnected=%d",
+            iIsTvOutConnected,iIsHDMIConnected,iIsHeadSetConnected);
     }
--- a/tvout/tvoutwrapper/inc/glxtvoutwrapper.h	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutwrapper/inc/glxtvoutwrapper.h	Fri May 28 21:11:54 2010 +0530
@@ -47,7 +47,7 @@
      * This also creates the private instance of the wrapper
      * to pass the model 
      */
-    void setModel(QAbstractItemModel* aModel);
+    void setModel(QAbstractItemModel* aModel,bool aEfectsOn = false);
     
     /*
      * Set the image on to HDMI
@@ -84,6 +84,14 @@
      * Note : This function is not required if bounce back effect finishes automatically
      */
     void deactivateZoom();
+    
+    /*
+     * Fadeing of the Surface
+     * @param1 ETrue - FadeIn ( as in gaining brightness )
+     *         EFalse - FadeOut ( as in loosing brightness ) 
+     */
+    void fadeSurface(bool aFadeInOut);
+    
 private:
     GlxTvOutWrapperPrivate* mTvOutWrapperPrivate;
 };
--- a/tvout/tvoutwrapper/inc/glxtvoutwrapper_p.h	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutwrapper/inc/glxtvoutwrapper_p.h	Fri May 28 21:11:54 2010 +0530
@@ -27,16 +27,17 @@
 class CGlxHdmiController;
 
 // Converting the QVariant to CFbsBitmap*
-Q_DECLARE_METATYPE(CFbsBitmap*);
+Q_DECLARE_METATYPE(CFbsBitmap*)
 
 class GlxTvOutWrapperPrivate
     {
 public:
     /*
      * Static method to create an instance
+     * @param3 - to On the Effects of Slideshow - currently only fade in fade out
      */
     static GlxTvOutWrapperPrivate* Instance(GlxTvOutWrapper* aTvOutWrapper,
-            QAbstractItemModel* aModel);
+            QAbstractItemModel* aModel,bool aEfectsOn);
 
     /*
      * destructor
@@ -81,6 +82,14 @@
      * Deactivate zoom in posting mode.
      */
     void DeactivateZoom();
+    
+    /*
+     * Fadeing of the Surface
+     * @param1 ETrue - FadeIn ( as in gaining brightness )
+     *         EFalse - FadeOut ( as in loosing brightness ) 
+     */
+    void FadeSurface(bool aFadeInOut);
+
 private:
     /*
      * constructor
@@ -90,8 +99,9 @@
     
     /*
      * constructL()
+     * @param1 - to On the Effects of Slideshow - currently only fade in fade out
      */
-    void ConstructL();
+    void ConstructL(bool aEfectsOn);
     
     /*
      * SetNewImage
--- a/tvout/tvoutwrapper/src/glxtvoutwrapper.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutwrapper/src/glxtvoutwrapper.cpp	Fri May 28 21:11:54 2010 +0530
@@ -43,11 +43,11 @@
 // setModel 
 // and Create the private instance to pass the model
 // -----------------------------------------------------------------------------
-void GlxTvOutWrapper::setModel(QAbstractItemModel* aModel)
+void GlxTvOutWrapper::setModel(QAbstractItemModel* aModel,bool aEfectsOn)
     {
     if (!mTvOutWrapperPrivate)
         {
-        mTvOutWrapperPrivate = GlxTvOutWrapperPrivate::Instance(this,aModel);
+        mTvOutWrapperPrivate = GlxTvOutWrapperPrivate::Instance(this,aModel,aEfectsOn);
         }
     else
         {
@@ -115,4 +115,14 @@
         }
     }
 
+// -----------------------------------------------------------------------------
+// deactivateZoom 
+// -----------------------------------------------------------------------------
+void GlxTvOutWrapper::fadeSurface(bool aFadeInOut)
+    {
+    if(mTvOutWrapperPrivate){
+        mTvOutWrapperPrivate->FadeSurface(aFadeInOut);
+        }
+    }
+
 // End of file
--- a/tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp	Fri May 28 21:11:54 2010 +0530
@@ -29,12 +29,12 @@
 // Static method to create the private wrapper instance 
 // -----------------------------------------------------------------------------
 GlxTvOutWrapperPrivate* GlxTvOutWrapperPrivate::Instance(GlxTvOutWrapper* aTvOutWrapper,
-        QAbstractItemModel* aModel)
+        QAbstractItemModel* aModel,bool aEfectsOn)
     {
     TRACER("GlxTvOutWrapperPrivate::Instance()");
     GlxTvOutWrapperPrivate* self = new GlxTvOutWrapperPrivate(aTvOutWrapper,aModel);
     if (self){
-        TRAPD(err,self->ConstructL());
+        TRAPD(err,self->ConstructL(aEfectsOn));
         if(err != KErrNone){
             delete self;
             self = NULL;
@@ -47,12 +47,12 @@
 // ConstructL
 // This creates the Connection observer and the Hdmi Controller
 // -----------------------------------------------------------------------------
-void GlxTvOutWrapperPrivate::ConstructL()
+void GlxTvOutWrapperPrivate::ConstructL(bool aEfectsOn)
     {
     TRACER("GlxTvOutWrapperPrivate::ConstructL()");
     iConnectionObserver = CGlxConnectionObserver::NewL(this);
     if (!iHdmiController) {
-        iHdmiController = CGlxHdmiController::NewL();
+        iHdmiController = CGlxHdmiController::NewL(aEfectsOn);
         iHdmiConnected = iConnectionObserver->IsHdmiConnected();
         }
     }
@@ -181,7 +181,14 @@
     {
     TRACER("GlxTvOutWrapperPrivate::SetToNativeMode()");
     iIsPhotosInForeground = true;
-    if(iHdmiController && iHdmiConnected){
+    
+    if(iHdmiController && iHdmiConnected) {
+    if (!isImageSetToHdmi){
+    }
+    SetNewImage(); // this case can occur when FS image is opened and set to background
+                   // HDMI cable connected and then FS is brought to foreground
+    }
+    else{
     iHdmiController->ShiftToPostingMode();
     }
     }
@@ -218,6 +225,16 @@
     }
 
 // -----------------------------------------------------------------------------
+// FadeSurface 
+// -----------------------------------------------------------------------------
+void GlxTvOutWrapperPrivate::FadeSurface(bool aFadeInOut)
+    {
+    if(iHdmiController && iHdmiConnected){
+    iHdmiController->FadeSurface(aFadeInOut);
+    }
+    }
+
+// -----------------------------------------------------------------------------
 // getSubState 
 // -----------------------------------------------------------------------------
 int GlxTvOutWrapperPrivate::getSubState()
--- a/ui/bwins/glxviewsu.def	Mon May 17 13:35:26 2010 +0530
+++ b/ui/bwins/glxviewsu.def	Fri May 28 21:11:54 2010 +0530
@@ -1,37 +1,3 @@
 EXPORTS
-	?qt_metacast@GlxSlideShowEffectEngine@@UAEPAXPBD@Z @ 1 NONAME ; void * GlxSlideShowEffectEngine::qt_metacast(char const *)
-	?deRegisterEffect@GlxSlideShowEffectEngine@@QAEXABVQString@@@Z @ 2 NONAME ; void GlxSlideShowEffectEngine::deRegisterEffect(class QString const &)
-	?transitionEffectFinished@GlxSlideShowEffectEngine@@QAEXABUEffectStatus@HbEffect@@@Z @ 3 NONAME ; void GlxSlideShowEffectEngine::transitionEffectFinished(struct HbEffect::EffectStatus const &)
-	?cancelEffect@GlxSlideShowEffectEngine@@QAEXAAV?$QList@PAVQGraphicsItem@@@@W4GlxEffect@@@Z @ 4 NONAME ; void GlxSlideShowEffectEngine::cancelEffect(class QList<class QGraphicsItem *> &, enum GlxEffect)
-	?initTransitionEffect@GlxSlideShowEffectEngine@@AAEXXZ @ 5 NONAME ; void GlxSlideShowEffectEngine::initTransitionEffect(void)
-	?slideShowEffectFinished@GlxSlideShowEffectEngine@@QAEXABUEffectStatus@HbEffect@@@Z @ 6 NONAME ; void GlxSlideShowEffectEngine::slideShowEffectFinished(struct HbEffect::EffectStatus const &)
-	?tr@GlxSlideShowEffectEngine@@SA?AVQString@@PBD0H@Z @ 7 NONAME ; class QString GlxSlideShowEffectEngine::tr(char const *, char const *, int)
-	?slideDelayTime@GlxSlideShowEffectEngine@@QAEHXZ @ 8 NONAME ; int GlxSlideShowEffectEngine::slideDelayTime(void)
-	?registerTransitionEffect@GlxSlideShowEffectEngine@@QAEXXZ @ 9 NONAME ; void GlxSlideShowEffectEngine::registerTransitionEffect(void)
-	?staticMetaObject@GlxSlideShowEffectEngine@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const GlxSlideShowEffectEngine::staticMetaObject
-	??_EGlxSlideShowEffectEngine@@UAE@I@Z @ 11 NONAME ; GlxSlideShowEffectEngine::~GlxSlideShowEffectEngine(unsigned int)
-	?trUtf8@GlxSlideShowEffectEngine@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString GlxSlideShowEffectEngine::trUtf8(char const *, char const *, int)
-	?createView@GlxViewsFactory@@SAPAVGlxView@@HPAVHbMainWindow@@@Z @ 13 NONAME ; class GlxView * GlxViewsFactory::createView(int, class HbMainWindow *)
-	?trUtf8@GlxSlideShowEffectEngine@@SA?AVQString@@PBD0@Z @ 14 NONAME ; class QString GlxSlideShowEffectEngine::trUtf8(char const *, char const *)
-	??1GlxSlideShowEffectEngine@@UAE@XZ @ 15 NONAME ; GlxSlideShowEffectEngine::~GlxSlideShowEffectEngine(void)
-	?cleanTransitionEfffect@GlxSlideShowEffectEngine@@AAEXXZ @ 16 NONAME ; void GlxSlideShowEffectEngine::cleanTransitionEfffect(void)
-	?runEffect@GlxSlideShowEffectEngine@@QAEXPAVQGraphicsItem@@ABVQString@@@Z @ 17 NONAME ; void GlxSlideShowEffectEngine::runEffect(class QGraphicsItem *, class QString const &)
-	?tr@GlxSlideShowEffectEngine@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString GlxSlideShowEffectEngine::tr(char const *, char const *)
-	?getStaticMetaObject@GlxSlideShowEffectEngine@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & GlxSlideShowEffectEngine::getStaticMetaObject(void)
-	?qt_metacall@GlxSlideShowEffectEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 20 NONAME ; int GlxSlideShowEffectEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?isEffectRuning@GlxSlideShowEffectEngine@@QAE_NPAVQGraphicsItem@@@Z @ 21 NONAME ; bool GlxSlideShowEffectEngine::isEffectRuning(class QGraphicsItem *)
-	??0GlxSlideShowEffectEngine@@QAE@XZ @ 22 NONAME ; GlxSlideShowEffectEngine::GlxSlideShowEffectEngine(void)
-	?runEffect@GlxSlideShowEffectEngine@@QAEXAAV?$QList@PAVQGraphicsItem@@@@ABVQString@@@Z @ 23 NONAME ; void GlxSlideShowEffectEngine::runEffect(class QList<class QGraphicsItem *> &, class QString const &)
-	?readSetting@GlxSlideShowEffectEngine@@QAEXXZ @ 24 NONAME ; void GlxSlideShowEffectEngine::readSetting(void)
-	?effectPluginResolver@GlxSlideShowEffectEngine@@AAEXXZ @ 25 NONAME ; void GlxSlideShowEffectEngine::effectPluginResolver(void)
-	?slideShowMoveDir@GlxSlideShowEffectEngine@@QAE?AW4GlxSlideShowMoveDir@@XZ @ 26 NONAME ; enum GlxSlideShowMoveDir GlxSlideShowEffectEngine::slideShowMoveDir(void)
-	?metaObject@GlxSlideShowEffectEngine@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * GlxSlideShowEffectEngine::metaObject(void) const
-	?runEffect@GlxSlideShowEffectEngine@@QAEXAAV?$QList@PAVQGraphicsItem@@@@W4GlxEffect@@@Z @ 28 NONAME ; void GlxSlideShowEffectEngine::runEffect(class QList<class QGraphicsItem *> &, enum GlxEffect)
-	?cancelEffect@GlxSlideShowEffectEngine@@QAEXPAVQGraphicsItem@@@Z @ 29 NONAME ; void GlxSlideShowEffectEngine::cancelEffect(class QGraphicsItem *)
-	?setEffect@GlxSlideShowEffectEngine@@QAEXW4GlxEffect@@@Z @ 30 NONAME ; void GlxSlideShowEffectEngine::setEffect(enum GlxEffect)
-	?effectFinished@GlxSlideShowEffectEngine@@IAEXXZ @ 31 NONAME ; void GlxSlideShowEffectEngine::effectFinished(void)
-	?isEffectRuning@GlxSlideShowEffectEngine@@QAE_NABV?$QList@PAVQGraphicsItem@@@@@Z @ 32 NONAME ; bool GlxSlideShowEffectEngine::isEffectRuning(class QList<class QGraphicsItem *> const &)
-	?registerEffect@GlxSlideShowEffectEngine@@QAEXABVQString@@@Z @ 33 NONAME ; void GlxSlideShowEffectEngine::registerEffect(class QString const &)
-	?cancelEffect@GlxSlideShowEffectEngine@@QAEXABV?$QList@PAVQGraphicsItem@@@@@Z @ 34 NONAME ; void GlxSlideShowEffectEngine::cancelEffect(class QList<class QGraphicsItem *> const &)
-	?deregistertransitionEffect@GlxSlideShowEffectEngine@@QAEXXZ @ 35 NONAME ; void GlxSlideShowEffectEngine::deregistertransitionEffect(void)
+	?createView@GlxViewsFactory@@SAPAVGlxView@@HPAVHbMainWindow@@@Z @ 1 NONAME ; class GlxView * GlxViewsFactory::createView(int, class HbMainWindow *)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/bwins/glxviewutilitiesu.def	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,36 @@
+EXPORTS
+	??0GlxSettingInterface@@IAE@XZ @ 1 NONAME ; GlxSettingInterface::GlxSettingInterface(void)
+	?initTransitionEffect@GlxEffectEngine@@AAEXXZ @ 2 NONAME ; void GlxEffectEngine::initTransitionEffect(void)
+	?transitionEffectFinished@GlxEffectEngine@@QAEXABUEffectStatus@HbEffect@@@Z @ 3 NONAME ; void GlxEffectEngine::transitionEffectFinished(struct HbEffect::EffectStatus const &)
+	?metaObject@GlxEffectEngine@@UBEPBUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const * GlxEffectEngine::metaObject(void) const
+	??1GlxEffectEngine@@UAE@XZ @ 5 NONAME ; GlxEffectEngine::~GlxEffectEngine(void)
+	??_EGlxEffectEngine@@UAE@I@Z @ 6 NONAME ; GlxEffectEngine::~GlxEffectEngine(unsigned int)
+	?qt_metacast@GlxEffectEngine@@UAEPAXPBD@Z @ 7 NONAME ; void * GlxEffectEngine::qt_metacast(char const *)
+	?isEffectRuning@GlxEffectEngine@@QAE_NABV?$QList@PAVQGraphicsItem@@@@@Z @ 8 NONAME ; bool GlxEffectEngine::isEffectRuning(class QList<class QGraphicsItem *> const &)
+	?getStaticMetaObject@GlxEffectEngine@@SAABUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const & GlxEffectEngine::getStaticMetaObject(void)
+	?staticMetaObject@GlxEffectEngine@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const GlxEffectEngine::staticMetaObject
+	?registerTransitionEffect@GlxEffectEngine@@QAEXXZ @ 11 NONAME ; void GlxEffectEngine::registerTransitionEffect(void)
+	?cleanTransitionEfffect@GlxEffectEngine@@AAEXXZ @ 12 NONAME ; void GlxEffectEngine::cleanTransitionEfffect(void)
+	?deregistertransitionEffect@GlxEffectEngine@@QAEXXZ @ 13 NONAME ; void GlxEffectEngine::deregistertransitionEffect(void)
+	?instance@GlxSettingInterface@@SAPAV1@XZ @ 14 NONAME ; class GlxSettingInterface * GlxSettingInterface::instance(void)
+	?trUtf8@GlxEffectEngine@@SA?AVQString@@PBD0H@Z @ 15 NONAME ; class QString GlxEffectEngine::trUtf8(char const *, char const *, int)
+	?effectFinished@GlxEffectEngine@@IAEXXZ @ 16 NONAME ; void GlxEffectEngine::effectFinished(void)
+	??0GlxEffectEngine@@QAE@XZ @ 17 NONAME ; GlxEffectEngine::GlxEffectEngine(void)
+	?runEffect@GlxEffectEngine@@QAEXAAV?$QList@PAVQGraphicsItem@@@@W4GlxEffect@@@Z @ 18 NONAME ; void GlxEffectEngine::runEffect(class QList<class QGraphicsItem *> &, enum GlxEffect)
+	??_EGlxSettingInterface@@UAE@I@Z @ 19 NONAME ; GlxSettingInterface::~GlxSettingInterface(unsigned int)
+	?deRegisterEffect@GlxEffectEngine@@QAEXABVQString@@@Z @ 20 NONAME ; void GlxEffectEngine::deRegisterEffect(class QString const &)
+	?runEffect@GlxEffectEngine@@QAEXAAV?$QList@PAVQGraphicsItem@@@@ABVQString@@@Z @ 21 NONAME ; void GlxEffectEngine::runEffect(class QList<class QGraphicsItem *> &, class QString const &)
+	?trUtf8@GlxEffectEngine@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString GlxEffectEngine::trUtf8(char const *, char const *)
+	??0GlxSettingInterface@@IAE@AAV0@@Z @ 23 NONAME ; GlxSettingInterface::GlxSettingInterface(class GlxSettingInterface &)
+	?cancelEffect@GlxEffectEngine@@QAEXAAV?$QList@PAVQGraphicsItem@@@@W4GlxEffect@@@Z @ 24 NONAME ; void GlxEffectEngine::cancelEffect(class QList<class QGraphicsItem *> &, enum GlxEffect)
+	?tr@GlxEffectEngine@@SA?AVQString@@PBD0@Z @ 25 NONAME ; class QString GlxEffectEngine::tr(char const *, char const *)
+	?isEffectRuning@GlxEffectEngine@@QAE_NPAVQGraphicsItem@@@Z @ 26 NONAME ; bool GlxEffectEngine::isEffectRuning(class QGraphicsItem *)
+	?qt_metacall@GlxEffectEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 27 NONAME ; int GlxEffectEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?runEffect@GlxEffectEngine@@QAEXPAVQGraphicsItem@@ABVQString@@@Z @ 28 NONAME ; void GlxEffectEngine::runEffect(class QGraphicsItem *, class QString const &)
+	?slideShowEffectFinished@GlxEffectEngine@@QAEXABUEffectStatus@HbEffect@@@Z @ 29 NONAME ; void GlxEffectEngine::slideShowEffectFinished(struct HbEffect::EffectStatus const &)
+	?registerEffect@GlxEffectEngine@@QAEXABVQString@@@Z @ 30 NONAME ; void GlxEffectEngine::registerEffect(class QString const &)
+	?cancelEffect@GlxEffectEngine@@QAEXABV?$QList@PAVQGraphicsItem@@@@@Z @ 31 NONAME ; void GlxEffectEngine::cancelEffect(class QList<class QGraphicsItem *> const &)
+	?tr@GlxEffectEngine@@SA?AVQString@@PBD0H@Z @ 32 NONAME ; class QString GlxEffectEngine::tr(char const *, char const *, int)
+	??1GlxSettingInterface@@MAE@XZ @ 33 NONAME ; GlxSettingInterface::~GlxSettingInterface(void)
+	?cancelEffect@GlxEffectEngine@@QAEXPAVQGraphicsItem@@@Z @ 34 NONAME ; void GlxEffectEngine::cancelEffect(class QGraphicsItem *)
+
--- a/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp	Fri May 28 21:11:54 2010 +0530
@@ -36,23 +36,23 @@
 
 void GlxCommandHandlerSend::doHandleUserAction(GlxMediaModel* model,QList<QModelIndex> indexList) const
 {
-   QList <QVariant> fileList;
-   QString imagePath ;
+  QStringList fileList;   
+  QString imagePath ;
    //The Index list is NULL, when the item is selected to be sent from contect menu 
    // and fullscreen view,so that inturn is sending the focused item
     if(indexList.count() == 0)
         {
         imagePath = (model->data(model->index(model->data(model->index(0,0),GlxFocusIndexRole).value<int>(),0),GlxUriRole)).value<QString>();
-        fileList.append(QVariant(imagePath));
+        fileList.append(imagePath);
         }
     else
     {
     for ( int i = 0; i < indexList.count(); i++)
         {        
         imagePath = (model->data(indexList[i],GlxUriRole)).value<QString>();
-        fileList.append(QVariant(imagePath));        
+        fileList.append(imagePath);
         } 
     }                              
-    mSendUiDialog->init(fileList,true);
+    mSendUiDialog->send(fileList,true);    
 }
 
--- a/ui/eabi/glxviewsu.def	Mon May 17 13:35:26 2010 +0530
+++ b/ui/eabi/glxviewsu.def	Fri May 28 21:11:54 2010 +0530
@@ -1,33 +1,3 @@
 EXPORTS
 	_ZN15GlxViewsFactory10createViewEiP12HbMainWindow @ 1 NONAME
-	_ZN24GlxSlideShowEffectEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
-	_ZN24GlxSlideShowEffectEngine11qt_metacastEPKc @ 3 NONAME
-	_ZN24GlxSlideShowEffectEngine12cancelEffectEP13QGraphicsItem @ 4 NONAME
-	_ZN24GlxSlideShowEffectEngine12cancelEffectER5QListIP13QGraphicsItemE9GlxEffect @ 5 NONAME
-	_ZN24GlxSlideShowEffectEngine12cancelEffectERK5QListIP13QGraphicsItemE @ 6 NONAME
-	_ZN24GlxSlideShowEffectEngine14effectFinishedEv @ 7 NONAME
-	_ZN24GlxSlideShowEffectEngine14isEffectRuningEP13QGraphicsItem @ 8 NONAME
-	_ZN24GlxSlideShowEffectEngine14isEffectRuningERK5QListIP13QGraphicsItemE @ 9 NONAME
-	_ZN24GlxSlideShowEffectEngine14registerEffectERK7QString @ 10 NONAME
-	_ZN24GlxSlideShowEffectEngine16deRegisterEffectERK7QString @ 11 NONAME
-	_ZN24GlxSlideShowEffectEngine16staticMetaObjectE @ 12 NONAME DATA 16
-	_ZN24GlxSlideShowEffectEngine19getStaticMetaObjectEv @ 13 NONAME
-	_ZN24GlxSlideShowEffectEngine20effectPluginResolverEv @ 14 NONAME
-	_ZN24GlxSlideShowEffectEngine20initTransitionEffectEv @ 15 NONAME
-	_ZN24GlxSlideShowEffectEngine22cleanTransitionEfffectEv @ 16 NONAME
-	_ZN24GlxSlideShowEffectEngine23slideShowEffectFinishedERKN8HbEffect12EffectStatusE @ 17 NONAME
-	_ZN24GlxSlideShowEffectEngine24registerTransitionEffectEv @ 18 NONAME
-	_ZN24GlxSlideShowEffectEngine24transitionEffectFinishedERKN8HbEffect12EffectStatusE @ 19 NONAME
-	_ZN24GlxSlideShowEffectEngine26deregistertransitionEffectEv @ 20 NONAME
-	_ZN24GlxSlideShowEffectEngine9runEffectEP13QGraphicsItemRK7QString @ 21 NONAME
-	_ZN24GlxSlideShowEffectEngine9runEffectER5QListIP13QGraphicsItemE9GlxEffect @ 22 NONAME
-	_ZN24GlxSlideShowEffectEngine9runEffectER5QListIP13QGraphicsItemERK7QString @ 23 NONAME
-	_ZN24GlxSlideShowEffectEngineC1Ev @ 24 NONAME
-	_ZN24GlxSlideShowEffectEngineC2Ev @ 25 NONAME
-	_ZN24GlxSlideShowEffectEngineD0Ev @ 26 NONAME
-	_ZN24GlxSlideShowEffectEngineD1Ev @ 27 NONAME
-	_ZN24GlxSlideShowEffectEngineD2Ev @ 28 NONAME
-	_ZNK24GlxSlideShowEffectEngine10metaObjectEv @ 29 NONAME
-	_ZTI24GlxSlideShowEffectEngine @ 30 NONAME
-	_ZTV24GlxSlideShowEffectEngine @ 31 NONAME
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/eabi/glxviewutilitiesu.def	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,39 @@
+EXPORTS
+	_ZN15GlxEffectEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN15GlxEffectEngine11qt_metacastEPKc @ 2 NONAME
+	_ZN15GlxEffectEngine12cancelEffectEP13QGraphicsItem @ 3 NONAME
+	_ZN15GlxEffectEngine12cancelEffectER5QListIP13QGraphicsItemE9GlxEffect @ 4 NONAME
+	_ZN15GlxEffectEngine12cancelEffectERK5QListIP13QGraphicsItemE @ 5 NONAME
+	_ZN15GlxEffectEngine14effectFinishedEv @ 6 NONAME
+	_ZN15GlxEffectEngine14isEffectRuningEP13QGraphicsItem @ 7 NONAME
+	_ZN15GlxEffectEngine14isEffectRuningERK5QListIP13QGraphicsItemE @ 8 NONAME
+	_ZN15GlxEffectEngine14registerEffectERK7QString @ 9 NONAME
+	_ZN15GlxEffectEngine16deRegisterEffectERK7QString @ 10 NONAME
+	_ZN15GlxEffectEngine16staticMetaObjectE @ 11 NONAME DATA 16
+	_ZN15GlxEffectEngine19getStaticMetaObjectEv @ 12 NONAME
+	_ZN15GlxEffectEngine20initTransitionEffectEv @ 13 NONAME
+	_ZN15GlxEffectEngine22cleanTransitionEfffectEv @ 14 NONAME
+	_ZN15GlxEffectEngine23slideShowEffectFinishedERKN8HbEffect12EffectStatusE @ 15 NONAME
+	_ZN15GlxEffectEngine24registerTransitionEffectEv @ 16 NONAME
+	_ZN15GlxEffectEngine24transitionEffectFinishedERKN8HbEffect12EffectStatusE @ 17 NONAME
+	_ZN15GlxEffectEngine26deregistertransitionEffectEv @ 18 NONAME
+	_ZN15GlxEffectEngine9runEffectEP13QGraphicsItemRK7QString @ 19 NONAME
+	_ZN15GlxEffectEngine9runEffectER5QListIP13QGraphicsItemE9GlxEffect @ 20 NONAME
+	_ZN15GlxEffectEngine9runEffectER5QListIP13QGraphicsItemERK7QString @ 21 NONAME
+	_ZN15GlxEffectEngineC1Ev @ 22 NONAME
+	_ZN15GlxEffectEngineC2Ev @ 23 NONAME
+	_ZN15GlxEffectEngineD0Ev @ 24 NONAME
+	_ZN15GlxEffectEngineD1Ev @ 25 NONAME
+	_ZN15GlxEffectEngineD2Ev @ 26 NONAME
+	_ZN19GlxSettingInterface8instanceEv @ 27 NONAME
+	_ZN19GlxSettingInterfaceC2ERS_ @ 28 NONAME
+	_ZN19GlxSettingInterfaceC2Ev @ 29 NONAME
+	_ZN19GlxSettingInterfaceD0Ev @ 30 NONAME
+	_ZN19GlxSettingInterfaceD1Ev @ 31 NONAME
+	_ZN19GlxSettingInterfaceD2Ev @ 32 NONAME
+	_ZNK15GlxEffectEngine10metaObjectEv @ 33 NONAME
+	_ZTI15GlxEffectEngine @ 34 NONAME
+	_ZTI19GlxSettingInterface @ 35 NONAME
+	_ZTV15GlxEffectEngine @ 36 NONAME
+	_ZTV19GlxSettingInterface @ 37 NONAME
+
--- a/ui/inc/glxcommandhandlers.hrh	Mon May 17 13:35:26 2010 +0530
+++ b/ui/inc/glxcommandhandlers.hrh	Fri May 28 21:11:54 2010 +0530
@@ -115,6 +115,8 @@
     EGlxCmdContextSend,
     EGlxCmdContextRename,
     EGlxCmdSetupItem,
+    EGlxCmdAppBackground,    //when application goes into background
+    EGlxCmdAppForeground,    //when application comes into foreground
     EGlxCmdAiwBase = 0x6000
     };
 
--- a/ui/inc/glxuistd.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/inc/glxuistd.h	Fri May 28 21:11:54 2010 +0530
@@ -56,7 +56,7 @@
 typedef enum
 {
     NO_EFFECT,
-    WAVE_EFFECT,
+    FLIP_EFFECT,
     SMOOTH_FADE,
     ZOOM_TO_FACE,
     TRANSITION_EFFECT,
--- a/ui/ui.pro	Mon May 17 13:35:26 2010 +0530
+++ b/ui/ui.pro	Fri May 28 21:11:54 2010 +0530
@@ -18,6 +18,8 @@
 CONFIG += ordered
 SUBDIRS	    = uiengine \
               commandhandlers \
+              viewutilities \
+              widgets \
               views \
               viewmanagement \
 #	      viewplugins
--- a/ui/uiengine/medialistwrapper/inc/glxmlwrapper_p.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/uiengine/medialistwrapper/inc/glxmlwrapper_p.h	Fri May 28 21:11:54 2010 +0530
@@ -26,7 +26,7 @@
 #include <qdatetime.h>
 #include "glxmedialistiterator.h"
 #include "glxmlwrapper.h"
-#include <qimage>
+#include <QImage>
 #include "mglxtitlefetcherobserver.h"
 
 //Forward Declarations
--- a/ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp	Fri May 28 21:11:54 2010 +0530
@@ -891,9 +891,22 @@
     {
     GLX_LOG_INFO1("GlxMLWrapperPrivate::RetrieveBitmap %d",aItemIndex);
     const TGlxMedia& item = iMediaList->Item( aItemIndex );
+    TInt height =KFullScreenTNPTWidth; // default as portrait
+    TInt width =KFullScreenTNPTHeight;
+    if (iPtFsContextActivated )
+        {
+        GLX_LOG_INFO("GlxMLWrapperPrivate::RetrieveBitmap - CGlxHdmi :PT");
+        width = KFullScreenTNPTWidth;
+        height = KFullScreenTNPTHeight;
+        }
+    else if (iLsFsContextActivated)
+        {
+        GLX_LOG_INFO("GlxMLWrapperPrivate::RetrieveBitmap - CGlxHdmi :LS");
+        width = KFullScreenTNLSWidth;
+        height = KFullScreenTNLSHeight;
+        }
     TMPXAttribute fsTnAttrib= TMPXAttribute(KGlxMediaIdThumbnail,
-                GlxFullThumbnailAttributeId(ETrue, KFullScreenTNPTWidth,
-                        KFullScreenTNPTHeight));
+                GlxFullThumbnailAttributeId(ETrue, width, height));
     const CGlxThumbnailAttribute* fsTnValue = item.ThumbnailAttribute(
             fsTnAttrib);
     if (fsTnValue)
--- a/ui/uiengine/model/mediamodel/src/glxmediamodel.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/uiengine/model/mediamodel/src/glxmediamodel.cpp	Fri May 28 21:11:54 2010 +0530
@@ -83,7 +83,7 @@
 	clearExternalItems();
 	err1 = HAL::Get( HALData::EMemoryRAMFree, freeMemory );
 	qDebug("####mediaModel : Memory available after cache cleanup  = %d and error is = %d ", freeMemory , err1 );
-    int err = disconnect(mMLWrapper, SIGNAL(updateIcon(int, HbIcon*)), this, SLOT(itemUpdated1(int, HbIcon*)));
+    int err = disconnect(mMLWrapper, SIGNAL(updateItem(int, GlxTBContextType)), this, SLOT(itemUpdated1(int, GlxTBContextType)));
 	err = disconnect(mMLWrapper, SIGNAL(itemCorrupted(int)), this, SLOT(itemCorrupted(int)));
 	err = disconnect(mMLWrapper, SIGNAL(insertItems(int, int)), this, SLOT(itemsAdded(int, int)));
 	err = disconnect(mMLWrapper, SIGNAL(removeItems(int, int)), this, SLOT(itemsRemoved(int, int)));
--- a/ui/viewmanagement/statehandler/inc/glxstatemanager.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/viewmanagement/statehandler/inc/glxstatemanager.h	Fri May 28 21:11:54 2010 +0530
@@ -135,6 +135,7 @@
     GlxActionHandler    *mActionHandler;
     GlxTNObserver       *mTNObserver;
     int                 mCollectionId;
+    bool                isProgressbarRunning;
 };
 
 
--- a/ui/viewmanagement/statehandler/inc/glxtnobserver.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/viewmanagement/statehandler/inc/glxtnobserver.h	Fri May 28 21:11:54 2010 +0530
@@ -31,14 +31,17 @@
     Q_OBJECT
     
 public:
+    
     /*
      * constructor
      */
     GlxTNObserver();
+    
     /*
      * Call back to get the number of TN is left to create.
      */
-    void updateTNCount(int &count);     
+    void updateTNCount(int &count); 
+    
     /*
      * It will return the number of TN is left to create.
      */
@@ -50,6 +53,16 @@
     void startTNObserving(); 
     
     /*
+     * To start the thumbnail generation in back ground
+     */
+    void startTNMDaemon() ;
+
+    /*
+     * To stop the thumbnail generation in back ground
+     */
+    void stopTNMDaemon() ;
+    
+    /*
      * Destructor
      */
     ~GlxTNObserver();
--- a/ui/viewmanagement/statehandler/src/glxstatemanager.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/viewmanagement/statehandler/src/glxstatemanager.cpp	Fri May 28 21:11:54 2010 +0530
@@ -53,7 +53,8 @@
       mCurrentModel( NULL ), 
       mCurrentState( NULL ), 
       mActionHandler( NULL ),
-      mTNObserver ( NULL )
+      mTNObserver ( NULL ),
+      isProgressbarRunning ( false )
 {
     qDebug("GlxStateManager::GlxStateManager");
     PERFORMANCE_ADV ( d1, "view manager creation time") {
@@ -108,6 +109,7 @@
     if ( mTNObserver->getTNLeftCount() > 0 ) {
         mViewManager->launchApplication( GLX_GRIDVIEW_ID, mCurrentModel);
         mViewManager->launchProgressDialog( mTNObserver->getTNLeftCount() );
+		isProgressbarRunning = true ;
     }
     else {
         createModel( GLX_GRIDVIEW_ID );
@@ -148,19 +150,26 @@
 }
 
 void GlxStateManager::updateTNProgress( int count)
-{
-    if (  mCurrentState->id() != GLX_GRIDVIEW_ID  && count > 0) {
+{    
+    // this is case when progress bar is not showing
+    // in the case of rename of an image or capture the single item
+    // it is also launching the progress bar, to avoid this scenario add the check of count more than 5
+    if ( mCurrentModel && count > 5 ) { 
          goBack( GLX_GRIDVIEW_ID, ALL_ITEM_S ) ;
-    }
-    if ( mCurrentModel && count > 0) {
          cleanAllModel();   
          mViewManager->launchProgressDialog ( count ) ;
+         isProgressbarRunning = true ;         
     }
-    if ( count == 0 ) {
-        createModel( mCurrentState->id() );
-        mViewManager->setModel( mCurrentModel );
+    
+    if ( isProgressbarRunning ){
+        if ( count == 0 ) {
+            createModel( mCurrentState->id() );
+            mViewManager->setModel( mCurrentModel );
+            isProgressbarRunning = false;
+        }
+        
+        mViewManager->updateProgressDialog( count );
     }
-    mViewManager->updateProgressDialog( count );
 }
 
 void GlxStateManager::nextState(qint32 state, int internalState)
@@ -218,6 +227,12 @@
 void GlxStateManager::goBack(qint32 stateId, int internalState)
 {
     qDebug("GlxStateManager::goBack()");
+    
+    //if current state and it internal state is same then no need to do any thing
+    if ( mCurrentState->id() == stateId  && mCurrentState->state() == internalState ) {
+        return ;
+    }
+    
     GlxState *state = mCurrentState;
     
     while ( mCurrentState ) {
@@ -551,6 +566,18 @@
        emit setupItemsSignal();
        break;
        
+   case EGlxCmdAppBackground :
+       if ( isProgressbarRunning ){
+            mTNObserver->stopTNMDaemon();
+       }
+       break;
+ 
+   case EGlxCmdAppForeground :
+       if ( isProgressbarRunning ){
+            mTNObserver->startTNMDaemon();
+       }
+       break;
+       
     default :
         mActionHandler->handleAction(id,mCollectionId);
     	break;
--- a/ui/viewmanagement/statehandler/src/glxtnobserver.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/viewmanagement/statehandler/src/glxtnobserver.cpp	Fri May 28 21:11:54 2010 +0530
@@ -18,22 +18,27 @@
 #include <glxtnobserver.h>
 #include <e32property.h>
 
+#include "glxtracer.h"
+
 const TUid KTAGDPSNotification = { 0x2001FD51 };
 const TInt KForceBackgroundGeneration = 0x00000010;
 const TInt KItemsleft = 0x00000008;
 
 GlxTNObserver::GlxTNObserver() : mTNMonitor( NULL )
 {
+    TRACER("GlxTNObserver::GlxTNObserver() ");
     RProperty::Set( KTAGDPSNotification, KForceBackgroundGeneration, ETrue );
 }
 
 void GlxTNObserver::updateTNCount(int &count)
 {
+    TRACER("GlxTNObserver::updateTNCount() ");
     emit leftTNCount( count );
 }
 
 int GlxTNObserver::getTNLeftCount()
 {
+    TRACER("GlxTNObserver::getTNLeftCount() ");
     TInt leftVariable =  0;
     RProperty::Get( KTAGDPSNotification, KItemsleft, leftVariable );
     //To:Do error handling
@@ -42,10 +47,24 @@
 
 void GlxTNObserver::startTNObserving()
 {
+    TRACER("GlxTNObserver::startTNObserving() ");
     mTNMonitor = CGlxTNMonitor::NewL( this );
 }
 
+void GlxTNObserver::startTNMDaemon()
+{
+    TRACER("GlxTNObserver::startTNMDaemon() ");
+    RProperty::Set( KTAGDPSNotification, KForceBackgroundGeneration, ETrue );
+}
+
+void GlxTNObserver::stopTNMDaemon()
+{
+    TRACER("GlxTNObserver::stopTNMDaemon() ");
+    RProperty::Set( KTAGDPSNotification, KForceBackgroundGeneration, EFalse );
+}
+
 GlxTNObserver::~GlxTNObserver()
 {
+    TRACER("GlxTNObserver::~GlxTNObserver() ");
     delete mTNMonitor;
 }
--- a/ui/viewmanagement/viewmanager/inc/glxviewmanager.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/viewmanagement/viewmanager/inc/glxviewmanager.h	Fri May 28 21:11:54 2010 +0530
@@ -34,7 +34,7 @@
 class HbAction;
 class QItemSelectionModel;
 class HbMenu;
-class GlxSlideShowEffectEngine;
+class GlxEffectEngine;
 class HbProgressDialog;
 class GlxMainWindowEventFilter;
 
@@ -200,7 +200,7 @@
     HbMainWindow     *mMainWindow; //main window pointer, It have ownership only if 
     HbAction         *mBackAction; // For back soft key
     GlxMenuManager   *mMenuManager; //Pointer of menu manger to add the menu in the view 
-    GlxSlideShowEffectEngine *mEffectEngine; //To run the animation in between view transition
+    GlxEffectEngine  *mEffectEngine; //To run the animation in between view transition
     QList<HbAction *>  mActionList; //Tool bar action list
     QList<HbAction *>  mMarkingActionList; //marking mode tool bar action list
     HbToolBar          *mViewToolBar; //view tool bar
--- a/ui/viewmanagement/viewmanager/src/glxviewmanager.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/viewmanagement/viewmanager/src/glxviewmanager.cpp	Fri May 28 21:11:54 2010 +0530
@@ -71,9 +71,9 @@
 {
     mMenuManager = new GlxMenuManager(mMainWindow);
     addBackSoftKeyAction(); 
-    createToolBar();
+    
     addConnection();
-    mView->addToolBar(mViewToolBar);
+    
     mMenuManager->addMenu( mView->viewId(), mView->menu() );
     mMenuManager->setModel( mModel );
 }
@@ -84,6 +84,18 @@
     PERFORMANCE_ADV ( viewMgrD1, "View Creation time" ) {
         mView = resolveView(id);
     }
+    createToolBar();
+    mView->addToolBar(mViewToolBar);
+    
+    /* We are showing the toolBar before activating the 
+     * view. This is done to avoid the animation effect seen otherwise 
+     * when the tool bar comes up.
+     * 
+     * If animation Effect is not removed, it leads to flickering effect 
+     * since we are creating a new tool bar..although a fake tool bar was 
+     * already created on the splashscreen
+     * 
+     */
     mView->activate();
     
     PERFORMANCE_ADV ( viewMgrD3, "Set Model time")  
@@ -145,7 +157,7 @@
     
     //create and registered the effect
     if ( mEffectEngine == NULL ) { 
-        mEffectEngine = new GlxSlideShowEffectEngine();
+        mEffectEngine = new GlxEffectEngine();
         mEffectEngine->registerTransitionEffect();
         connect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinished() ) );
     }
--- a/ui/viewmanagement/viewmanager/viewmanager.pro	Mon May 17 13:35:26 2010 +0530
+++ b/ui/viewmanagement/viewmanager/viewmanager.pro	Fri May 28 21:11:54 2010 +0530
@@ -23,13 +23,15 @@
                  ../../views/viewbase/inc \
                  ../../views/effectengine/inc \
                  ../../../loggers/loggerqt/inc \
-                 ../../../commonutilities/externalutility/inc 
+                 ../../../commonutilities/externalutility/inc \
+                 ../../viewutilities/effectengine/inc \
         
 CONFIG += hb
 
 LIBS +=  -lglxexternalutility.dll \
          -lglxviews.dll \
-         -lglxloggerqt.dll 
+         -lglxloggerqt.dll \
+         -lglxviewutilities.dll
 
 
 DEFINES += BUILD_VIEWMANAGER
--- a/ui/views/detailsview/src/glxdetailsview.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/detailsview/src/glxdetailsview.cpp	Fri May 28 21:11:54 2010 +0530
@@ -33,7 +33,6 @@
 #include "glxviewids.h"
 #include "glxicondefs.h" //Contains the icon names/Ids
 #include "glxmodelparm.h"
-#include "glxmediamodel.h"
 #include "glxdetailsview.h"
 #include "glxfavmediamodel.h"
 #include <glxcommandhandlers.hrh>
--- a/ui/views/fullscreenview/inc/glxcoverflow.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/fullscreenview/inc/glxcoverflow.h	Fri May 28 21:11:54 2010 +0530
@@ -76,8 +76,6 @@
 
 protected slots:
     void panGesture ( const QPointF & delta )  ;
-    void leftGesture (int value);
-    void rightGesture (int value) ;
     void longPressGesture(const QPointF &point) ;
     void dataChanged(QModelIndex startIndex, QModelIndex endIndex);
     void rowsInserted(const QModelIndex &parent, int start, int end);
--- a/ui/views/fullscreenview/inc/glxzoomwidget.h	Mon May 17 13:35:26 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   glxzoomwidget.h
-*               definition of the class glxzoomwidget which controls the Zoom behavior of coverflow.
-*
-*/
-#ifndef GLXZOOMWIDGET_H
-#define GLXZOOMWIDGET_H
-
-#include <QObject>
-#include <QGraphicsWidget>
-#include <QPixmap>
-#include <hbscrollarea.h>
-
-class QGestureEvent;
-class QPinchGesture;
-class HbIconItem;
-class GlxImageDecoderWrapper;
-
-const int MAXZVALUE = 100;
-const int MINZVALUE = 0;
-
-class GlxZoomWidget : public HbScrollArea
-{
-    Q_OBJECT
-
-    public:
-    GlxZoomWidget (QGraphicsItem *parent = NULL);
-    ~GlxZoomWidget ();
-    void setModel (QAbstractItemModel *model) ;
-    void indexChanged(int index);
-    void setWindowSize(QSize windowSize);
-    void cleanUp();
-    void activate();
-
-    signals:
-    void pinchGestureReceived(int index);
-    void zoomWidgetMovedBackground(int index);
-
-    public slots:
-    //for Decoder support
-    void decodedImageAvailable();
-
-    protected:
-    bool sceneEvent(QEvent *event);
-    bool sceneEventFilter(QGraphicsItem *watched,QEvent *event);
-    protected slots:
-    void dataChanged(QModelIndex startIndex, QModelIndex endIndex);
-    void sendDecodeRequest(int index);
-
-    private:
-    bool executeGestureEvent(QGraphicsItem *source,QGestureEvent *event);
-    //Responsible for changing the transforms of the widget wrt the ZF and center
-	//Also adjusts the ZF, center and final size so as to respect the boundaries
-    void zoomImage(qreal zoomFactor, QPointF center);
-    //This API will adjust the gesture center to maintain boundaries
-	//called from GlxZoomWidget::zoomImage
-    void adjustGestureCenter(QPointF & gestureCenter, qreal& zoomFactor);
-    //this API will limit the max/min Zoom Size possible
-	//called from GlxZoomWidget::zoomImage
-    void limitRequiredSize(QSizeF &requiredSize);
-	//gets the latest focussed image from the model
-    void retreiveFocusedImage();
-    //finalize the transform and update the sizehint of mZoomWidget
-    void finalizeWidgetTransform();
-    //get the focused image from the model
-    QPixmap getFocusedImage();
-
-    //data members
-    private:
-    //view widgets
-    QGraphicsPixmapItem *mZoomItem;   //Item containing the pixmap
-    QGraphicsWidget *mZoomWidget;     //container :all scaling and transforms would be done on this widget
-    HbIconItem* mBlackBackgroundItem; //for setting black background
-
-    //to be in sync with the model
-    QAbstractItemModel *mModel;
-    int mFocusIndex;
-
-    //size parameter
-    QSizeF mItemSize;        // the actual pixmap size. Keep it updated with latest pixmap size
-    QSizeF mStepCurrentSize; //to save the size before gesture started
-    QSizeF mCurrentSize;     //save sizes scaled by gesture
-    QSize mWindowSize;      //the window size
-    QSizeF mMinScaleSize;   //minimum posible size
-    QSizeF mMinDecScaleSize;   //the Minimum scale limit after which the image scaling down should be decelerated
-    QSizeF mMaxScaleSize;   // the maximum scale limit
-    QSizeF mMaxScaleDecSize;   // the Maximum scale limit after which the image scaling should be decelerated
-
-    //for Decoder support
-    GlxImageDecoderWrapper* mImageDecoder;
-
-    //status flags
-	//To check if the decode request has already been send or not
-    bool mImageDecodeRequestSend; 
-	//To check if the pinch gesture is in progress to block any events to HbScrollArea
-    bool mPinchGestureOngoing; 
-    //to check if decoded image is available
-    bool mDecodedImageAvailable;
-
-};
-#endif  //GLXZOOMWIDGET_H
--- a/ui/views/fullscreenview/src/glxcoverflow.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/fullscreenview/src/glxcoverflow.cpp	Fri May 28 21:11:54 2010 +0530
@@ -29,8 +29,9 @@
 #include <glxcoverflow.h>
 #include "glxviewids.h"
 
-#define GLX_COVERFLOW_SPEED 60
-#define GLX_BOUNCEBACK_SPEED 15
+#define GLX_COVERFLOW_SPEED  32
+#define GLX_BOUNCEBACK_SPEED 16
+#define GLX_BOUNCEBACK_DELTA 8
 
 GlxCoverFlow::GlxCoverFlow(QGraphicsItem *parent ) 
      : HbWidget(parent), 
@@ -69,7 +70,7 @@
         mIconItem[i]->setSize(QSize(0,0));
     }
     mUiOn = FALSE;
-    mBounceBackDeltaX = 10;
+    mBounceBackDeltaX = GLX_BOUNCEBACK_DELTA;
 }
 
 void GlxCoverFlow::setItemSize(QSize &size)
@@ -105,44 +106,43 @@
 
 void GlxCoverFlow::gestureEvent(QGestureEvent *event)
 {    
- if(QTapGesture *gesture = static_cast<QTapGesture *>(event->gesture(Qt::TapGesture))) {        
+    if(QTapGesture *gesture = static_cast<QTapGesture *>(event->gesture(Qt::TapGesture))) {        
         if (gesture->state() == Qt::GestureFinished) {
-                     emit coverFlowEvent( TAP_EVENT );
-                      event->accept(gesture);
+            emit coverFlowEvent( TAP_EVENT );
+            event->accept(gesture);
+        }
+    }
+  
+    if (QPanGesture *panningGesture = qobject_cast<QPanGesture*>(event->gesture(Qt::PanGesture))) {
+        HbPanGesture *hbPanGesture = qobject_cast<HbPanGesture *>(panningGesture);
+        if (hbPanGesture) {
+            if(hbPanGesture->state() == Qt::GestureUpdated) {
+                QPointF delta(hbPanGesture->sceneDelta());
+                panGesture(delta);
+                event->accept(panningGesture);            
+            }
+            
+            if(hbPanGesture->state() == Qt::GestureFinished) {
+                switch( mMoveDir ) {
+                    case LEFT_MOVE : 
+                        mMoveDir = NO_MOVE;
+                        mBounceBackDeltaX = ( mItemSize.width() >> 2 )  + ( mItemSize.width() >> 3 );
+                        emit autoLeftMoveSignal();
+                        break ;
+                
+                    case RIGHT_MOVE :
+                        mMoveDir = NO_MOVE;
+                        mBounceBackDeltaX = ( mItemSize.width() >> 2 )  + ( mItemSize.width() >> 3 );
+                        emit autoRightMoveSignal();
+                        break;
+                
+                    default:
+                        break;
+                } 
+                event->accept(panningGesture);
             }
         }
-  
-  if (QPanGesture *panningGesture = qobject_cast<QPanGesture*>(event->gesture(Qt::PanGesture))) {
-        HbPanGesture *hbPanGesture = qobject_cast<HbPanGesture *>(panningGesture);
-         if (hbPanGesture) {
-            if(hbPanGesture->state() == Qt::GestureUpdated) {
-                 QPointF delta(hbPanGesture->sceneDelta());
-                 panGesture(delta);
-                  event->accept(panningGesture);
-
-            }
-             if(hbPanGesture->state() == Qt::GestureFinished) {
-                 switch( mMoveDir ) {
-    
-                        case LEFT_MOVE: 
-                            mMoveDir = NO_MOVE;
-                            emit autoLeftMoveSignal();
-                            break ;
-        
-                        case RIGHT_MOVE :
-                            mMoveDir = NO_MOVE;
-                            emit autoRightMoveSignal();
-                            break;
-        
-                        default:
-                            break;
-                    } 
-                  event->accept(panningGesture);
-
-            }
-         }
-    }
-  
+    }  
 }
 
 void GlxCoverFlow::panGesture ( const QPointF & delta )  
@@ -165,38 +165,6 @@
     }
 }
 
-void GlxCoverFlow::leftGesture(int value)
-{
-    Q_UNUSED(value);
-    qDebug("GlxCoverFlow::leftGesture CurrentPos= %d value %d", mCurrentPos, value); 
-    if(getSubState() == IMAGEVIEWER_S || getSubState() == FETCHER_S ) {
-        return;
-    }
-    mMoveDir = NO_MOVE;
-    mBounceBackDeltaX = ( mItemSize.width() >> 2 )  + ( mItemSize.width() >> 3 );
-    emit autoLeftMoveSignal();
-    if ( mUiOn == TRUE ) {
-        mUiOn = FALSE;
-        emit coverFlowEvent( PANNING_START_EVENT );        
-    }
-}
-
-void GlxCoverFlow::rightGesture(int value)
-{
-    Q_UNUSED(value);
-    qDebug("GlxCoverFlow::rightGesture CurrentPos= %d value %d ", mCurrentPos, value);
-    if(getSubState() == IMAGEVIEWER_S || getSubState() == FETCHER_S ) {
-        return;
-    }
-    mMoveDir = NO_MOVE;
-    mBounceBackDeltaX = ( mItemSize.width() >> 2 )  + ( mItemSize.width() >> 3 );
-    emit autoRightMoveSignal();
-    if ( mUiOn == TRUE  ) {
-        mUiOn = FALSE;
-        emit coverFlowEvent( PANNING_START_EVENT );
-    }     
-}
-
 void GlxCoverFlow::longPressGesture(const QPointF &point)
 {
      qDebug("GlxCoverFlow::longPressGesture x = %d  y = %d", point.x(), point.y());
@@ -266,7 +234,7 @@
     //for bounce back effect for last image ( it will do the back)
     if ( ( mCurrentPos + width ) > ( mStripLen + mBounceBackDeltaX ) && mMoveDir == NO_MOVE ) {
         mMoveDir = LEFT_MOVE;
-        mBounceBackDeltaX = 10;
+        mBounceBackDeltaX = GLX_BOUNCEBACK_DELTA;
         autoRightMoveSignal();
         return ;
     }
@@ -299,7 +267,7 @@
 			}
         }
         mMoveDir = NO_MOVE;
-        mBounceBackDeltaX = 10;
+        mBounceBackDeltaX = GLX_BOUNCEBACK_DELTA;
         mSpeed = GLX_COVERFLOW_SPEED;
     }   
 }
@@ -318,7 +286,7 @@
     qDebug("GlxCoverFlow::autoRightMove diffX x = %d current pos = %d mBounceBackDeltaX x = %d", diffX, mCurrentPos, mBounceBackDeltaX);
     if ( diffX > mBounceBackDeltaX && diffX < width && mMoveDir == NO_MOVE ){
         mMoveDir = RIGHT_MOVE;
-        mBounceBackDeltaX = 10;
+        mBounceBackDeltaX = GLX_BOUNCEBACK_DELTA;
         autoLeftMoveSignal();  
         return ;
     }
@@ -353,7 +321,7 @@
 			}
         }
         mMoveDir = NO_MOVE;
-        mBounceBackDeltaX = 10;
+        mBounceBackDeltaX = GLX_BOUNCEBACK_DELTA;
         mSpeed = GLX_COVERFLOW_SPEED;
     }
 }
@@ -554,10 +522,13 @@
     }
     return substate;
 }
+
 void GlxCoverFlow::zoomStarted(int index)
 {
+    Q_UNUSED(index)
 	mZoomOn = true;	
 }
+
 void GlxCoverFlow::zoomFinished(int index)
 { 
 	mZoomOn = false;
--- a/ui/views/fullscreenview/src/glxfullscreenview.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/fullscreenview/src/glxfullscreenview.cpp	Fri May 28 21:11:54 2010 +0530
@@ -66,8 +66,8 @@
 	mFlipAction(NULL),
 	mSendAction(NULL),
 	mDeleteAction(NULL),
-	mZoomWidget(NULL),
-	mUseImageAction(NULL)
+	mUseImageAction(NULL),
+	mZoomWidget(NULL)
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_GLXFULLSCREENVIEW_ENTRY );
     
@@ -112,6 +112,7 @@
     mCoverFlow = qobject_cast<GlxCoverFlow*> (mDocLoader->findWidget(GLXFULLSCREEN_COVERFLOW));
 
 	 mZoomWidget  =  qobject_cast<GlxZoomWidget*> (mDocLoader->findWidget(GLXFULLSCREENZOOMWIDGET));
+	 mZoomWidget->connectDecodeRequestToPinchEvent();
 	 mCoverFlow->setMultitouchFilter(mZoomWidget);
     //initialise the cover flow for basic connections and the rest
     mCoverFlow->setCoverFlow();
@@ -123,6 +124,7 @@
     //@to do : hide the widgets by default in docml
     mImageStrip->hide();      
 	mImageStrip->setLayoutName( QString( "ImageStrip" ) );
+	mImageStrip->setEnabledAnimations(HbAbstractItemView::None);
 	
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_LOADWIDGETS_EXIT );
 }
--- a/ui/views/fullscreenview/src/glxzoomwidget.cpp	Mon May 17 13:35:26 2010 +0530
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,411 +0,0 @@
- /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   glxzoomwidget.cpp
-*               description of the class GlxGlxZoomWidget which controls the Zoom behavior of coverflow.
-*
-*/
-#include <QPinchGesture>
-#include <hbiconitem.h>
-#include <glxmediamodel.h>
-#include "glximagedecoderwrapper.h"
-#include "glxmodelparm.h"
-#include "glxzoomwidget.h"
-
-GlxZoomWidget::GlxZoomWidget(QGraphicsItem *parent):HbScrollArea(parent), mModel(NULL), mImageDecodeRequestSend(false), mPinchGestureOngoing(false), mDecodedImageAvailable(false)
-{
-    grabGesture(Qt::PinchGesture);
-    setAcceptTouchEvents(true) ;
-    setFrictionEnabled(false);
-    setZValue(MINZVALUE);
-    //create the child items and background
-    mZoomWidget = new QGraphicsWidget(this);
-    mZoomItem = new QGraphicsPixmapItem(mZoomWidget);
-    mZoomItem->setTransformationMode(Qt::SmoothTransformation);
-    //the black background
-    //replace when a proper substitute for setting backgrounds is known
-    mBlackBackgroundItem = new HbIconItem(this);
-    mBlackBackgroundItem->setBrush(QBrush(Qt::black));
-    mBlackBackgroundItem->hide();
-    //does not work so is commented
-    //setBackgroundItem(mBlackBackgroundItem);
-
-    //initializing the image decoder
-    mImageDecoder = new GlxImageDecoderWrapper;
-    connect(this,SIGNAL( pinchGestureReceived(int) ), this, SLOT( sendDecodeRequest(int) ), Qt::QueuedConnection );
-}
-
-GlxZoomWidget::~GlxZoomWidget()
-{
-    //disconnect all existing signals
-    disconnect(this,SIGNAL( pinchGestureReceived(int) ), this, SLOT( sendDecodeRequest(int) ) );
-    //no Null checks required
-    delete mZoomItem;
-//    delete mZoomWidget; //as this is a content widegt it will automatically be deleted
-    delete mBlackBackgroundItem;
-    //reset the decoder to cancel pending tasks
-    if(mImageDecoder) {
-        mImageDecoder->resetDecoder();
-        delete mImageDecoder;
-    }
-}
-
-void GlxZoomWidget::setModel (QAbstractItemModel *model)
-{
-    if(model)
-    {
-        mModel = model;
-        retreiveFocusedImage(); //Update mZoomItem with focused Image
-        connect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
-    }
-}
-
-void GlxZoomWidget::setWindowSize(QSize windowSize)
-{
-    mWindowSize = windowSize;
-    mBlackBackgroundItem->setGeometry(QRectF(QPointF(0,0), mWindowSize));
-    //try to reset the max and min zoomed size here
-}
-
-void GlxZoomWidget::indexChanged(int index)
-{
-    Q_UNUSED(index);
-    if(mFocusIndex != index) {
-        mImageDecoder->resetDecoder();//reset the decoder first to cancel pending tasks
-        mImageDecodeRequestSend = false;
-        mDecodedImageAvailable = false;
-        retreiveFocusedImage();  //Update mZoomItem with focused Image
-    }
-}
-
-bool GlxZoomWidget::sceneEvent(QEvent *event)
-{
-    bool consume(false);
-    if (event->type() == QEvent::Gesture) {
-        consume = executeGestureEvent(this, static_cast<QGestureEvent*>(event));
-    }
-    if(!consume)
-    {
-        consume = HbScrollArea::sceneEvent(event);
-    }
-    return consume;
-}
-
-bool GlxZoomWidget::sceneEventFilter(QGraphicsItem *watched,QEvent *event)
-{
-     qDebug("GlxCoverFlow::eventFilter " );
-    bool consume = false;
-    if (event->type() == QEvent::Gesture) {
-        consume = executeGestureEvent(watched, static_cast<QGestureEvent*>(event));
-    }
-
-    if(!consume) {
-        consume = HbScrollArea::sceneEventFilter(watched,event);
-    }
-    return consume;
-
-}
-
-bool GlxZoomWidget::executeGestureEvent(QGraphicsItem *source,QGestureEvent *event)
-{
-     if (QGesture *pinch = event->gesture(Qt::PinchGesture))  {
-       QPinchGesture* pinchG = static_cast<QPinchGesture *>(pinch);
-       QPinchGesture::ChangeFlags changeFlags = pinchG->changeFlags();
-       if (changeFlags & QPinchGesture::ScaleFactorChanged) {
-            mPinchGestureOngoing = true;
-            //bring the zoom widget to foreground
-            setZValue(MAXZVALUE);
-            //show the black background
-            mBlackBackgroundItem->setParentItem(parentItem());
-            mBlackBackgroundItem->setZValue(MAXZVALUE - 1);
-            mBlackBackgroundItem->show();
-
-            //retreive the gesture values
-            qreal value = pinchG->scaleFactor() / pinchG->lastScaleFactor();
-            QPointF center = pinchG->property("centerPoint").toPointF();
-            //set the gesture center to the scene coordinates
-            QPointF sceneGestureCenter = source->sceneTransform().map(center);
-            zoomImage(value, sceneGestureCenter);
-
-        }
-       if (pinchG->state() == Qt::GestureStarted) {
-           emit pinchGestureReceived(mFocusIndex);
-       }
-
-       if (pinchG->state() == Qt::GestureFinished) {
-           if(mStepCurrentSize != mCurrentSize) {
-               //For giving a spring effect when user has zoomed more than normal.
-               if(mStepCurrentSize.width() > mMaxScaleDecSize.width())   {
-                   //scale the image to limited size
-                   qreal value = mMaxScaleDecSize.width()/mCurrentSize.width();
-                   QPointF center(mWindowSize.width()/2, mWindowSize.height()/2);
-                   QPointF sceneGestureCenter = source->sceneTransform().map(center);
-                   zoomImage(value, sceneGestureCenter);
-               }
-               mPinchGestureOngoing = false;
-                //finalize the transforms to the geometry else panning will not work
-                finalizeWidgetTransform();
-           }
-//push the Zoom widget to background when zoomed image size nears FS image
-           if(mStepCurrentSize.width() <= mMinDecScaleSize.width()*1.3)  {
-               mBlackBackgroundItem->hide();
-               //push the widget back to background
-               setZValue(MINZVALUE);
-               emit zoomWidgetMovedBackground(mFocusIndex);
-               //do not reset the transform here as it will then zoom-in the widget to decoded image size
-           }
-       }
-       //gesture accepted
-       return true;
-     }
-     //gesture rejected
-     if(!mPinchGestureOngoing) {
-         return false; 
-     }
-     return true;
-
-}
-
-void GlxZoomWidget::zoomImage(qreal zoomFactor, QPointF center)
-{
-    adjustGestureCenter(center, zoomFactor);
-    QSizeF requiredSize(mCurrentSize.width()*zoomFactor, mCurrentSize.height()*zoomFactor);
-    limitRequiredSize(requiredSize);
-    if(requiredSize != mCurrentSize) {
-        QTransform zoomTransform = mZoomWidget->transform();
-        QPointF transformedCenter = mZoomWidget->sceneTransform().inverted().map(center);
-        zoomTransform.translate(transformedCenter.x(),transformedCenter.y());
-        zoomTransform.scale(requiredSize.width()/mCurrentSize.width(), requiredSize.height()/mCurrentSize.height());
-        zoomTransform.translate(-transformedCenter.x(),-transformedCenter.y());
-        mZoomWidget->setTransform(zoomTransform);
-        mCurrentSize = requiredSize;
-    }
-
-}
-
-
-void GlxZoomWidget::limitRequiredSize(QSizeF &requiredSize)
-{
-    if(requiredSize.width() > mMaxScaleSize.width() ) {
-        requiredSize = mMaxScaleSize ;
-    }
-    else if(requiredSize.width() < mMinDecScaleSize.width() ) {
-        requiredSize = mMinDecScaleSize ;
-    }
-
-
-}
-
-//makes sure that the gesture is on the screen center if the image is smaller than the screen
-void GlxZoomWidget::adjustGestureCenter(QPointF & gestureCenter, qreal& zoomFactor)
-{
-    if(zoomFactor > 1 &&zoomFactor > 1.2 )  {
-        zoomFactor = 1.2;
-    }
-
-    if(zoomFactor < 1 &&zoomFactor < 0.8 )   {
-        zoomFactor = 0.8;
-    }
-    QSizeF requiredSize(mCurrentSize.width()*zoomFactor, mCurrentSize.height()*zoomFactor);
-    //keep smaller image centered
-    if(mCurrentSize.width() <= mWindowSize.width() )
-    {
-        gestureCenter.setX(mWindowSize.width()/2);
-
-    }
-    if(mCurrentSize.height() <= mWindowSize.height())
-    {
-        gestureCenter.setY(mWindowSize.height()/2);
-
-    }
-    //maintains the boundary of the edges for zoom out conditions
-    if(zoomFactor < 1)
-    {
-        QPointF itemOriginPos = mZoomWidget->sceneTransform().map(QPointF(0,0));
-        bool hasWidthExceededWindow = mCurrentSize.width() > mWindowSize.width();
-        bool hasHeightExceededWindow = mCurrentSize.height() > mWindowSize.height();
-        if(itemOriginPos.x() >= 0)  {
-        //image has crossed left boundry leaving blank space
-            if(hasWidthExceededWindow) {
-                //stick the gesture to the left corner
-                gestureCenter.setX(itemOriginPos.x());
-            }
-        }
-        //Check if the right boundry can be adjusted
-        if(itemOriginPos.x()+ mCurrentSize.width() <= mWindowSize.width()) {
-                //Image is before the right boundry leaving blank space
-                if(hasWidthExceededWindow) {
-                    //stick the gesture to the right corner
-                    gestureCenter.setX(itemOriginPos.x()+ mCurrentSize.width());
-                }
-        }
-        //check if the upper boundry could be adjusted
-        if(itemOriginPos.y() >= 0) {
-                //image has crossed the upper boundry leaving blank space
-                if(hasHeightExceededWindow) {
-                    //stick the image to the upper boundry
-                    gestureCenter.setY(itemOriginPos.y());
-                }
-        }
-        //check if the lower boundry could be adjusted
-        if(itemOriginPos.y()+ mCurrentSize.height() <= mWindowSize.height()) {
-        //Image is before the right boundry leaving blank space
-            if(hasHeightExceededWindow) {
-                //stick the image to the right corner
-                gestureCenter.setY(itemOriginPos.y()+ mCurrentSize.height());
-            }
-
-        }
-    }
-    //control the zoom Factor to boundaries
-    if(mCurrentSize.width() > mWindowSize.width() && requiredSize.width() <= mWindowSize.width())
-    {
-        zoomFactor =  mWindowSize.width()/mCurrentSize.width();
-
-    }
-    else if(mCurrentSize.height() > mWindowSize.height() && requiredSize.height() <= mWindowSize.height())
-    {
-        zoomFactor =  mWindowSize.height()/mCurrentSize.height();
-
-    }
-
-    //reduce the ZF so as to show a decelerated effect at max/min levels
-
-    if(mCurrentSize.width() > mMaxScaleDecSize.width() && zoomFactor > 1 ) {
-        zoomFactor = 1.0 + ((zoomFactor-1.0)/6) ;
-    }
-        if(mCurrentSize.width() < mMinDecScaleSize.width() && zoomFactor < 1 ) {
-        zoomFactor = 1.0 - ((1.0-zoomFactor)/6) ;
-    }
-
-
-}
-
-//get the latest focused image and set it to mZoomItem
-void GlxZoomWidget::retreiveFocusedImage()
-{
-
-    QPixmap targetPixmap(getFocusedImage());
-    //initialize all the variables wrt the focussed pixmap
-    mZoomWidget->resetTransform();
-    mItemSize = targetPixmap.size();
-    mMaxScaleSize = mItemSize;
-    mMaxScaleSize.scale(mWindowSize*13, Qt::KeepAspectRatio);
-    mMaxScaleDecSize = mItemSize;
-    mMaxScaleDecSize.scale(mWindowSize*7, Qt::KeepAspectRatio);
-    mMinScaleSize = mItemSize* 0.7;
-    mMinDecScaleSize = mItemSize;
-    QPointF originPos = sceneTransform().map(QPointF(0,0));
-    mZoomWidget->setGeometry(QRectF(QPointF(mWindowSize.width()/2 - mItemSize.width()/2,mWindowSize.height()/2 - mItemSize.height()/2),mItemSize )); //chk this
-    mZoomWidget->setPreferredSize(mItemSize);
-    mZoomItem->setPixmap(targetPixmap);
-    mCurrentSize = mItemSize;
-    mStepCurrentSize = mItemSize;
-    setContentWidget(mZoomWidget);
-    show();
-}
-
-
-void GlxZoomWidget::dataChanged(QModelIndex startIndex, QModelIndex endIndex)
-{
-    if(mFocusIndex >= startIndex.row() && mFocusIndex <= endIndex.row()) {
-        //get the latest image from the model
-        //will replace a decoded image if callback is received after decoded image is received so a fix is required
-        //retreiveFocusedImage();
-        if(!mDecodedImageAvailable)  {
-        QPixmap targetPixmap(getFocusedImage());
-        mZoomItem->setPixmap(targetPixmap);
-        finalizeWidgetTransform();
-        }
-    }
-}
-
-void GlxZoomWidget::decodedImageAvailable()
-{
-    //new bitmap with better resolution is available
-    //so set it to the item
-    QPixmap decodedPixmap = mImageDecoder->getPixmap();
-    disconnect(mImageDecoder, SIGNAL(pixmapDecoded()), this, SLOT(decodedImageAvailable()));
-    if(decodedPixmap.isNull()){
-        return;
-    }
-    mDecodedImageAvailable = true;
-    mZoomItem->setPixmap(decodedPixmap);
-    mItemSize = decodedPixmap.size();
-    //this is important if not done then old transforms will be applied on the new image
-    finalizeWidgetTransform();
-}
-
-void GlxZoomWidget::sendDecodeRequest(int index)
-{
-    if(!mImageDecodeRequestSend) {
-        QString imagePath = (mModel->data(mModel->index(index,0),GlxUriRole)).value<QString>();
-        mImageDecoder->decodeImage(imagePath);
-        connect(mImageDecoder, SIGNAL(pixmapDecoded()), this, SLOT(decodedImageAvailable()));
-        mImageDecodeRequestSend = true;
-    }
-}
-
-
-void GlxZoomWidget::finalizeWidgetTransform()
-{
-    QPointF widgetPos = mZoomWidget->sceneTransform().map(QPointF(0,0)); //Map the origin wrt scene
-    mZoomWidget->resetTransform();
-    mZoomWidget->scale(mCurrentSize.width()/mItemSize.width(), mCurrentSize.height()/mItemSize.height());
-    mZoomWidget->setGeometry(QRectF(widgetPos , mCurrentSize));
-    // this updates HbScrollArea on the sizeHint of ZoomWidget
-    mZoomWidget->setPreferredSize(mCurrentSize);
-    mStepCurrentSize = mCurrentSize;
-}
-
-QPixmap GlxZoomWidget::getFocusedImage()
-{
-    mFocusIndex = mModel->data(mModel->index(0,0),GlxFocusIndexRole).value<int>();
-    QVariant iconVariant = mModel->data(mModel->index(mFocusIndex,0),GlxFsImageRole);
-    QVariant sizeVariant = mModel->data(mModel->index(mFocusIndex,0),GlxDimensionsRole);
-    QPixmap targetPixmap;
-    //retreive pixmap from the HbIcon received from model
-    //should change the model to return and save pixmaps and convert to HbIcons Instead
-    if ( iconVariant.isValid() &&  iconVariant.canConvert<HbIcon> () ) {
-         QIcon itemIcon = iconVariant.value<HbIcon>().qicon();
-         QSize itemSize = itemIcon.actualSize(mWindowSize);
-         QSize scaleSize;
-         if(sizeVariant.isValid() &&  sizeVariant.canConvert<QSize> ()) {
-             scaleSize = sizeVariant.toSize();
-             if(!(scaleSize.width() < mWindowSize.width() && scaleSize.height() < mWindowSize.height()))  {
-                 scaleSize = mWindowSize;
-             }
-         }
-         targetPixmap = itemIcon.pixmap(itemSize).scaled(scaleSize, Qt::KeepAspectRatio);
-         mItemSize = targetPixmap.size();
-    }
-    return targetPixmap;
-
-}
-
-
-
-void GlxZoomWidget::cleanUp()
-{
-//    disconnect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
-    if(mImageDecoder) {
-        mImageDecoder->resetDecoder();
-    }
-    mZoomItem->setPixmap(QPixmap());
-}
-
-void GlxZoomWidget::activate()
-{
-}
-
-
--- a/ui/views/gridview/inc/glxgridview.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/gridview/inc/glxgridview.h	Fri May 28 21:11:54 2010 +0530
@@ -71,6 +71,11 @@
 
 protected :
     QVariant  itemChange (GraphicsItemChange change, const QVariant &value) ;
+    
+    /*
+     *  To emit the signal when application goes into background or come back to foreground
+     */
+    bool eventFilter(QObject *obj, QEvent *ev);    
 
 private slots:
     void indicateLongPress(const QModelIndex& index, QPointF coords);
--- a/ui/views/gridview/src/glxgridview.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/gridview/src/glxgridview.cpp	Fri May 28 21:11:54 2010 +0530
@@ -30,6 +30,7 @@
 #include <hblabel.h>
 #include <QString>
 #include <hbframeitem.h>
+#include <QCoreApplication>
 
 //User Includes
 #include "glxviewids.h"
@@ -38,6 +39,9 @@
 #include "glxcommandhandlers.hrh"
 #include "glxicondefs.h"
 #include "glxlocalisationstrings.h"
+#include "glxlog.h"
+#include "glxtracer.h"
+
 
 #include "OstTraceDefinitions.h"
 #ifdef OST_TRACE_COMPILER_IN_USE
@@ -90,6 +94,7 @@
         frame->graphicsItem()->setOpacity(1);
         mCountItem->setBackgroundItem(frame->graphicsItem(),-1);
     }
+    QCoreApplication::instance()->installEventFilter(this);
     OstTraceFunctionExit0( GLXGRIDVIEW_ACTIVATE_EXIT );
 }
 
@@ -97,33 +102,28 @@
 {
     OstTraceFunctionEntry0( GLXGRIDVIEW_DEACTIVATE_ENTRY );
     mScrolling = FALSE;
-    if (mUiOnButton)
-        {
+    if (mUiOnButton){
         mUiOnButton->hide();
-        }    
-    if(mIconItem)
-        {
+    }    
+    if(mIconItem) {
         mIconItem->hide();
         mIconItem->resetTransform();
         mIconItem->setOpacity(0);
         mIconItem->setZValue(mIconItem->zValue()-20);
-        }
-    if (mCountItem) 
-        {
+    }
+    if (mCountItem) {
         mCountItem->hide();
-        }
-    if (mAlbumName) 
-        {
+    }
+    if (mAlbumName) {
         mAlbumName->hide();
-        }
-    if(mZeroItemLabel) 
-        {
+    }
+    if(mZeroItemLabel) {
         mZeroItemLabel->hide();
-        }
-    if(mCameraButton) 
-        {
+    }
+    if(mCameraButton) {
         mCameraButton->hide();
-        }
+    }
+    QCoreApplication::instance()->removeEventFilter(this);
     disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationchanged(Qt::Orientation)));
     OstTraceFunctionExit0( GLXGRIDVIEW_DEACTIVATE_EXIT );
 }
@@ -416,6 +416,20 @@
     showItemCount();
 }
 
+bool GlxGridView::eventFilter(QObject *obj, QEvent *event)
+{
+    TRACER("GlxGridView::eventFilter() ");
+    GLX_LOG_INFO1("GlxGridView::eventFilter() %d event type", event->type());
+    
+    if ( event->type() ==  QEvent::ApplicationActivate ) {
+        emit actionTriggered( EGlxCmdAppForeground );
+    }
+    if ( event->type() ==  QEvent::ApplicationDeactivate ) {
+        emit actionTriggered( EGlxCmdAppBackground );
+    }
+    return HbView::eventFilter(obj,event);
+}
+
 void GlxGridView::handleUserAction(qint32 commandId)
 {
     OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_HANDLEUSERACTION, "GlxGridView::handleUserAction" );
@@ -518,7 +532,7 @@
 }
 void GlxGridView::hideorshowitems(Qt::Orientation orient)
 {
-    if (mWidget->selectionMode() == HgWidget::NoSelection) {
+    if (mWidget && mWidget->selectionMode() == HgWidget::NoSelection) {
         if(orient == Qt::Horizontal)
             {
 			setItemVisible(Hb::AllItems, FALSE) ;
@@ -535,7 +549,7 @@
             }
     }
 
-    if (mWidget->selectionMode() == HgWidget::MultiSelection) {
+    if (mWidget && mWidget->selectionMode() == HgWidget::MultiSelection) {
         setItemVisible(Hb::TitleBarItem, FALSE) ;
         if (mUiOnButton) {
             mUiOnButton->hide();
--- a/ui/views/slideshowsettingsview/inc/glxslideshowsettingsview.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/slideshowsettingsview/inc/glxslideshowsettingsview.h	Fri May 28 21:11:54 2010 +0530
@@ -30,7 +30,7 @@
 class HbMainWindow;
 class HbComboBox;
 class QAbstractItemModel;
-class GlxSlideShowSetting;
+class GlxSettingInterface;
 
 class GlxSlideShowSettingsView : public GlxView
 {
@@ -47,16 +47,16 @@
     void orientationChanged(Qt::Orientation); 
 	
 private:
-void setLayout();
+    void setLayout();
   
 private:
-	HbComboBox          *mEffect;  //Drop down box to display transition effect
+	HbComboBox          *mEffect;    //Drop down box to display transition effect
 	HbComboBox          *mDelay; 	 //Drop down box to display transition delay
-	HbMainWindow        *mWindow;  //no ownership
+	HbMainWindow        *mWindow;    //no ownership
 	HbLabel *mContextlabel;				 //Display SlideShow label
 	HbLabel *mEffectlabel;				 //Display "Transition Effect: "
-	HbLabel *mDelaylabel;					 //Display "Transition delay: "
-	GlxSlideShowSetting *mSettings;
+	HbLabel *mDelaylabel;				 //Display "Transition delay: "
+	GlxSettingInterface *mSettings;      //no ownership
 };
 
 #endif /* GLXGRIDVIEW_H_ */
--- a/ui/views/slideshowsettingsview/src/glxslideshowsettingsview.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/slideshowsettingsview/src/glxslideshowsettingsview.cpp	Fri May 28 21:11:54 2010 +0530
@@ -27,9 +27,8 @@
 #include "glxuistd.h"
 #include "glxviewids.h"
 #include "glxslideshowsettingsview.h"
-#include "glxeffectengine.h"
-
-
+#include "glxsettinginterface.h"
+#include "glxlocalisationstrings.h"
 
 
 GlxSlideShowSettingsView::GlxSlideShowSettingsView(HbMainWindow *window) 
@@ -42,22 +41,22 @@
       mDelaylabel (NULL),
       mSettings( NULL )
 {
-    mSettings = new GlxSlideShowSetting();
+    mSettings = GlxSettingInterface::instance() ;
   	setContentFullScreen( true );
 }
 
 GlxSlideShowSettingsView::~GlxSlideShowSettingsView()
 {
-    	delete mContextlabel;
-    	delete mEffectlabel;
-    	delete mDelaylabel;
-    	delete mEffect;
-    	delete mDelay;
-        delete mSettings;
+    delete mContextlabel;
+    delete mEffectlabel;
+    delete mDelaylabel;
+    delete mEffect;
+    delete mDelay;
 }
 
 void GlxSlideShowSettingsView::setModel(QAbstractItemModel *model)
 {
+    Q_UNUSED( model )
     return;
 }
 
@@ -71,35 +70,33 @@
     connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation)));
     
     if ( mContextlabel == NULL ) {
-        mContextlabel = new HbLabel("Slideshow", this);
+        mContextlabel = new HbLabel( GLX_MENU_SLIDESHOW, this );
     }
     
     if ( mEffectlabel == NULL ) {
-        mEffectlabel = new HbLabel("Transition effect:", this);
+        mEffectlabel = new HbLabel( GLX_LABEL_TRANSITION_EFFECT, this );
     }
     
     if ( mEffect == NULL ) {
         mEffect = new HbComboBox(this);
         QStringList effectList = mSettings->slideShowEffectList();
-        mEffect->addItems( effectList );
-        
+        mEffect->addItems( effectList );        
     }
     
     if ( mDelaylabel == NULL ) {
-        mDelaylabel = new HbLabel("Transition delay:", this);
+        mDelaylabel = new HbLabel( GLX_LABEL_TRANSITION_DELAY, this );
     }
     
     if ( mDelay == NULL ) {
         mDelay = new HbComboBox(this);
         QStringList delayList;
-        delayList<<"slow"<<"medium"<<"fast";
+        delayList <<  GLX_VAL_SLOW << GLX_VAL_MEDIUM << GLX_VAL_FAST ;
         mDelay->addItems( delayList );
     }
    
-   // Read the values from the cenrep
-    
-    mEffect->setCurrentIndex( mSettings->slideShowEffectIndex());
-    mDelay->setCurrentIndex( mSettings->slideShowDelayIndex());
+   // Read the values from the cenrep    
+    mEffect->setCurrentIndex( mSettings->slideShowEffectIndex() );
+    mDelay->setCurrentIndex( mSettings->slideShowDelayIndex() );
     setLayout();
 }
 
@@ -117,10 +114,8 @@
 void GlxSlideShowSettingsView::deActivate()
 {
 	 //Store the current effect and delay before going back to the previous view
-	mSettings->setslideShowEffectIndex(mEffect->currentIndex());
-	mSettings->setSlideShowDelayIndex(mDelay->currentIndex()); 
+	mSettings->setslideShowEffectIndex( mEffect->currentIndex() );
+	mSettings->setSlideShowDelayIndex( mDelay->currentIndex() ); 
     disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation)));
 }
 
-
-
--- a/ui/views/slideshowview/inc/glxslideshowwidget.h	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/slideshowview/inc/glxslideshowwidget.h	Fri May 28 21:11:54 2010 +0530
@@ -36,17 +36,24 @@
 class HbAbstractDataModel;
 
 //User Forward Declarations
-class GlxSlideShowEffectEngine;
-
+class GlxEffectEngine;
+class GlxSettingInterface;
 
 #define NBR_ITEM 3
 typedef enum
 {
     UI_ON_EVENT, //send the signal when user tap on screen ( on the UI )
     UI_OFF_EVENT, //send the signal when user press continous button ( off the UI)
-    EMPTY_DATA_EVENT //send the signal when model have no data
+    EMPTY_DATA_EVENT, //send the signal when model have no data
+    EFFECT_STARTED  // sends the signal when effect is started.
 } GlxSlideShowEvent;
 
+typedef enum 
+{
+    MOVE_FORWARD,
+    MOVE_BACKWARD,
+} GlxSlideShowMoveDir;
+
 class GlxSlideShowWidget : public HbWidget
 {
 Q_OBJECT
@@ -101,14 +108,14 @@
     //add the connection to the model
     void initializeNewModel();
     void resetSlideShow();
-    void setIconItems(int moveDir);
-    void setItemPos(int moveDir);
-    void moveImage(int nextIndex, int posX, const QString & move, char * callBack);
+    void setIconItems( int moveDir );
+    void moveImage( int nextIndex, int posX, const QString & move, char * callBack );
     void addConnections();
     void removeConnections();
 
 private:
-    GlxSlideShowEffectEngine *mEffectEngine;
+    GlxEffectEngine          *mEffectEngine;
+    GlxSettingInterface      *mSettings;               //no ownership
     HbIconItem               *mIconItems[NBR_ITEM]; 
     HbPushButton             *mContinueButton;
     int                      mItemIndex;
--- a/ui/views/slideshowview/src/glxslideshowview.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/slideshowview/src/glxslideshowview.cpp	Fri May 28 21:11:54 2010 +0530
@@ -91,6 +91,7 @@
                 
     disconnect( mSlideShowWidget, SIGNAL( slideShowEvent( GlxSlideShowEvent ) ), this, SLOT( slideShowEventHandler( GlxSlideShowEvent ) ) );
     disconnect( mSlideShowWidget, SIGNAL( indexchanged() ), this, SLOT( indexchanged() ) );
+        
     //Delete the Items in the slide show widget
     mSlideShowWidget->cleanUp();
     
@@ -116,7 +117,7 @@
     mSlideShowWidget->setModel(mModel);
     
     if (mTvOutWrapper){
-        mTvOutWrapper->setModel(mModel);
+        mTvOutWrapper->setModel(mModel,true);
         mTvOutWrapper->setImagetoHDMI();
     }
 }
@@ -162,6 +163,12 @@
         case EMPTY_DATA_EVENT :
             emit actionTriggered( EGlxCmdEmptyData );
             break;
+            
+        case EFFECT_STARTED:
+            if (mTvOutWrapper){
+            mTvOutWrapper->fadeSurface(false);
+            }
+            break;
 
         default :
             break;        
--- a/ui/views/slideshowview/src/glxslideshowwidget.cpp	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/slideshowview/src/glxslideshowwidget.cpp	Fri May 28 21:11:54 2010 +0530
@@ -29,20 +29,21 @@
 #include <QGesture>
 #include <hbpangesture.h>
 
-
 //User Includes
 #include "glxicondefs.h" //Contains the icon names/Ids
 #include "glxmodelparm.h"
 #include "glxeffectengine.h"
 #include "glxdocloaderdefs.h"
 #include "glxslideshowwidget.h"
-#include <glxlog.h>
-#include <glxtracer.h>
+#include "glxsettinginterface.h"
+#include "glxlog.h"
+#include "glxtracer.h"
 
 
 GlxSlideShowWidget::GlxSlideShowWidget( QGraphicsItem *parent ) 
     : HbWidget(parent), 
       mEffectEngine(NULL), 
+      mSettings( NULL ),
       mContinueButton(NULL), 
       mItemIndex(1), 
       mSelIndex(0), 
@@ -50,17 +51,18 @@
       mModel(NULL)
 {
     TRACER("GlxSlideShowWidget::GlxSlideShowWidget()");
+    mSettings = GlxSettingInterface::instance() ; //no owner ship
     grabGesture( Qt::PanGesture );
     grabGesture( Qt::TapGesture );
 }
 
 void GlxSlideShowWidget::setSlideShowWidget(HbDocumentLoader *DocLoader)
-    {
+{
     //To:Do error handling
     TRACER("GlxSlideShowWidget::setSlideShowWidget()");   
     
     //create the effect engine
-    mEffectEngine = new GlxSlideShowEffectEngine();
+    mEffectEngine = new GlxEffectEngine();
 
     // Now load the view and the contents.
     // and then set the play icon to the button
@@ -70,8 +72,8 @@
     mIsPause = false;
 
     for ( int i = 0; i < NBR_ITEM ; i++) {
-    mIconItems[i] = new HbIconItem(this);
-    mIconItems[i]->setBrush(QBrush(Qt::black));
+        mIconItems[i] = new HbIconItem(this);
+        mIconItems[i]->setBrush(QBrush(Qt::black));
     }
 
     mSlideTimer = new QTimer();
@@ -81,75 +83,68 @@
     addConnections();
 
     //Create the settings for the effects 
-    mEffectEngine->readSetting();
-    mEffectEngine->registerEffect(QString("HbIconItem"));
+    mEffectEngine->registerEffect( QString("HbIconItem") );
 
     //provide the xml info for the effect to take place
     HbEffect::add( QString("HbIconItem"), QString(":/data/transition.fxml"), QString( "Move" ));
     HbEffect::add( QString("HbIconItem"), QString(":/data/transitionleft.fxml"), QString( "LeftMove" ));
     HbEffect::add( QString("HbIconItem"), QString(":/data/transitionright.fxml"), QString( "RightMove" ));
-    }
+}
 
 GlxSlideShowWidget::~GlxSlideShowWidget()
-    {
+{
     TRACER("GlxSlideShowWidget::~GlxSlideShowWidget()");
 
     //Delete the resources allocated
     cleanUp();
 
-    if(mContinueButton)
-        {
+    if(mContinueButton) {
         delete mContinueButton;
         mContinueButton = NULL;
-        }
     }
-
+}
 
 void GlxSlideShowWidget::cleanUp()
-    {
+{
     TRACER("GlxSlideShowWidget::cleanUp()");
     removeConnections();
 
-    if(mEffectEngine)
-        {
+    if(mEffectEngine) {
         mEffectEngine->deRegisterEffect( QString("HbIconItem") );    
         delete mEffectEngine;
         mEffectEngine = NULL;
-        }
-     
+    }     
     
-    for ( int i = 0; i < NBR_ITEM ; i++) 
-        {
+    for ( int i = 0; i < NBR_ITEM ; i++) {
         delete mIconItems[i] ;
         mIconItems[i] = NULL;
-        }
+    }
 
-    if(mSlideTimer)
-        {
+    if(mSlideTimer) {
         delete mSlideTimer;
         mSlideTimer = NULL;
-        }
+    }
 
     clearCurrentModel();
     HbEffect::remove( QString("HbIconItem"), QString(":/data/transition.fxml"), QString( "Move" ));
     HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionleft.fxml"), QString( "LeftMove" ));
     HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionright.fxml"), QString( "RightMove" ));
-    }
+}
 
 void GlxSlideShowWidget::setModel (QAbstractItemModel *model)
-    {
+{
     TRACER("GlxSlideShowWidget::setModel()");
     if ( model == mModel ) {
-    return ;
+        return ;
     }
     clearCurrentModel();   
     mModel = model;
     initializeNewModel();
     resetSlideShow();
-    }
+}
 
 void GlxSlideShowWidget::setItemGeometry(QRect screenRect)
-    {
+{
     TRACER("GlxSlideShowWidget::setItemGeometry()");
     int index = mItemIndex;
     mScreenRect = screenRect;   
@@ -158,10 +153,10 @@
     mIconItems[index]->setGeometry( QRect( mScreenRect.width(), mScreenRect.top(), mScreenRect.width(), mScreenRect.height() ) );
     index = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1;    
     mIconItems[index]->setGeometry( QRect( -mScreenRect.width(), mScreenRect.top(), mScreenRect.width(), mScreenRect.height() ) );     
-    }
+}
 
 void GlxSlideShowWidget::triggeredEffect()
-    { 
+{ 
     TRACER("GlxSlideShowWidget::triggeredEffect()"); 
     int index = mItemIndex;
     mSlideTimer->stop();
@@ -169,54 +164,43 @@
     User::ResetInactivityTime();
 
     mItemList.append( mIconItems[index] );
-    if ( mEffectEngine->slideShowMoveDir() == MOVE_FORWARD ) {
-    index = ( mItemIndex + 1) % NBR_ITEM;
-    }
-    else {
-    index = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1;
-    }
+    index = ( mItemIndex + 1 ) % NBR_ITEM;
     mItemList.append( mIconItems[index] );
 
     GLX_LOG_INFO3("GlxSlideShowWidget::triggeredEffect() image selected index %d array index %d index %d", mSelIndex, mItemIndex, index);  
     mEffectEngine->runEffect( mItemList, QString("HbIconItem") );
+    emit slideShowEvent( EFFECT_STARTED );
     }
 
-
 void GlxSlideShowWidget::effectFinshed()
-    {
+{
     TRACER("GlxSlideShowWidget::effectFinshed()");
     //To:Do boundery condition or last item check implemented after behaviour of slide show clear
     int rowCount = mModel->rowCount();
     GLX_LOG_INFO2("GlxSlideShowWidget::effectFinshed() before image selected index %d array index %d", mSelIndex, mItemIndex); 
 
-    if ( mEffectEngine->slideShowMoveDir() == MOVE_FORWARD ) {
     mSelIndex = ( ++mSelIndex ) % rowCount;
     mItemIndex = ( ++mItemIndex ) % NBR_ITEM;
-    }
-    else {
-    mSelIndex = mSelIndex ? --mSelIndex : rowCount - 1;
-    mItemIndex = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1;
-    }
-
     mModel->setData( mModel->index(mSelIndex, 0), mSelIndex, GlxFocusIndexRole );
-    setIconItems(mEffectEngine->slideShowMoveDir());
-    //setItemPos(mEffectEngine->slideShowMoveDir());
+    setIconItems( MOVE_FORWARD );
+  
     GLX_LOG_INFO2("GlxSlideShowWidget::effectFinshed() after image selected index %d array index %d ", mSelIndex, mItemIndex);
+    
     if ( mIsPause == false ) {
-    mSlideTimer->start( mEffectEngine->slideDelayTime() );  
+        mSlideTimer->start( mSettings->slideShowDelayTime() );  
     } 
     mItemList.clear();
     emit indexchanged(); // on each item change
-    }
+}
 
 void GlxSlideShowWidget::cancelEffect()
-    {
+{
     TRACER("GlxSlideShowWidget::cancelEffect()");
     mEffectEngine->cancelEffect( mItemList );
-    }
+}
 
 void GlxSlideShowWidget::pauseSlideShow()
-    {
+{
     TRACER("GlxSlideShowWidget::pauseSlideShow()");
     GLX_LOG_INFO1("GlxSlideShowWidget::pauseSlideShow() %d", this->zValue());
     mIsPause = true;
@@ -225,52 +209,52 @@
     mContinueButton->setZValue( this->zValue() + 2);
     mContinueButton->show() ;
     emit slideShowEvent(UI_ON_EVENT);
-    }
+}
 
 void GlxSlideShowWidget::continueSlideShow(bool checked)
-    {
+{
     Q_UNUSED( checked )
     TRACER("GlxSlideShowWidget::continueSlideShow()");
     mIsPause = false;
     if ( mModel &&  mModel->rowCount() > 1 ) {
-    mSlideTimer->start( mEffectEngine->slideDelayTime() ); 
+        mSlideTimer->start( mSettings->slideShowDelayTime() ); 
     }
     mContinueButton->hide(); 
     emit slideShowEvent(UI_OFF_EVENT);
-    }
+}
 
 void GlxSlideShowWidget::dataChanged(QModelIndex startIndex, QModelIndex endIndex)
-    {
+{
     Q_UNUSED( endIndex )
     TRACER("GlxSlideShowWidget::dataChanged()");
     GLX_LOG_INFO2("GlxSlideShowWidget::dataChanged startIndex = %d mSelIndex = %d ", startIndex.row(), mSelIndex  );
     int deltaIndex = startIndex.row() - mSelIndex;
 
     if ( deltaIndex <= 1 && deltaIndex >= -1 ) {
-    int index = ( mItemIndex + deltaIndex + NBR_ITEM ) % NBR_ITEM; //calculated the array index in which data sould be updated
-    GLX_LOG_INFO2("GlxSlideShowWidget::dataChanged index = %d mSelItemIndex = %d ", index, mItemIndex );
-
-    QVariant variant = mModel->data( startIndex, GlxFsImageRole );
-    if ( variant.isValid() &&  variant.canConvert<HbIcon> () ) {
-    mIconItems[index]->setIcon ( variant.value<HbIcon>() ) ;
-    }
-    else {
-    mIconItems[index]->setIcon ( HbIcon() ) ; 
-    }
+        int index = ( mItemIndex + deltaIndex + NBR_ITEM ) % NBR_ITEM; //calculated the array index in which data sould be updated
+        GLX_LOG_INFO2("GlxSlideShowWidget::dataChanged index = %d mSelItemIndex = %d ", index, mItemIndex );
+    
+        QVariant variant = mModel->data( startIndex, GlxFsImageRole );
+        if ( variant.isValid() &&  variant.canConvert<HbIcon> () ) {
+            mIconItems[index]->setIcon ( variant.value<HbIcon>() ) ;
+        }
+        else {
+            mIconItems[index]->setIcon ( HbIcon() ) ; 
+        }
     }	
-    }
+}
 
 void GlxSlideShowWidget::rowsInserted(const QModelIndex &parent, int start, int end)
-    {
+{
     TRACER("GlxSlideShowWidget::rowsInserted()");
     Q_UNUSED(parent);
     Q_UNUSED(start);
     Q_UNUSED(end);
     resetSlideShow();  
-    }
+}
 
 void GlxSlideShowWidget::rowsRemoved(const QModelIndex &parent, int start, int end)
-    {
+{
     TRACER("GlxSlideShowWidget::rowsRemoved()");
     Q_UNUSED(parent);
     Q_UNUSED(start);
@@ -279,19 +263,19 @@
     GLX_LOG_INFO1( "GlxSlideShowWidget::rowsRemoved row count = %d ", mModel->rowCount()  );
 
     if ( mModel->rowCount() <= 0 ) {
-    clearCurrentModel();
-    emit slideShowEvent( EMPTY_DATA_EVENT );
+        clearCurrentModel();
+        emit slideShowEvent( EMPTY_DATA_EVENT );
     }
     else {
-    resetSlideShow();
+        resetSlideShow();
     }
-    }
+}
 
 void GlxSlideShowWidget::modelDestroyed()
-    {
+{
     TRACER("GlxSlideShowWidget::modelDestroyed()");
     clearCurrentModel();
-    }
+}
 
 
 void GlxSlideShowWidget::orientationChanged(QRect screenRect)
@@ -322,7 +306,7 @@
 }
 
 void GlxSlideShowWidget::leftMoveEffectFinished( const HbEffect::EffectStatus &status )
-    {
+{
     Q_UNUSED(status)
     TRACER("GlxSlideShowWidget::leftMoveEffectFinished()");
     GLX_LOG_INFO1("GlxSlideShowWidget::leftMoveEffectFinished() %d status", status.reason);
@@ -332,13 +316,13 @@
     mItemIndex = ( ++mItemIndex ) % NBR_ITEM;
     mModel->setData( mModel->index(mSelIndex, 0), mSelIndex, GlxFocusIndexRole );
 
-    setIconItems(MOVE_FORWARD);
+    setIconItems( MOVE_FORWARD );
     startSlideShow();
     emit indexchanged(); // on left swipe
-    }
+}
 
 void GlxSlideShowWidget::rightMoveEffectFinished( const HbEffect::EffectStatus &status )
-    {
+{
     Q_UNUSED(status)
     TRACER ( "GlxSlideShowWidget::rightMoveEffectFinished( ) ");
     GLX_LOG_INFO1("GlxSlideShowWidget::rightMoveEffectFinished() %d status", status.reason);
@@ -348,11 +332,10 @@
     mItemIndex = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1;
     mModel->setData( mModel->index(mSelIndex, 0), mSelIndex, GlxFocusIndexRole );
 
-    setIconItems(MOVE_BACKWARD);
+    setIconItems( MOVE_BACKWARD);
     startSlideShow();
     emit indexchanged(); // on right swipe
-    } 
-
+} 
  
 void GlxSlideShowWidget::gestureEvent(QGestureEvent *event)
 {  
@@ -383,160 +366,146 @@
 }    
 
 void GlxSlideShowWidget::startSlideShow ( )
-    {
+{
     TRACER ( "GlxSlideShowWidget::startSlideShow( ) ");
     GLX_LOG_INFO1 ( "GlxSlideShowWidget::startSlideShow( ) is pause %d", mIsPause);    
     if ( mIsPause == false && mModel &&  mModel->rowCount() > 1 ) {
-    mSlideTimer->start( mEffectEngine->slideDelayTime() );  
+        mSlideTimer->start( mSettings->slideShowDelayTime() );  
     }    
-    }
+}
 
 void GlxSlideShowWidget::stopSlideShow (  )
-    {
+{
     TRACER ( "GlxSlideShowWidget::stopSlideShow( ) ");
     cancelEffect();
     mSlideTimer->stop();                
-    }
+}
 
 void GlxSlideShowWidget::clearCurrentModel()
-    {
+{
     TRACER ( "GlxSlideShowWidget::clearCurrentModel( ) ");
     if ( mModel ) {
-    disconnect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
-    disconnect(mModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int)));
-    disconnect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int)));
-    disconnect(mModel, SIGNAL(destroyed()), this, SLOT( modelDestroyed()));
-    mModel = NULL ;
+        disconnect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
+        disconnect(mModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int)));
+        disconnect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int)));
+        disconnect(mModel, SIGNAL(destroyed()), this, SLOT( modelDestroyed()));
+        mModel = NULL ;
     }
 /*
     disconnect(mModel, SIGNAL(destroyed()), this, SLOT(_q_modelDestroyed()));
     disconnect(mModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)), this, SLOT(rowsAboutToBeRemoved(QModelIndex,int,int)));
  */	
-    }
+}
 
 void GlxSlideShowWidget::initializeNewModel()
-    {
+{
     TRACER("GlxSlideShowWidget::initializeNewModel" );
     if ( mModel ) {
-    connect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
-    connect(mModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int)));
-    connect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int)));
-    connect(mModel, SIGNAL(destroyed()), this, SLOT( modelDestroyed()));
+        connect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
+        connect(mModel, SIGNAL(rowsInserted(QModelIndex,int,int)), this, SLOT(rowsInserted(QModelIndex,int,int)));
+        connect(mModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), this, SLOT(rowsRemoved(QModelIndex,int,int)));
+        connect(mModel, SIGNAL(destroyed()), this, SLOT( modelDestroyed()));
     }	
-    }
+}
 
 
 void GlxSlideShowWidget::resetSlideShow()
-    {
+{
     TRACER("GlxSlideShowWidget::resetSlideShow()" );
 	if(! mModel) {
 		return;
 	}
     QVariant variant = mModel->data( mModel->index( mSelIndex, 0 ), GlxFocusIndexRole );
     if ( variant.isValid() &&  variant.canConvert<int> () ) {
-    mSelIndex = variant.value<int>() ;
-    GLX_LOG_INFO1("GlxSlideShowWidget::resetSlideShow() selected index %d", mSelIndex ); 
+        mSelIndex = variant.value<int>() ;
+        GLX_LOG_INFO1("GlxSlideShowWidget::resetSlideShow() selected index %d", mSelIndex ); 
     }
 
     variant = mModel->data( mModel->index( mSelIndex, 0 ), GlxFsImageRole );
     if ( variant.isValid() &&  variant.canConvert<HbIcon> () ) {
-    mIconItems[mItemIndex]->setIcon ( variant.value<HbIcon>() ) ; 
+        mIconItems[mItemIndex]->setIcon ( variant.value<HbIcon>() ) ; 
     }
     else {
-    mIconItems[mItemIndex]->setIcon ( HbIcon() ) ; 
+        mIconItems[mItemIndex]->setIcon ( HbIcon() ) ; 
     }
+    
     setIconItems(MOVE_FORWARD);
     setIconItems(MOVE_BACKWARD);
     if ( mIsPause == false && mModel &&  mModel->rowCount() > 1 ) {
-    mSlideTimer->start( mEffectEngine->slideDelayTime() );  
+        mSlideTimer->start( mSettings->slideShowDelayTime() );  
     }  
-    }
+}
 
-void GlxSlideShowWidget::setIconItems(int moveDir)
-    {
+void GlxSlideShowWidget::setIconItems( int moveDir )
+{
     TRACER("GlxSlideShowWidget::setIconItems()");
     int index = 0, itemIndex = 0;
     int rowCount = mModel->rowCount();
     GLX_LOG_INFO1("GlxSlideShowWidget::setIconItems() rowcount %d ", rowCount);
 
     if ( rowCount == 0 ) {
-    return ;
+        return ;
     }
-
-    if (moveDir == MOVE_FORWARD) {
-    index = ( mSelIndex + 1) % rowCount;
-    itemIndex = ( mItemIndex + 1) % NBR_ITEM;
-    }else {
-    index = mSelIndex ? mSelIndex - 1 : rowCount - 1;  
-    itemIndex = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; 
+    
+    if ( moveDir == MOVE_FORWARD ) {
+        index = ( mSelIndex + 1 ) % rowCount;
+        itemIndex = ( mItemIndex + 1) % NBR_ITEM;
+    }
+    else {
+        index = mSelIndex ? mSelIndex - 1 : rowCount - 1;  
+        itemIndex = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1; 
     }
 
     GLX_LOG_INFO4("GlxSlideShowWidget::setIconItems() image selected index %d array index %d index %d icon index %d", mSelIndex, mItemIndex, index, itemIndex);
 
     QVariant variant = mModel->data( mModel->index( index, 0 ), GlxFsImageRole );
     if ( variant.isValid() &&  variant.canConvert<HbIcon> () ) {
-    mIconItems[itemIndex]->setIcon ( variant.value<HbIcon>() ) ; 
+        mIconItems[itemIndex]->setIcon ( variant.value<HbIcon>() ) ; 
     }
     else {
-    mIconItems[itemIndex]->setIcon ( HbIcon() ) ;
+        mIconItems[itemIndex]->setIcon ( HbIcon() ) ;
     } 
-    }
-
-//To:DO it is not used so may be remove later
-void GlxSlideShowWidget::setItemPos(int moveDir)
-    {
-    Q_UNUSED( moveDir) 
-    TRACER("GlxSlideShowWidget::setItemPos()");
-    GLX_LOG_INFO1("GlxSlideShowWidget::setItemPos() array index %d", mItemIndex );
-
-    if (moveDir == MOVE_FORWARD) {
-    int index = ( mItemIndex + 1) % NBR_ITEM;
-    mIconItems[index]->setPos( mScreenRect.width(), mScreenRect.top() );
-    }
-    else {
-    int index = mItemIndex ? mItemIndex - 1 : NBR_ITEM - 1;    
-    mIconItems[index]->setPos( -mScreenRect.width(), mScreenRect.top() ); 
-    }   
-    }
+}
 
 void GlxSlideShowWidget::moveImage(int nextIndex, int posX, const QString & move, char * callBack)
-    {
+{
     TRACER("GlxSlideShowWidget::MoveImage()");
 
     if ( mModel->rowCount() <= 1 || mEffectEngine->isEffectRuning( mItemList ) ) {
-    return ;
+        return ;
     }
 
     mSlideTimer->stop();
-    HbEffect::start(mIconItems[mItemIndex], QString("HbIconItem"), move );
+    HbEffect::start( mIconItems[mItemIndex], QString("HbIconItem"), move );
     mIconItems[nextIndex]->setPos( posX, mScreenRect.top());
+    mIconItems[nextIndex]->setOpacity(1);
     HbEffect::start(mIconItems[nextIndex], QString("HbIconItem"), QString("Move"), this, callBack );    
-    }
+}
 
 void GlxSlideShowWidget::addConnections()
-    {
+{
     TRACER("GlxSlideShowWidget::addConnections()");
     if ( mEffectEngine )  {
-    connect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinshed() ) );
+        connect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinshed() ) );
     }
     if ( mSlideTimer ) {
-    connect( mSlideTimer, SIGNAL(timeout()), this, SLOT( triggeredEffect() ) );
+        connect( mSlideTimer, SIGNAL(timeout()), this, SLOT( triggeredEffect() ) );
     }
     if ( mContinueButton ) {
-    connect( mContinueButton, SIGNAL( clicked(bool) ), this, SLOT( continueSlideShow(bool) ) );
+        connect( mContinueButton, SIGNAL( clicked(bool) ), this, SLOT( continueSlideShow(bool) ) );
     }
-    }
+}
 
 void GlxSlideShowWidget::removeConnections()
-    {
+{
     TRACER("GlxSlideShowWidget::removeConnections()");
     if ( mEffectEngine )  {
-    disconnect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinshed() ) );
+        disconnect( mEffectEngine, SIGNAL( effectFinished() ), this, SLOT( effectFinshed() ) );
     }
     if ( mSlideTimer ) {
-    disconnect( mSlideTimer, SIGNAL(timeout()), this, SLOT( triggeredEffect() ) );
+        disconnect( mSlideTimer, SIGNAL(timeout()), this, SLOT( triggeredEffect() ) );
     }
     if ( mContinueButton ) {
-    disconnect( mContinueButton, SIGNAL( clicked(bool) ), this, SLOT( continueSlideShow(bool) ) );
+        disconnect( mContinueButton, SIGNAL( clicked(bool) ), this, SLOT( continueSlideShow(bool) ) );
     }
-    }
+}
--- a/ui/views/views.pro	Mon May 17 13:35:26 2010 +0530
+++ b/ui/views/views.pro	Fri May 28 21:11:54 2010 +0530
@@ -20,10 +20,8 @@
 DEPENDPATH += . fullscreenview/inc fullscreenview/src gridview/inc gridview/src slideshowsettingsview/inc slideshowsettingsview/src viewbase/inc
 CONFIG += hb
 
-LIBS += -lglxmediamodel.dll \
-        -lglxlistmodel.dll \
-        -lglxfavmediamodel.dll \
-	-lglximagedecoderwrapper.dll \
+LIBS += -lglxfavmediamodel.dll \
+        -lglximagedecoderwrapper.dll \
         -lglxloggerqt.dll \
         -lshareui.dll \
         -lglxtvout.dll \
@@ -32,15 +30,15 @@
         -lglxlogging.dll \
         -lganeswidgets.dll \
         -lglxmodelwrapper.dll \
-        -lxqsettingsmanager
+        -lglxviewutilities.dll \
+        -lglxzoomwidget.dll
 
 DEFINES += BUILD_GLXVIEWS
 
 INCLUDEPATH += . ../inc \
           ../../inc \
-          ../uiengine/model/mediamodel/inc \
-          ../uiengine/model/listmodel/inc \
-	  ../uiengine/model/favmediamodel/inc \
+	  ../widgets/glxzoomwidget/inc \
+          ../uiengine/model/favmediamodel/inc \
           ../uiengine/medialistwrapper/inc \
           ../viewbase/inc \
           ../../commonutilities/imagedecoderwrapper/inc \
@@ -48,6 +46,8 @@
           ../../traces \
           ../../tvout/tvoutwrapper/inc \
           ../uiengine/model/modelwrapper/inc \
+          ../viewutilities/effectengine/inc \
+          ../viewutilities/settingutility/inc \
           /epoc32/include/mw/hgwidgets
 
 symbian: { 
@@ -61,39 +61,28 @@
 HEADERS += viewbase/inc/glxview.h \
            fullscreenview/inc/glxcoverflow.h \
            fullscreenview/inc/glxfullscreenview.h \
-	   fullscreenview/inc/glxzoomwidget.h \
            detailsview/inc/glxdetailsview.h  \
            detailsview/inc/glxdetailscustomwidgets.h  \
            detailsview/inc/glxdetailscustomicon.h \
            gridview/inc/glxgridview.h \
-					 slideshowsettingsview/inc/glxslideshowsettingsview.h \
+           slideshowsettingsview/inc/glxslideshowsettingsview.h \
            listview/inc/glxlistview.h \
-           effectengine/inc/glxeffectengine.h \
            slideshowview/inc/glxslideshowview.h \
            slideshowview/inc/glxslideshowwidget.h \
-           effectengine/effectplugin/inc/glxeffectpluginbase.h \
-           effectengine/effectplugin/inc/glxbackwardtransitionplugin.h \
-           effectengine/effectplugin/inc/glxforwardtransitionplugin.h \
-           effectengine/effectplugin/inc/glxfadeplugin.h \
-	   	   docloaders/inc/glxviewdocloader.h \
+           docloaders/inc/glxviewdocloader.h \
            viewsfactory/inc/glxviewsfactory.h \
            
 SOURCES += viewbase/src/glxview.cpp \
            fullscreenview/src/glxcoverflow.cpp \
            fullscreenview/src/glxfullscreenview.cpp \
-	   fullscreenview/src/glxzoomwidget.cpp \
 	   detailsview/src/glxdetailsview.cpp \
            detailsview/src/glxdetailscustomwidgets.cpp \
            detailsview/src/glxdetailscustomicon.cpp \
            gridview/src/glxgridview.cpp \
            slideshowsettingsview/src/glxslideshowsettingsview.cpp \
            listview/src/glxlistview.cpp \
-           effectengine/src/glxeffectengine.cpp \
            slideshowview/src/glxslideshowview.cpp \
            slideshowview/src/glxslideshowwidget.cpp \
-           effectengine/effectplugin/src/glxbackwardtransitionplugin.cpp \
-           effectengine/effectplugin/src/glxforwardtransitionplugin.cpp \
-           effectengine/effectplugin/src/glxfadeplugin.cpp \
 	   docloaders/src/glxviewdocloader.cpp \
            viewsfactory/src/glxviewsfactory.cpp
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectengine/inc/glxeffectengine.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,158 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+#ifndef GLXEFFECTENGINE_H
+#define GLXEFFECTENGINE_H
+
+#ifdef BUILD_GLXVIEWUTILITIES
+#define GLX_VIEWUTILITIES_EXPORT Q_DECL_EXPORT
+#else
+#define GLX_VIEWUTILITIES_EXPORT Q_DECL_IMPORT
+#endif
+
+#include <QObject>
+#include <hbeffect.h>
+#include <QString>
+#include <QHash>
+#include <QList>
+#include "glxuistd.h"
+
+
+class QStringList ;
+class GlxTransitionEffectSetting ;
+class GlxEffectPluginBase;
+class GlxEffectPluginResolver;
+
+/*
+ * It is customise class for Photo Application to run the effect.
+ */
+
+class GLX_VIEWUTILITIES_EXPORT GlxEffectEngine : public QObject
+{
+    Q_OBJECT
+    
+public:
+    /*
+     * Constructor
+     */
+    GlxEffectEngine( );
+    /*
+     * Destructor
+     */
+    ~GlxEffectEngine();
+    
+    /*
+     * Register the item type with selected effect
+     * User can change the effect at run time so it is required to register and deregister the effect
+     * before playing the effect.
+     */
+    void registerEffect(const QString &itemType);
+    
+    /*
+     * Deregister the current register slide show effect
+     */
+    void deRegisterEffect(const QString &itemType);
+    
+   /*  
+    *  To register a set of transition effect 
+    *  e.g "grid to full screeen", "fullscreen to grid"  
+    */  
+    void registerTransitionEffect();
+    
+    /*
+     * Deregister the set of register transition effect
+     */
+    void deregistertransitionEffect();
+    
+    /*
+     * Run the effect on single item
+     */
+    void runEffect(QGraphicsItem *  item, const QString &  itemType ); 
+    
+    /*
+     * Run the effect on multiple item
+     */
+    void runEffect(QList< QGraphicsItem * > &  items, const QString &  itemType );
+    
+    /*
+     * Run the transition effect 
+     */
+    void runEffect(QList< QGraphicsItem * > &  items, GlxEffect transitionEffect);
+    
+    /*
+     * Cancel the runing effect on the given item
+     */
+    void cancelEffect(QGraphicsItem *  item);
+    
+    /*
+     * Cancel the running effect on the given items
+     */
+    void cancelEffect( const QList< QGraphicsItem * > &  items );
+    
+    /*
+     * cancel the runing transition effect
+     */
+    void cancelEffect(QList< QGraphicsItem * > &  items, GlxEffect transitionEffect);
+    
+    /*
+     * Return the running status of the given item
+     */
+    bool isEffectRuning(QGraphicsItem *  item);
+    
+    /*
+     * return the running status of given items
+     */
+    bool isEffectRuning(const QList< QGraphicsItem * > &  items);
+    
+signals:
+    /*
+     * emit the signal of effect finished
+     */
+    void effectFinished();
+    
+public slots:
+    /*
+     * Slot to monitor the slide show effect finished
+     */
+    void slideShowEffectFinished( const HbEffect::EffectStatus &status );
+    
+    /*
+     * Slot to monitor the transi
+     */
+    void transitionEffectFinished( const HbEffect::EffectStatus &status );
+
+private:
+    /*
+     * Initialise the all transition effect
+     */
+    void initTransitionEffect();
+    
+    /*
+     * Clear the all transition effect
+     */
+    void cleanTransitionEfffect();
+    
+private:
+    int mNbrEffectRunning;               //containe the number of effect running
+    GlxEffectPluginBase *mEffectPlugin;  //No ownership
+    QHash<GlxEffect, GlxTransitionEffectSetting *> mTransitionEffectList;
+    GlxEffect mTransitionEffect;
+    GlxEffectPluginResolver *mEffectResolver;
+};
+
+#endif /*GLXEFFECTENGINE_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectengine/inc/glxtransitioneffect.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#ifndef GLXTRANSITIONEFFECT_H
+#define GLXTRANSITIONEFFECT_H
+
+#include <QList>
+
+#include "glxuistd.h"
+
+class QString;
+class QGraphicsItem ;
+
+/*
+ * This class have the views transition effect information
+ */
+class GlxTransitionEffectSetting
+{
+public :
+    GlxTransitionEffectSetting(GlxEffect effect);
+    ~GlxTransitionEffectSetting();
+    
+    QList <QString > effectFileList() { return mEffectFileList ; }
+    QList <QString > itemType() { return mItemType ; }
+    QList <QString > eventType() { return mEventType ; }
+    bool isTransitionLater() { return mTransitionLater ; }
+    QGraphicsItem * animationItem() { return mItem ; }
+    
+    void setEffectFileList( QList <QString > & effectFileList) { mEffectFileList = effectFileList ; }
+    void setItemTypes( QList <QString > & itemType) { mItemType = itemType; }
+    void setEventTypes( QList <QString > & eventType) { mEventType = eventType ; }
+    void setTransitionLater(bool transitionLater) { mTransitionLater = transitionLater ; }
+    void setAnimationItem(QGraphicsItem *item) { mItem = item ;}
+    int count() { return mEffectFileList.count() ; }
+    
+private :
+    void init();
+    
+private :
+    GlxEffect mEffect;     //transition effect type
+    bool mTransitionLater; //second animation will run same time(false) or later (true)
+    QGraphicsItem *mItem; //it will used in the case of animation run later
+    QList <QString > mEffectFileList; //list of fxml file used for animation
+    QList <QString > mItemType; //list of item type 
+    QList <QString > mEventType; //list of event type
+};
+
+#endif //GLXTRANSITIONEFFECT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectengine/src/glxeffectengine.cpp	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,265 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+#include "glxeffectengine.h"
+#include "glxeffectpluginbase.h"
+#include "glxtransitioneffect.h"
+#include "glxsettinginterface.h"
+#include "glxeffectpluginresolver.h"
+
+#include <QDebug>
+
+GlxEffectEngine::GlxEffectEngine( ) 
+    : mNbrEffectRunning( 0 ), 
+      mEffectPlugin( NULL ), 
+      mTransitionEffect( NO_EFFECT ),
+      mEffectResolver( NULL )
+{
+    qDebug("GlxSlideShowEffectEngine::GlxSlideShowEffectEngine()");
+    mTransitionEffectList.clear();
+}
+
+GlxEffectEngine::~GlxEffectEngine()
+{
+    qDebug("GlxSlideShowEffectEngine::~GlxSlideShowEffectEngine()");
+    delete mEffectResolver;
+    mEffectResolver = NULL;
+	
+    cleanTransitionEfffect();
+}
+
+void GlxEffectEngine::registerEffect(const QString &itemType)
+{
+    GlxSettingInterface *settingObj = GlxSettingInterface::instance(); // NO ownership 
+    if ( mEffectResolver == NULL ) {
+        mEffectResolver = new GlxEffectPluginResolver();
+    }
+    /* read the selected effect through the centrep and get the effect plugin object through effect plugin resolver*/
+    mEffectPlugin = mEffectResolver->effectPlugin( settingObj->slideShowEffectId( settingObj->slideShowEffectIndex ( ) ) ); //No ownership
+    
+    QList <QString > effectPathList = mEffectPlugin->effectFileList();
+    
+    qDebug("GlxSlideShowEffectEngine::registerEffect() item type %s file path %s", itemType.utf16(), effectPathList[0].utf16());
+    for ( int i = 0; i < effectPathList.count() ; ++i ) {
+        HbEffect::add(itemType, effectPathList.at(i), QString( "Click%1" ).arg(i));
+    }    
+}
+
+void GlxEffectEngine::deRegisterEffect(const QString &itemType)
+{
+    qDebug("GlxSlideShowEffectEngine::deRegisterEffect() item type %s", itemType.utf16());
+    QList <QString > effectPathList = mEffectPlugin->effectFileList();
+    for ( int i = 0; i < effectPathList.count() ; ++i ) {
+        HbEffect::remove(itemType, effectPathList.at(i), QString( "Click%1" ).arg(i));
+    }
+    mEffectPlugin = NULL;
+}
+
+void GlxEffectEngine::registerTransitionEffect()  
+{
+    qDebug("GlxSlideShowEffectEngine::registerTransitionEffect()");
+    initTransitionEffect();
+}
+
+void GlxEffectEngine::deregistertransitionEffect()
+{
+    qDebug("GlxSlideShowEffectEngine::deregisterTransitionEffect()");
+    cleanTransitionEfffect();
+}
+
+void GlxEffectEngine::runEffect(QGraphicsItem *  item, const QString &  itemType )
+{
+    qDebug("GlxSlideShowEffectEngine::runEffect()1 item type %s", itemType.utf16());
+    HbEffect::start(item, itemType, QString( "Click1" ), this, "slideShowEffectFinished");
+    ++mNbrEffectRunning;
+}
+
+void GlxEffectEngine::runEffect(QList< QGraphicsItem * > &  items, const QString &  itemType )
+{
+    qDebug("GlxSlideShowEffectEngine::runEffect()2 item Type %s", itemType.utf16());
+    mEffectPlugin->setUpItems(items);
+    for ( int i = 0; i < items.count() ; ++i ) {
+        if ( mEffectPlugin->isAnimationLater(i) == FALSE ) {
+            HbEffect::start(items.at(i), itemType, QString( "Click%1").arg(i), this, "slideShowEffectFinished");
+        }
+        ++mNbrEffectRunning;
+    }
+}
+
+void GlxEffectEngine::runEffect(QList< QGraphicsItem * > &  items, GlxEffect transitionEffect)
+{
+    qDebug("GlxSlideShowEffectEngine::runEffect()3 effect type %d ", transitionEffect);
+    
+    GlxTransitionEffectSetting *effectSetting = mTransitionEffectList.value( transitionEffect );
+    
+    if ( effectSetting == NULL || items.count() != effectSetting->count() ) {
+         return;
+    }
+    
+    mTransitionEffect = transitionEffect;
+    for ( int i = 0; i < effectSetting->count() ; ++i) {
+        ++mNbrEffectRunning;
+        if ( ( i == effectSetting->count() -1) && effectSetting->isTransitionLater() )
+        {
+            effectSetting->setAnimationItem( items.at(i) );
+            items.at(i)->hide();
+        }
+        else {
+            HbEffect::start(items.at(i), effectSetting->itemType().at(i), effectSetting->eventType().at(i), this, "transitionEffectFinished");
+        }
+    }    
+}
+
+void GlxEffectEngine::cancelEffect(QGraphicsItem *  item)
+{
+    if ( HbEffect::effectRunning( item, QString( "Click1" ) ) ) {
+        HbEffect::cancel( item, QString( "Click1" ) );
+    }
+}
+
+void GlxEffectEngine::cancelEffect(const QList< QGraphicsItem * > &  items)
+{
+    for ( int i = 0; i < items.count() ; ++i ) {    
+        if ( HbEffect::effectRunning( items.at(i), QString( "Click%1").arg(i) ) ) {
+            HbEffect::cancel( items.at(i), QString( "Click%1").arg(i) );
+        }
+    }
+}
+
+void GlxEffectEngine::cancelEffect(QList< QGraphicsItem * > &  items, GlxEffect transitionEffect)
+{
+    GlxTransitionEffectSetting *effectSetting = mTransitionEffectList.value( transitionEffect );
+    
+    if ( effectSetting == NULL || items.count() != effectSetting->count() ) {
+         return;
+    }
+    
+    for ( int i = 0; i < effectSetting->count() ; ++i) {
+        HbEffect::cancel(items.at(i), effectSetting->eventType().at(i) );
+    }     
+}
+
+bool GlxEffectEngine::isEffectRuning(QGraphicsItem *  item)
+{
+    if ( HbEffect::effectRunning( item, QString( "Click1" ) ) ) {
+        return true;
+    }
+    return false;
+}
+
+bool GlxEffectEngine::isEffectRuning(const QList< QGraphicsItem * > &  items)
+{
+    for ( int i = 0; i < items.count() ; ++i ) {    
+        if ( HbEffect::effectRunning( items.at(i), QString( "Click%1").arg(i) ) ) {
+            return true;
+        }
+    }
+    return false;
+}
+
+void GlxEffectEngine::slideShowEffectFinished( const HbEffect::EffectStatus &status )
+{
+    Q_UNUSED( status )
+    qDebug("GlxSlideShowEffectEngine::slideShowEffectFinished() number of effect %d ", mNbrEffectRunning);
+    
+    --mNbrEffectRunning;
+    
+    if ( mEffectPlugin->isAnimationLater( mNbrEffectRunning) ) {
+        HbEffect::start( mEffectPlugin->animationItem(), mEffectPlugin->ItemType(), QString( "Click%1").arg(mNbrEffectRunning), this, "slideShowEffectFinished");
+    }
+    
+    if (mNbrEffectRunning == 0) {
+        emit effectFinished();
+    }
+}
+
+void GlxEffectEngine::transitionEffectFinished( const HbEffect::EffectStatus &status )
+{
+    Q_UNUSED( status )
+    qDebug("GlxSlideShowEffectEngine::transitionEffectFinished() number of effect %d status %d", mNbrEffectRunning, status.reason);
+    
+    --mNbrEffectRunning;
+    if ( mNbrEffectRunning == 1 ) {
+        GlxTransitionEffectSetting *effectSetting = mTransitionEffectList.value( mTransitionEffect );
+        if (  effectSetting->isTransitionLater() ){ 
+            effectSetting->animationItem()->show();
+            HbEffect::start( effectSetting->animationItem(), effectSetting->itemType().at(1), effectSetting->eventType().at(1), this, "transitionEffectFinished");
+            mTransitionEffect = NO_EFFECT;
+        }    
+    }
+    
+    if (mNbrEffectRunning == 0) {
+        emit effectFinished();
+    }
+}
+
+void GlxEffectEngine::initTransitionEffect()
+{
+    GlxTransitionEffectSetting *effectSetting = NULL;
+    
+    effectSetting = new GlxTransitionEffectSetting(GRID_TO_FULLSCREEN);
+    for ( int i = 0; i < effectSetting->count(); ++i ) {
+        HbEffect::add( effectSetting->itemType().at(i), effectSetting->effectFileList().at(i), effectSetting->eventType().at(i)) ;
+    }
+    mTransitionEffectList[GRID_TO_FULLSCREEN] = effectSetting;
+    
+    effectSetting = new GlxTransitionEffectSetting( FULLSCREEN_TO_GRID );
+    for ( int i = 0; i < effectSetting->count(); ++i ) {
+        HbEffect::add( effectSetting->itemType().at(i), effectSetting->effectFileList().at(i), effectSetting->eventType().at(i)) ;
+    }
+    mTransitionEffectList[FULLSCREEN_TO_GRID] = effectSetting;
+    
+    effectSetting = new GlxTransitionEffectSetting( GRID_TO_ALBUMLIST );
+    for ( int i = 0; i < effectSetting->count(); ++i ) {
+        HbEffect::add( effectSetting->itemType().at(i), effectSetting->effectFileList().at(i), effectSetting->eventType().at(i)) ;
+    }
+    mTransitionEffectList[GRID_TO_ALBUMLIST] = effectSetting;
+    
+    effectSetting = new GlxTransitionEffectSetting( ALBUMLIST_TO_GRID );
+    for ( int i = 0; i < effectSetting->count(); ++i ) {
+        HbEffect::add( effectSetting->itemType().at(i), effectSetting->effectFileList().at(i), effectSetting->eventType().at(i)) ;
+    }
+    mTransitionEffectList[ALBUMLIST_TO_GRID] = effectSetting;
+    
+    effectSetting = new GlxTransitionEffectSetting( FULLSCREEN_TO_DETAIL );
+    for ( int i = 0; i < effectSetting->count(); ++i ) {
+        HbEffect::add( effectSetting->itemType().at(i), effectSetting->effectFileList().at(i), effectSetting->eventType().at(i)) ;
+    }
+    mTransitionEffectList[FULLSCREEN_TO_DETAIL] = effectSetting; 
+    
+    effectSetting = new GlxTransitionEffectSetting( DETAIL_TO_FULLSCREEN );
+    for ( int i = 0; i < effectSetting->count(); ++i ) {
+        HbEffect::add( effectSetting->itemType().at(i), effectSetting->effectFileList().at(i), effectSetting->eventType().at(i)) ;
+    }
+    mTransitionEffectList[DETAIL_TO_FULLSCREEN] = effectSetting;    
+}
+
+void GlxEffectEngine::cleanTransitionEfffect()
+{	
+    qDebug("GlxSlideShowEffectEngine::cleanTrnastionEfffect()");
+    
+    foreach( GlxTransitionEffectSetting *list, mTransitionEffectList) {
+        for ( int i = 0; i < list->count(); ++i ) {
+            HbEffect::remove( list->itemType().at(i), list->effectFileList().at(i), list->eventType().at(i)) ;
+        }
+        delete list;
+    }
+    mTransitionEffectList.clear();	
+    
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectengine/src/glxtransitioneffect.cpp	Fri May 28 21:11:54 2010 +0530
@@ -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:   ?Description
+*
+*/
+
+#include <glxtransitioneffect.h>
+
+#include <QString>
+
+GlxTransitionEffectSetting::GlxTransitionEffectSetting(GlxEffect effect): mEffect(effect), mTransitionLater(false), mItem(0)
+{
+    qDebug("GlxTransitionEffectSetting::GlxTransitionEffectSetting() effect id %d ", effect);
+    mEffectFileList.clear();
+    mItemType.clear();
+    mEventType.clear();
+    init();
+}
+
+void GlxTransitionEffectSetting::init()
+{
+    qDebug("GlxTransitionEffectSetting::init() effect id %d ", mEffect);
+    
+    switch( mEffect ) {
+        case GRID_TO_FULLSCREEN :
+            mEffectFileList.append( QString(":/data/gridtofullscreenhide.fxml"));
+            mItemType.append( QString("HbGridViewItem") );
+            mEventType.append(QString("click1") );
+            
+            mEffectFileList.append( QString(":/data/gridtofullscreenshow.fxml"));
+            mItemType.append( QString("HbView") );
+            mEventType.append(QString("click2") );
+            break;
+            
+        case FULLSCREEN_TO_GRID :
+            mEffectFileList.append( QString(":/data/fullscreentogrid.fxml"));
+            mItemType.append( QString("HbGridView") );
+            mEventType.append(QString("click3") );
+            break;
+            
+        case GRID_TO_ALBUMLIST:
+            mEffectFileList.append( QString(":/data/gridtoalbumlisthide.fxml"));
+            mItemType.append( QString("HbView") );
+            mEventType.append(QString("click4") );
+                        
+            mEffectFileList.append( QString(":/data/gridtoalbumlist.fxml"));
+            mItemType.append( QString("HbListView") );
+            mEventType.append(QString("click5") );
+            break;
+             
+        case ALBUMLIST_TO_GRID:
+            mEffectFileList.append( QString(":/data/albumlisttogrid.fxml"));
+            mItemType.append( QString("HbListView") );
+            mEventType.append(QString("click6") );
+                        
+            mEffectFileList.append( QString(":/data/albumlisttogridshow.fxml"));
+            mItemType.append( QString("HbView") );
+            mEventType.append(QString("click7") );
+            break;
+            
+        case FULLSCREEN_TO_DETAIL :
+            mEffectFileList.append( QString(":/data/view_flip_hide.fxml"));
+            mItemType.append( QString("HbView") );
+            mEventType.append(QString("click8") );
+                        
+            mEffectFileList.append( QString(":/data/view_flip_show.fxml"));
+            mItemType.append( QString("HbView") );
+            mEventType.append(QString("click9") );
+            mTransitionLater = true;
+            break;
+            
+        case DETAIL_TO_FULLSCREEN :
+            mEffectFileList.append( QString(":/data/view_flip_hide.fxml"));
+            mItemType.append( QString("HbView") );
+            mEventType.append(QString("click10") );
+                        
+            mEffectFileList.append( QString(":/data/view_flip_show.fxml"));
+            mItemType.append( QString("HbView") );
+            mEventType.append(QString("click11") );
+            mTransitionLater = true;
+            break;            
+            
+        default :
+            break;
+    }    
+}
+
+GlxTransitionEffectSetting::~GlxTransitionEffectSetting()
+{
+    qDebug("GlxTransitionEffectSetting::~GlxTransitionEffectSetting() effect id %d ", mEffect);
+    mEffectFileList.clear();
+    mItemType.clear();
+    mEventType.clear();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/inc/glxeffectpluginbase.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,77 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#ifndef GLXEFFECTPLUGINBASE_H
+#define GLXEFFECTPLUGINBASE_H
+
+#include <QList>
+#include <QString>
+#include <QGraphicsItem>
+
+/*
+ * It is based class of diffetent animation plugin.
+ * These Plugin mostly used for playing the animation in slide show
+ */
+
+class GlxEffectPluginBase 
+{
+public :
+    /*
+     * Constructor
+     */
+    GlxEffectPluginBase( int effectId ) { mEffectId = effectId ;  }
+    
+    /*
+     * Destructor
+     */
+    virtual ~GlxEffectPluginBase() {}
+    
+    /*
+     * return the list of effect file's 
+     */
+    virtual QList <QString > effectFileList() = 0;
+    
+    /*
+     * Setup the item's postion and other properties before plaing the animation
+     */
+    virtual void setUpItems( QList< QGraphicsItem * > &  items ) { Q_UNUSED( items ) }
+
+    /*
+     * second animation will run same time(false) or later (true)
+     */    
+    virtual bool isAnimationLater(int index) 
+    { 
+        Q_UNUSED( index )
+        return false ; 
+    }
+    
+    /*
+     * Return the item type of animated object
+     */
+    virtual QString ItemType() { return QString("HbIconItem") ; }
+    
+    /*
+     * Return the animation object
+     */
+    virtual QGraphicsItem * animationItem() { return NULL; }
+    
+private :
+    int mEffectId ;
+
+};
+
+#endif /*GLXEFFECTPLUGINBASE_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/inc/glxeffectpluginresolver.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+#ifndef GLXEFFECTPLUGINRESOLVER_H
+#define GLXEFFECTPLUGINRESOLVER_H
+
+#include <hbeffect.h>
+#include <QHash>
+
+#include "glxuistd.h"
+
+class GlxEffectPluginBase ;
+class QString ;
+
+class GlxEffectPluginResolver 
+{ 
+
+public :
+    /*
+     * Constructor
+     */
+    GlxEffectPluginResolver( );
+    
+    /*
+     * Return the name of the effect
+     */
+    static QString effectName( int effectId );
+    
+    /*
+     * Return the effect plugin instance to run the effect
+     */
+    GlxEffectPluginBase * effectPlugin( int effectId );
+    
+    /*
+     * Destructor
+     */
+    ~GlxEffectPluginResolver( );
+    
+private :
+    QHash< GlxEffect, GlxEffectPluginBase * > mEffectPluginList ;
+};
+
+
+#endif //GLXEFFECTPLUGINRESOLVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/inc/glxfadeeffectplugin.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#ifndef GLXFADEEFFECTPLUGIN_H
+#define GLXFADEEFFECTPLUGIN_H
+
+#include "glxeffectpluginbase.h"
+
+class QString ;
+
+class GlxFadeEffectPlugin : public GlxEffectPluginBase
+{
+public :
+    /*
+     * Constructor
+     */
+    GlxFadeEffectPlugin();
+    
+    /*
+     *  Destructor
+     */
+    ~GlxFadeEffectPlugin();
+    
+    /*
+     * return the fade in and fade out fxml file list
+     */
+    QList <QString > effectFileList() { return mEffectFileList ; }
+    
+   /*
+    * setup the item postion and set the mItem value
+    */
+    void setUpItems( QList< QGraphicsItem * > &  items );
+    
+    /*
+     * get the name of the effect, use to shown in the slide show setting view
+     */
+    static QString effectName(); 
+	
+private :
+    QList <QString > mEffectFileList;
+};
+
+#endif /* GLXFADEEFFECTPLUGIN_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/inc/glxflipeffectplugin.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,68 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+#ifndef GLXFLIPEFFECTPLUGIN_H
+#define GLXFLIPEFFECTPLUGIN_H
+
+#include "glxeffectpluginbase.h"
+
+class GlxFlipEffectPlugin : public GlxEffectPluginBase
+{
+public :
+    /*
+     *  Constructor
+     */
+    GlxFlipEffectPlugin();
+    
+    /*
+     *  Destructor
+     */
+    ~GlxFlipEffectPlugin();
+    
+    /*
+     *  Get the flip hide and Flip Show file list
+     */
+    QList <QString > effectFileList() { return mEffectFileList; }
+    
+    /*
+     * setup the item postion and set the mItem value
+     */
+    void setUpItems( QList< QGraphicsItem * > &  items );
+    
+    /*
+     * second animation will be run later
+     */    
+    bool isAnimationLater(int index) ;
+    
+    /*
+     *  return the second animation object to play the flip show animation
+     */
+    QGraphicsItem * animationItem() ;
+    
+    /*
+     * get the name of the effect, use to shown in the slide show setting view
+     */
+    static QString effectName() { return QString ("Flip") ; }
+	
+private :
+    QList <QString > mEffectFileList;
+    QGraphicsItem *mItem;
+};
+
+#endif /*GLXFLIPEFFECTPLUGIN_H*/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/inc/glxzoominoutplugin.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,57 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+#ifndef GLXZOOMINOUTEFFECTPLUGIN_H
+#define GLXZOOMINOUTEFFECTPLUGIN_H
+
+#include "glxeffectpluginbase.h"
+
+class GlxZoomInOutEffectPlugin : public GlxEffectPluginBase
+{
+public :
+    /*
+     *  Constructor
+     */
+    GlxZoomInOutEffectPlugin();
+    
+    /*
+     *  Destructor
+     */
+    ~GlxZoomInOutEffectPlugin();
+    
+    /*
+     *  Get the flip hide and Flip Show file list
+     */
+    QList <QString > effectFileList() { return mEffectFileList; }
+    
+    /*
+     * setup the item postion and set the mItem value
+     */
+    void setUpItems( QList< QGraphicsItem * > &  items );
+    
+    /*
+     * get the name of the effect, use to shown in the slide show setting view
+     */
+    static QString effectName() { return QString ("ZoomInOut") ; }
+    
+private :
+    QList <QString > mEffectFileList;
+    QGraphicsItem *mItem;
+};
+
+#endif /*GLXZOOMINOUTEFFECTPLUGIN_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/src/glxeffectpluginresolver.cpp	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#include <QString>
+
+#include "glxeffectpluginresolver.h"
+#include "glxeffectpluginbase.h"
+#include "glxfadeeffectplugin.h"
+#include "glxflipeffectplugin.h"
+#include "glxzoominoutplugin.h"
+
+GlxEffectPluginResolver::GlxEffectPluginResolver()
+{
+    mEffectPluginList.clear();
+}
+
+QString GlxEffectPluginResolver::effectName( int effectId )
+{
+    switch ( effectId ) {
+    case FLIP_EFFECT :
+        return GlxFlipEffectPlugin::effectName();
+        
+    case SMOOTH_FADE :
+        return GlxFadeEffectPlugin::effectName() ;
+    
+    case ZOOM_TO_FACE :
+        return GlxZoomInOutEffectPlugin::effectName(); //To:Do temp remove once plugin is ready
+        
+    default :
+        return GlxFadeEffectPlugin::effectName() ;
+    }
+}
+
+GlxEffectPluginBase *GlxEffectPluginResolver::effectPlugin( int effectId )
+{
+    GlxEffectPluginBase * effectPlugin = mEffectPluginList.value( ( GlxEffect  )effectId );
+    if ( effectPlugin ) {
+        return  effectPlugin ;
+    }
+    
+    switch ( effectId ) {
+        case FLIP_EFFECT :
+            effectPlugin = new GlxFlipEffectPlugin();
+            mEffectPluginList[ FLIP_EFFECT ] = effectPlugin ;
+            break ;
+            
+        case ZOOM_TO_FACE :
+            effectPlugin = new GlxZoomInOutEffectPlugin() ;
+            mEffectPluginList[ ZOOM_TO_FACE ] = effectPlugin ;
+            break ;
+            
+        case SMOOTH_FADE :   
+        default :
+            effectPlugin = mEffectPluginList.value( SMOOTH_FADE );
+            if ( effectPlugin == NULL ) {
+                effectPlugin = new GlxFadeEffectPlugin();
+                mEffectPluginList[ SMOOTH_FADE ] = effectPlugin ;
+            }
+            break ;
+    } 
+
+    return effectPlugin ;
+}
+
+GlxEffectPluginResolver::~GlxEffectPluginResolver()
+{
+    foreach( GlxEffectPluginBase *list, mEffectPluginList) {
+        delete list;
+        list = NULL;
+    }
+    mEffectPluginList.clear();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/src/glxfadeeffectplugin.cpp	Fri May 28 21:11:54 2010 +0530
@@ -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:   ?Description
+*
+*/
+
+
+#include "glxfadeeffectplugin.h"
+#include "glxuistd.h"
+#include "glxlocalisationstrings.h"
+
+GlxFadeEffectPlugin::GlxFadeEffectPlugin() : GlxEffectPluginBase( SMOOTH_FADE )
+{
+    mEffectFileList.append(QString(":/data/opacity_deactivate.fxml"));
+    mEffectFileList.append(QString(":/data/opacity_activate.fxml"));
+}
+
+void GlxFadeEffectPlugin::setUpItems( QList< QGraphicsItem * > &  items )
+{
+    if ( items.count() < 2 ) 
+        return;
+   
+    items.at(0)->setPos(0,0);
+    items.at(1)->setPos(0,0);
+}
+
+QString GlxFadeEffectPlugin::effectName() 
+{ 
+    return ( GLX_VAL_SMOOTH_FADE ) ; 
+}
+
+GlxFadeEffectPlugin::~GlxFadeEffectPlugin()
+{
+    mEffectFileList.clear();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/src/glxflipeffectplugin.cpp	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+#include "glxflipeffectplugin.h"
+#include "glxuistd.h"
+
+GlxFlipEffectPlugin::GlxFlipEffectPlugin() : GlxEffectPluginBase( FLIP_EFFECT )
+{
+    mEffectFileList.append(QString(":/data/view_flip_hide.fxml"));
+    mEffectFileList.append(QString(":/data/view_flip_show.fxml"));
+}
+
+void GlxFlipEffectPlugin::setUpItems( QList< QGraphicsItem * > &  items )
+{
+    if ( items.count() < 2 ) 
+        return;
+    
+    mItem = items.at(1);
+    mItem->hide();
+    mItem->setPos(0,0);
+    items.at(0)->setPos(0,0);
+}
+
+bool GlxFlipEffectPlugin::isAnimationLater(int index) 
+{
+    if ( index == 1) {
+        return true;
+    }
+    return false;
+}
+
+QGraphicsItem * GlxFlipEffectPlugin::animationItem() 
+{ 
+    mItem->show();
+    return mItem ; 
+}
+
+GlxFlipEffectPlugin::~GlxFlipEffectPlugin()
+{
+    mEffectFileList.clear();
+}
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/effectplugin/src/glxzoominoutplugin.cpp	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+
+#include "glxzoominoutplugin.h"
+#include "glxuistd.h"
+
+GlxZoomInOutEffectPlugin::GlxZoomInOutEffectPlugin() : GlxEffectPluginBase( ZOOM_TO_FACE )
+{
+    mEffectFileList.append(QString(":/data/zoomin.fxml"));
+    mEffectFileList.append(QString(":/data/zoomout.fxml"));
+}
+
+void GlxZoomInOutEffectPlugin::setUpItems( QList< QGraphicsItem * > &  items )
+{
+    if ( items.count() < 2 ) 
+        return;
+    
+    mItem = items.at(1);
+    mItem->setPos(0,0);
+    items.at(0)->setPos(0,0);
+}
+
+GlxZoomInOutEffectPlugin::~GlxZoomInOutEffectPlugin()
+{
+    mEffectFileList.clear();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/settingutility/inc/glxsetting.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#ifndef GLXSETTING_H
+#define GLXSETTING_H
+
+
+#include <glxsettinginterface.h>
+
+class XQSettingsKey;
+class XQSettingsManager;
+class QStringList;
+
+#define NBR_SLIDESHOW_EFFECT 3
+
+/*
+ * This class is used for read and write the photos application related setting from the centrep.
+ */
+class GlxSetting : public GlxSettingInterface
+{
+
+public :
+    /*
+     * It will return the singlton object of this class
+     */
+	static GlxSettingInterface * instance(); 
+	    
+    /* 
+     * Returns the index to the selected transition effect
+     * This value is fetched from Central repository 
+     */
+    int slideShowEffectIndex() ;
+    
+    /*
+     * SlideShowSettingsView will call this API to set the index of the transition effect chosen. 
+     * This data will be written to the Central Repository
+     */
+     void setslideShowEffectIndex( int index );
+    
+    /* 
+     * Returns the index to the selected transition delay /
+     * This value is fetched from Central repository 
+     */
+    int slideShowDelayIndex();
+    
+    /*
+     * SlideShowSettingsView will call this API to set the index of the transition delay chosen. 
+     * This data will be written to the Central Repository
+     */
+    void setSlideShowDelayIndex( int index );
+    
+    /*
+     * It will return the slide show delay time for playing the slide show.
+     * This value is fetched for central repository
+     */
+    int slideShowDelayTime() ;
+    
+    /*
+     * This will return the list of effects as available in the central repository 
+     */
+    QStringList slideShowEffectList();
+    
+    /*
+     * This will return the effect ID based on the effect index 
+     * Effect index will be 0,1,2... and effect ID is GLX_EFFECT
+     * Effect id is store in the centrep with respect to index.
+     */
+    int slideShowEffectId( int index ) ;
+    
+protected :
+    /*
+     * Constructor
+     */
+    GlxSetting( );
+    
+    /*
+     * Copy Constructor
+     */
+    GlxSetting( GlxSetting & );
+    
+    /*
+     * Destructor
+     */
+    ~GlxSetting();
+	
+private :    
+    XQSettingsManager *mSettingsManager;
+    XQSettingsKey *mTransitionEffectCenrepKey;
+    XQSettingsKey *mTransitionDelayCenrepKey;
+    
+    XQSettingsKey *mSlideShowEffectCenRepKey[ NBR_SLIDESHOW_EFFECT ];
+    
+    
+    XQSettingsKey *mSlowCenRepKey;
+    XQSettingsKey *mMediumCenRepKey;
+    XQSettingsKey *mFastCenRepKey;
+    
+    static GlxSetting mObj;
+};
+
+
+
+#endif //GLXSETTING_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/settingutility/inc/glxsettinginterface.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,103 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#ifndef GLXSETTINGINTERFACE_H
+#define GLXSETTINGINTERFACE_H
+
+#include <qglobal.h>
+
+#ifdef BUILD_GLXVIEWUTILITIES
+#define GLX_VIEWUTILITIES_EXPORT Q_DECL_EXPORT
+#else
+#define GLX_VIEWUTILITIES_EXPORT Q_DECL_IMPORT
+#endif
+
+class QStringList ;
+
+/*
+ * This is an interface for read and write the photos application related setting from the centrep.
+ */
+class GLX_VIEWUTILITIES_EXPORT GlxSettingInterface
+{
+
+public :
+    /*
+     * return the instance of the GlxSetting
+     */
+	static GlxSettingInterface * instance();
+    
+    /* 
+     * Returns the index to the selected transition effect
+     * This value is fetched from Central repository 
+     */
+    virtual int slideShowEffectIndex() = 0 ;
+    
+    /*
+     * SlideShowSettingsView will call this API to set the index of the transition effect chosen. 
+     * This data will be written to the Central Repository
+     */
+    virtual void setslideShowEffectIndex( int index ) = 0 ;
+    
+    /* 
+     * Returns the index to the selected transition delay 
+     * This value is fetched from Central repository 
+     */
+    virtual int slideShowDelayIndex() = 0 ;
+    
+    /*
+     * SlideShowSettingsView will call this API to set the index of the transition delay chosen. 
+     * This data will be written to the Central Repository
+     */
+    virtual void setSlideShowDelayIndex( int index ) = 0;
+    
+    /*
+     * It will return the slide show delay time for playing the slide show.
+     * This value is fetched for central repository
+     */
+    virtual int slideShowDelayTime() = 0;
+    
+    /*
+     * This will return the list of effects as available in the central repository 
+     */
+    virtual QStringList slideShowEffectList() = 0;
+    
+    /*
+     * This will return the effect ID based on the effect index 
+     * Effect index will be 0,1,2... and effect ID is GLX_EFFECT
+     * Effect id is store in the centrep with respect to index.
+     */
+    virtual int slideShowEffectId( int index ) = 0;
+    
+protected :
+    /*
+     * Constructor
+     */
+    GlxSettingInterface( );
+    
+    /*
+     * Copy Constructor
+     */
+    GlxSettingInterface( GlxSettingInterface & );
+    
+    /*
+     * Destructor
+     */
+    virtual ~GlxSettingInterface() ;
+};
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/settingutility/src/glxsetting.cpp	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,138 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#include <xqsettingsmanager.h>
+#include <xqsettingskey.h>
+#include <QStringList>
+
+#include "glxsetting.h"
+#include "glxeffectpluginresolver.h"
+#include "glxuistd.h"
+
+
+const TUint32 KGlxTransitionEffect     = 0x1;
+const TUint32 KGlxTransitionDelay  = 0x2;
+const TUint32 KGlxSlow  = 0x3;
+const TUint32 KGlxMeduim  = 0x4;
+const TUint32 KGlxFast  = 0x5;
+const TUint32 KGlxSlideShowEffect[ ]  = { 0x6, 0x7, 0x8 };
+const TUint32 KCRUidGallery = 0x20007194;
+
+GlxSetting GlxSetting::mObj ;
+
+
+GlxSetting::GlxSetting(  ) 
+{
+    mSettingsManager = new XQSettingsManager();
+    mTransitionEffectCenrepKey = new XQSettingsKey( XQSettingsKey::TargetCentralRepository, KCRUidGallery , KGlxTransitionEffect );
+    mTransitionDelayCenrepKey = new XQSettingsKey( XQSettingsKey::TargetCentralRepository, KCRUidGallery , KGlxTransitionDelay );
+    mSlowCenRepKey = new XQSettingsKey( XQSettingsKey::TargetCentralRepository, KCRUidGallery ,KGlxSlow );
+    mMediumCenRepKey = new XQSettingsKey( XQSettingsKey::TargetCentralRepository, KCRUidGallery ,KGlxMeduim );
+    mFastCenRepKey = new XQSettingsKey( XQSettingsKey::TargetCentralRepository, KCRUidGallery ,KGlxFast );
+
+    for ( int i = 0; i < NBR_SLIDESHOW_EFFECT; i++ ) {
+        mSlideShowEffectCenRepKey[ i ] = new XQSettingsKey( XQSettingsKey::TargetCentralRepository, KCRUidGallery , KGlxSlideShowEffect[ i ] );
+    }
+}
+
+GlxSetting::GlxSetting( GlxSetting & )
+{
+
+}
+
+GlxSetting::~GlxSetting( )
+{            
+    delete mFastCenRepKey;
+    delete mMediumCenRepKey;
+    delete mSlowCenRepKey;
+    delete mTransitionDelayCenrepKey;
+    delete mTransitionEffectCenrepKey;
+    delete mSettingsManager;
+    
+    for ( int i = 0 ; i < NBR_SLIDESHOW_EFFECT ; i++ ) {
+        delete mSlideShowEffectCenRepKey[ i ];
+    }
+}
+
+GlxSettingInterface * GlxSetting::instance()
+{
+    return &mObj ;
+}
+
+int GlxSetting::slideShowEffectIndex()
+{
+    QVariant effectvalue = mSettingsManager->readItemValue(*mTransitionEffectCenrepKey);
+    return effectvalue.toInt();
+}
+
+void GlxSetting::setslideShowEffectIndex( int index )
+{
+    mSettingsManager->writeItemValue( *mTransitionEffectCenrepKey, index ) ;
+}
+
+int GlxSetting::slideShowDelayIndex()
+{
+    QVariant effectvalue = mSettingsManager->readItemValue(*mTransitionDelayCenrepKey);
+    return effectvalue.toInt();
+}
+
+void GlxSetting::setSlideShowDelayIndex( int index )
+{
+    mSettingsManager->writeItemValue(*mTransitionDelayCenrepKey, index);
+}
+
+int GlxSetting::slideShowDelayTime()
+{
+    QVariant effectvalue = mSettingsManager->readItemValue(*mTransitionDelayCenrepKey);
+    switch ( effectvalue.toInt() ) {
+    case SLOW:
+        return mSettingsManager->readItemValue(*mSlowCenRepKey).toInt();
+        
+    case MEDIUM:
+        return mSettingsManager->readItemValue(*mMediumCenRepKey).toInt();
+
+    case FAST:
+        return mSettingsManager->readItemValue(*mFastCenRepKey).toInt();
+
+     default:
+        return 3000;
+     }
+}
+
+QStringList GlxSetting::slideShowEffectList()
+{
+    QStringList effectList;
+    effectList.clear();
+    int effectId = 0;
+    
+    for ( int i = 0 ; i < NBR_SLIDESHOW_EFFECT ; i++ ) {
+        effectId = mSettingsManager->readItemValue( * mSlideShowEffectCenRepKey[ i ] ).toInt() ;
+        effectList << GlxEffectPluginResolver::effectName ( effectId );
+    }
+    
+    return effectList;
+}
+
+int GlxSetting::slideShowEffectId( int index )
+{
+    if ( index >= NBR_SLIDESHOW_EFFECT || index < 0 ) {
+       return NO_EFFECT ;
+    }
+    
+    return mSettingsManager->readItemValue( * mSlideShowEffectCenRepKey[ index ] ).toInt() ;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/settingutility/src/glxsettinginterface.cpp	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   ?Description
+*
+*/
+
+#include <glxsettinginterface.h>
+#include <glxsetting.h>
+
+GlxSettingInterface::GlxSettingInterface()
+{
+}
+
+GlxSettingInterface::~GlxSettingInterface()
+{
+}
+
+GlxSettingInterface::GlxSettingInterface( GlxSettingInterface & )
+{
+}
+
+GlxSettingInterface * GlxSettingInterface::instance()
+{
+    return GlxSetting::instance();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/viewutilities/viewutilities.pro	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,60 @@
+#/* 
+#* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#* All rights reserved.
+#* This component and the accompanying materials are made available
+#* under the terms of "Eclipse Public License v1.0"
+#* which accompanies this distribution, and is available
+#* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#*
+#* Initial Contributors:
+#* Nokia Corporation - initial contribution.
+#*
+#* Contributors:
+#* 
+#* Description:
+#*
+#*/ 
+TEMPLATE = lib
+TARGET = glxviewutilities
+
+DEPENDPATH += . settingutiliy/inc settingutility/src
+CONFIG += hb
+
+LIBS += -lxqsettingsmanager
+
+DEFINES += BUILD_GLXVIEWUTILITIES
+
+INCLUDEPATH += . ../inc \
+          ../../inc \
+          ../../loggers/loggerqt/inc \
+          ../../traces \
+          /epoc32/include/mw/hgwidgets
+
+symbian: { 
+TARGET.UID3 = 0x2000718E
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+TARGET.EPOCALLOWDLLDATA = 1
+TARGET.CAPABILITY = ALL -TCB 
+}
+
+# Input
+HEADERS += settingutility/inc/glxsetting.h \
+           settingutility/inc/glxsettinginterface.h \
+           effectplugin/inc/glxeffectpluginbase.h \
+           effectplugin/inc/glxfadeeffectplugin.h \
+           effectplugin/inc/glxflipeffectplugin.h \
+           effectplugin/inc/glxzoominoutplugin.h \
+           effectplugin/inc/glxeffectpluginresolver.h \
+           effectengine/inc/glxtransitioneffect.h \
+           effectengine/inc/glxeffectengine.h 
+	   	     
+SOURCES += settingutility/src/glxsetting.cpp \
+           settingutility/src/glxsettinginterface.cpp \
+           effectplugin/src/glxfadeeffectplugin.cpp \
+           effectplugin/src/glxflipeffectplugin.cpp \
+           effectplugin/src/glxzoominoutplugin.cpp \
+           effectplugin/src/glxeffectpluginresolver.cpp \
+           effectengine/src/glxtransitioneffect.cpp \
+           effectengine/src/glxeffectengine.cpp
+
+DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT 
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/widgets/bwins/glxzoomwidgetu.def	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,39 @@
+EXPORTS
+	?dataChanged@GlxZoomWidget@@IAEXVQModelIndex@@0@Z @ 1 NONAME ; void GlxZoomWidget::dataChanged(class QModelIndex, class QModelIndex)
+	?limitRequiredSize@GlxZoomWidget@@AAEXAAVQSizeF@@@Z @ 2 NONAME ; void GlxZoomWidget::limitRequiredSize(class QSizeF &)
+	?cleanUp@GlxZoomWidget@@QAEXXZ @ 3 NONAME ; void GlxZoomWidget::cleanUp(void)
+	?setMinMaxZValue@GlxZoomWidget@@QAEXHH@Z @ 4 NONAME ; void GlxZoomWidget::setMinMaxZValue(int, int)
+	?sendDecodeRequest@GlxZoomWidget@@QAEXH@Z @ 5 NONAME ; void GlxZoomWidget::sendDecodeRequest(int)
+	??0GlxZoomWidget@@QAE@PAVQGraphicsItem@@@Z @ 6 NONAME ; GlxZoomWidget::GlxZoomWidget(class QGraphicsItem *)
+	?qt_metacast@GlxZoomWidget@@UAEPAXPBD@Z @ 7 NONAME ; void * GlxZoomWidget::qt_metacast(char const *)
+	?staticMetaObject@GlxZoomWidget@@2UQMetaObject@@B @ 8 NONAME ; struct QMetaObject const GlxZoomWidget::staticMetaObject
+	?tr@GlxZoomWidget@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString GlxZoomWidget::tr(char const *, char const *, int)
+	?sceneEvent@GlxZoomWidget@@MAE_NPAVQEvent@@@Z @ 10 NONAME ; bool GlxZoomWidget::sceneEvent(class QEvent *)
+	?trUtf8@GlxZoomWidget@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString GlxZoomWidget::trUtf8(char const *, char const *)
+	?getFocusedImage@GlxZoomWidget@@AAE?AVQPixmap@@XZ @ 12 NONAME ; class QPixmap GlxZoomWidget::getFocusedImage(void)
+	?setModel@GlxZoomWidget@@QAEXPAVQAbstractItemModel@@@Z @ 13 NONAME ; void GlxZoomWidget::setModel(class QAbstractItemModel *)
+	?finalizeWidgetTransform@GlxZoomWidget@@AAEXXZ @ 14 NONAME ; void GlxZoomWidget::finalizeWidgetTransform(void)
+	?executeGestureEvent@GlxZoomWidget@@AAE_NPAVQGraphicsItem@@PAVQGestureEvent@@@Z @ 15 NONAME ; bool GlxZoomWidget::executeGestureEvent(class QGraphicsItem *, class QGestureEvent *)
+	?zoomImage@GlxZoomWidget@@AAEXMVQPointF@@@Z @ 16 NONAME ; void GlxZoomWidget::zoomImage(float, class QPointF)
+	?activate@GlxZoomWidget@@QAEXXZ @ 17 NONAME ; void GlxZoomWidget::activate(void)
+	?connectDecodeRequestToPinchEvent@GlxZoomWidget@@QAEXXZ @ 18 NONAME ; void GlxZoomWidget::connectDecodeRequestToPinchEvent(void)
+	?indexChanged@GlxZoomWidget@@QAEXH@Z @ 19 NONAME ; void GlxZoomWidget::indexChanged(int)
+	?animateZoomIn@GlxZoomWidget@@QAEXVQPointF@@@Z @ 20 NONAME ; void GlxZoomWidget::animateZoomIn(class QPointF)
+	?getStaticMetaObject@GlxZoomWidget@@SAABUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const & GlxZoomWidget::getStaticMetaObject(void)
+	?animationTimeLineFinished@GlxZoomWidget@@QAEXXZ @ 22 NONAME ; void GlxZoomWidget::animationTimeLineFinished(void)
+	?qt_metacall@GlxZoomWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 23 NONAME ; int GlxZoomWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?zoomWidgetMovedBackground@GlxZoomWidget@@IAEXH@Z @ 24 NONAME ; void GlxZoomWidget::zoomWidgetMovedBackground(int)
+	?animateZoomOut@GlxZoomWidget@@QAEXVQPointF@@@Z @ 25 NONAME ; void GlxZoomWidget::animateZoomOut(class QPointF)
+	?adjustGestureCenter@GlxZoomWidget@@AAEXAAVQPointF@@AAM@Z @ 26 NONAME ; void GlxZoomWidget::adjustGestureCenter(class QPointF &, float &)
+	?metaObject@GlxZoomWidget@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * GlxZoomWidget::metaObject(void) const
+	?decodedImageAvailable@GlxZoomWidget@@QAEXXZ @ 28 NONAME ; void GlxZoomWidget::decodedImageAvailable(void)
+	??_EGlxZoomWidget@@UAE@I@Z @ 29 NONAME ; GlxZoomWidget::~GlxZoomWidget(unsigned int)
+	??1GlxZoomWidget@@UAE@XZ @ 30 NONAME ; GlxZoomWidget::~GlxZoomWidget(void)
+	?sceneEventFilter@GlxZoomWidget@@MAE_NPAVQGraphicsItem@@PAVQEvent@@@Z @ 31 NONAME ; bool GlxZoomWidget::sceneEventFilter(class QGraphicsItem *, class QEvent *)
+	?pinchGestureReceived@GlxZoomWidget@@IAEXH@Z @ 32 NONAME ; void GlxZoomWidget::pinchGestureReceived(int)
+	?setWindowSize@GlxZoomWidget@@QAEXVQSize@@@Z @ 33 NONAME ; void GlxZoomWidget::setWindowSize(class QSize)
+	?retreiveFocusedImage@GlxZoomWidget@@AAEXXZ @ 34 NONAME ; void GlxZoomWidget::retreiveFocusedImage(void)
+	?animationFrameChanged@GlxZoomWidget@@QAEXH@Z @ 35 NONAME ; void GlxZoomWidget::animationFrameChanged(int)
+	?tr@GlxZoomWidget@@SA?AVQString@@PBD0@Z @ 36 NONAME ; class QString GlxZoomWidget::tr(char const *, char const *)
+	?trUtf8@GlxZoomWidget@@SA?AVQString@@PBD0H@Z @ 37 NONAME ; class QString GlxZoomWidget::trUtf8(char const *, char const *, int)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/widgets/eabi/glxzoomwidgetu.def	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,45 @@
+EXPORTS
+	_ZN13GlxZoomWidget10sceneEventEP6QEvent @ 1 NONAME
+	_ZN13GlxZoomWidget11dataChangedE11QModelIndexS0_ @ 2 NONAME
+	_ZN13GlxZoomWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
+	_ZN13GlxZoomWidget11qt_metacastEPKc @ 4 NONAME
+	_ZN13GlxZoomWidget12indexChangedEi @ 5 NONAME
+	_ZN13GlxZoomWidget13animateZoomInE7QPointF @ 6 NONAME
+	_ZN13GlxZoomWidget13setWindowSizeE5QSize @ 7 NONAME
+	_ZN13GlxZoomWidget14animateZoomOutE7QPointF @ 8 NONAME
+	_ZN13GlxZoomWidget15getFocusedImageEv @ 9 NONAME
+	_ZN13GlxZoomWidget15setMinMaxZValueEii @ 10 NONAME
+	_ZN13GlxZoomWidget16sceneEventFilterEP13QGraphicsItemP6QEvent @ 11 NONAME
+	_ZN13GlxZoomWidget16staticMetaObjectE @ 12 NONAME DATA 16
+	_ZN13GlxZoomWidget17limitRequiredSizeER6QSizeF @ 13 NONAME
+	_ZN13GlxZoomWidget17sendDecodeRequestEi @ 14 NONAME
+	_ZN13GlxZoomWidget19adjustGestureCenterER7QPointFRf @ 15 NONAME
+	_ZN13GlxZoomWidget19executeGestureEventEP13QGraphicsItemP13QGestureEvent @ 16 NONAME
+	_ZN13GlxZoomWidget19getStaticMetaObjectEv @ 17 NONAME
+	_ZN13GlxZoomWidget20pinchGestureReceivedEi @ 18 NONAME
+	_ZN13GlxZoomWidget20retreiveFocusedImageEv @ 19 NONAME
+	_ZN13GlxZoomWidget21animationFrameChangedEi @ 20 NONAME
+	_ZN13GlxZoomWidget21decodedImageAvailableEv @ 21 NONAME
+	_ZN13GlxZoomWidget23finalizeWidgetTransformEv @ 22 NONAME
+	_ZN13GlxZoomWidget25animationTimeLineFinishedEv @ 23 NONAME
+	_ZN13GlxZoomWidget25zoomWidgetMovedBackgroundEi @ 24 NONAME
+	_ZN13GlxZoomWidget32connectDecodeRequestToPinchEventEv @ 25 NONAME
+	_ZN13GlxZoomWidget7cleanUpEv @ 26 NONAME
+	_ZN13GlxZoomWidget8activateEv @ 27 NONAME
+	_ZN13GlxZoomWidget8setModelEP18QAbstractItemModel @ 28 NONAME
+	_ZN13GlxZoomWidget9zoomImageEf7QPointF @ 29 NONAME
+	_ZN13GlxZoomWidgetC1EP13QGraphicsItem @ 30 NONAME
+	_ZN13GlxZoomWidgetC2EP13QGraphicsItem @ 31 NONAME
+	_ZN13GlxZoomWidgetD0Ev @ 32 NONAME
+	_ZN13GlxZoomWidgetD1Ev @ 33 NONAME
+	_ZN13GlxZoomWidgetD2Ev @ 34 NONAME
+	_ZNK13GlxZoomWidget10metaObjectEv @ 35 NONAME
+	_ZTI13GlxZoomWidget @ 36 NONAME
+	_ZTV13GlxZoomWidget @ 37 NONAME
+	_ZThn16_N13GlxZoomWidgetD0Ev @ 38 NONAME
+	_ZThn16_N13GlxZoomWidgetD1Ev @ 39 NONAME
+	_ZThn8_N13GlxZoomWidget10sceneEventEP6QEvent @ 40 NONAME
+	_ZThn8_N13GlxZoomWidget16sceneEventFilterEP13QGraphicsItemP6QEvent @ 41 NONAME
+	_ZThn8_N13GlxZoomWidgetD0Ev @ 42 NONAME
+	_ZThn8_N13GlxZoomWidgetD1Ev @ 43 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/widgets/glxzoomwidget/glxzoomwidget.pro	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,48 @@
+#/* 
+#* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#* All rights reserved.
+#* This component and the accompanying materials are made available
+#* under the terms of "Eclipse Public License v1.0"
+#* which accompanies this distribution, and is available
+#* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#*
+#* Initial Contributors:
+#* Nokia Corporation - initial contribution.
+#*
+#* Contributors:
+#* 
+#* Description:
+#*
+#*/ 
+
+
+TEMPLATE = lib
+TARGET = glxzoomwidget
+
+CONFIG += hb
+
+DEFINES += GLXZOOMWIDGET_LIBRARY
+
+LIBS += -lglxmodelwrapper.dll \
+        -lglximagedecoderwrapper.dll \
+
+DEPENDPATH += . inc src
+INCLUDEPATH += . \
+            ../../../commonutilities/imagedecoderwrapper/inc \
+            ../uiengine/model/modelwrapper/inc \
+            ../../inc \
+            ../../../inc 
+
+symbian: { 
+TARGET.UID3 = 0x200104E4
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+TARGET.EPOCALLOWDLLDATA = 1
+TARGET.CAPABILITY = ALL -TCB 
+}
+
+exportfile = "inc/glxzoomwidget.h APP_LAYER_PLATFORM_EXPORT_PATH(glxzoomwidget.h)"
+BLD_INF_RULES.prj_exports += exportfile
+
+# Input
+HEADERS += inc/glxzoomwidget.h inc/glxzoomwidget_global.h
+SOURCES += src/glxzoomwidget.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/widgets/glxzoomwidget/inc/glxzoomwidget.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   glxzoomwidget.h
+*               definition of the class glxzoomwidget which controls the Zoom behavior of coverflow.
+*
+*/
+#ifndef GLXZOOMWIDGET_H
+#define GLXZOOMWIDGET_H
+
+#include <QObject>
+#include <QGraphicsWidget>
+#include <QPixmap>
+#include <hbscrollarea.h>
+
+#include <glxzoomwidget_global.h>
+
+class QGestureEvent;
+class QPinchGesture;
+class HbIconItem;
+class GlxImageDecoderWrapper;
+class QTimeLine;
+
+const int MAXZVALUE = 100;
+const int MINZVALUE = 0;
+
+class GLXZOOMWIDGETSHARED_EXPORT GlxZoomWidget : public HbScrollArea
+{
+    Q_OBJECT
+
+    public:
+    GlxZoomWidget (QGraphicsItem *parent = NULL);
+    ~GlxZoomWidget ();
+    void setModel (QAbstractItemModel *model) ;
+    void indexChanged(int index);
+    void setWindowSize(QSize windowSize);
+    void cleanUp();
+    void activate();
+    void setMinMaxZValue(int minZvalue, int maxZvalue);
+    void connectDecodeRequestToPinchEvent();
+
+    signals:
+    void pinchGestureReceived(int index);
+    void zoomWidgetMovedBackground(int index);
+
+    public slots:
+    //for Decoder support
+    void decodedImageAvailable();
+    void sendDecodeRequest(int index);
+
+	//for animation effects
+	void animateZoomIn(QPointF animRefPoint);
+	void animateZoomOut(QPointF animRefPoint);
+	void animationFrameChanged(int frameNumber);
+	void animationTimeLineFinished();
+
+    protected:
+    bool sceneEvent(QEvent *event);
+    bool sceneEventFilter(QGraphicsItem *watched,QEvent *event);
+    protected slots:
+    void dataChanged(QModelIndex startIndex, QModelIndex endIndex);
+
+
+    private:
+    bool executeGestureEvent(QGraphicsItem *source,QGestureEvent *event);
+    //Responsible for changing the transforms of the widget wrt the ZF and center
+	//Also adjusts the ZF, center and final size so as to respect the boundaries
+    void zoomImage(qreal zoomFactor, QPointF center);
+    //This API will adjust the gesture center to maintain boundaries
+	//called from GlxZoomWidget::zoomImage
+    void adjustGestureCenter(QPointF & gestureCenter, qreal& zoomFactor);
+    //this API will limit the max/min Zoom Size possible
+	//called from GlxZoomWidget::zoomImage
+    void limitRequiredSize(QSizeF &requiredSize);
+	//gets the latest focussed image from the model
+    void retreiveFocusedImage();
+    //finalize the transform and update the sizehint of mZoomWidget
+    void finalizeWidgetTransform();
+    //get the focused image from the model
+    QPixmap getFocusedImage();
+
+    //data members
+    private:
+    //view widgets
+    QGraphicsPixmapItem *mZoomItem;   //Item containing the pixmap
+    QGraphicsWidget *mZoomWidget;     //container :all scaling and transforms would be done on this widget
+    HbIconItem* mBlackBackgroundItem; //for setting black background
+
+    //view Z values 
+    //might push to layouts later
+
+    int mMinZValue ;
+    int mMaxZValue ;
+
+
+    //to be in sync with the model
+    QAbstractItemModel *mModel;
+    int mFocusIndex;
+
+    //size parameter
+    QSizeF mItemSize;        // the actual pixmap size. Keep it updated with latest pixmap size
+    QSizeF mStepCurrentSize; //to save the size before gesture started
+    QSizeF mCurrentSize;     //save sizes scaled by gesture
+    QSize mWindowSize;      //the window size
+    QSizeF mMinScaleSize;   //minimum posible size
+    QSizeF mMinDecScaleSize;   //the Minimum scale limit after which the image scaling down should be decelerated
+    QSizeF mMaxScaleSize;   // the maximum scale limit
+    QSizeF mMaxScaleDecSize;   // the Maximum scale limit after which the image scaling should be decelerated
+	//for animation effect
+	qreal m_FinalAnimatedScaleFactor;
+	QPointF m_AnimRefPoint;
+	QTimeLine *m_AnimTimeLine;
+    //for Decoder support
+    GlxImageDecoderWrapper* mImageDecoder;
+
+    //status flags
+	//To check if the decode request has already been send or not
+    bool mImageDecodeRequestSend; 
+	//To check if the pinch gesture is in progress to block any events to HbScrollArea
+    bool mPinchGestureOngoing; 
+    //to check if decoded image is available
+    bool mDecodedImageAvailable;
+
+};
+#endif  //GLXZOOMWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/widgets/glxzoomwidget/inc/glxzoomwidget_global.h	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,12 @@
+#ifndef GLXZOOMWIDGET_GLOBAL_H
+#define GLXZOOMWIDGET_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#if defined(GLXZOOMWIDGET_LIBRARY)
+#  define GLXZOOMWIDGETSHARED_EXPORT Q_DECL_EXPORT
+#else
+#  define GLXZOOMWIDGETSHARED_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif // GLXZOOMWIDGET_GLOBAL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/widgets/glxzoomwidget/src/glxzoomwidget.cpp	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,482 @@
+ /*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:   glxzoomwidget.cpp
+*               description of the class GlxGlxZoomWidget which controls the Zoom behavior of coverflow.
+*
+*/
+#include <QPinchGesture>
+#include <hbiconitem.h>
+#include <QTimeLine>
+#include <QGesture>
+#include "glximagedecoderwrapper.h"
+#include "glxmodelparm.h"
+#include "glxzoomwidget.h"
+
+GlxZoomWidget::GlxZoomWidget(QGraphicsItem *parent):HbScrollArea(parent), mModel(NULL), mMinZValue(MINZVALUE), mMaxZValue(MAXZVALUE), mImageDecodeRequestSend(false), mPinchGestureOngoing(false), mDecodedImageAvailable(false)
+{
+    grabGesture(Qt::PinchGesture);
+    setAcceptTouchEvents(true) ;
+    setFrictionEnabled(false);
+    setZValue(mMinZValue);
+    //create the child items and background
+    mZoomWidget = new QGraphicsWidget(this);
+    mZoomItem = new QGraphicsPixmapItem(mZoomWidget);
+    mZoomItem->setTransformationMode(Qt::SmoothTransformation);
+    //the black background
+    //replace when a proper substitute for setting backgrounds is known
+    mBlackBackgroundItem = new HbIconItem(this);
+    mBlackBackgroundItem->setBrush(QBrush(Qt::black));
+    mBlackBackgroundItem->hide();
+    //does not work so is commented
+    //setBackgroundItem(mBlackBackgroundItem);
+
+    //initializing the image decoder
+    mImageDecoder = new GlxImageDecoderWrapper;
+
+	//inititalizing the timer for animation
+	m_AnimTimeLine = new QTimeLine(1000, this);
+	m_AnimTimeLine->setFrameRange(0, 100);
+	connect(m_AnimTimeLine, SIGNAL(frameChanged(int)), this, SLOT(animationFrameChanged(int)));
+	connect(m_AnimTimeLine, SIGNAL(finished()), this, SLOT(animationTimeLineFinished()));
+}
+
+GlxZoomWidget::~GlxZoomWidget()
+{
+    //disconnect all existing signals
+    disconnect(this,SIGNAL( pinchGestureReceived(int) ), this, SLOT( sendDecodeRequest(int) ) );
+    //no Null checks required
+    delete mZoomItem;
+//    delete mZoomWidget; //as this is a content widegt it will automatically be deleted
+    delete mBlackBackgroundItem;
+    //reset the decoder to cancel pending tasks
+    if(mImageDecoder) {
+        mImageDecoder->resetDecoder();
+        delete mImageDecoder;
+    }
+}
+
+void GlxZoomWidget::setModel (QAbstractItemModel *model)
+{
+    if(model)
+    {
+        mModel = model;
+        retreiveFocusedImage(); //Update mZoomItem with focused Image
+        connect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
+    }
+}
+
+void GlxZoomWidget::setWindowSize(QSize windowSize)
+{
+    mWindowSize = windowSize;
+    mBlackBackgroundItem->setGeometry(QRectF(QPointF(0,0), mWindowSize));
+    //try to reset the max and min zoomed size here
+}
+
+void GlxZoomWidget::indexChanged(int index)
+{
+    Q_UNUSED(index);
+    if(mFocusIndex != index) {
+        mImageDecoder->resetDecoder();//reset the decoder first to cancel pending tasks
+        mImageDecodeRequestSend = false;
+        mDecodedImageAvailable = false;
+        retreiveFocusedImage();  //Update mZoomItem with focused Image
+    }
+}
+
+void GlxZoomWidget::cleanUp()
+{
+//    disconnect( mModel, SIGNAL( dataChanged(QModelIndex,QModelIndex) ), this, SLOT( dataChanged(QModelIndex,QModelIndex) ) );
+    if(mImageDecoder) {
+        mImageDecoder->resetDecoder();
+    }
+    mZoomItem->setPixmap(QPixmap());
+}
+
+void GlxZoomWidget::activate()
+{
+}
+
+void GlxZoomWidget::setMinMaxZValue(int minZvalue, int maxZvalue)
+{
+    mMinZValue = minZvalue;
+    mMaxZValue = maxZvalue;
+}
+
+void GlxZoomWidget::connectDecodeRequestToPinchEvent()
+{
+    connect(this,SIGNAL( pinchGestureReceived(int) ), this, SLOT( sendDecodeRequest(int) ), Qt::QueuedConnection );
+}
+
+bool GlxZoomWidget::sceneEvent(QEvent *event)
+{
+    bool consume(false);
+    if (event->type() == QEvent::Gesture) {
+        consume = executeGestureEvent(this, static_cast<QGestureEvent*>(event));
+    }
+    if(!consume)
+    {
+        consume = HbScrollArea::sceneEvent(event);
+    }
+    return consume;
+}
+
+bool GlxZoomWidget::sceneEventFilter(QGraphicsItem *watched,QEvent *event)
+{
+     qDebug("GlxCoverFlow::eventFilter " );
+    bool consume = false;
+    if (event->type() == QEvent::Gesture) {
+        consume = executeGestureEvent(watched, static_cast<QGestureEvent*>(event));
+    }
+
+    if(!consume) {
+        consume = HbScrollArea::sceneEventFilter(watched,event);
+    }
+    return consume;
+
+}
+
+bool GlxZoomWidget::executeGestureEvent(QGraphicsItem *source,QGestureEvent *event)
+{
+     if (QGesture *pinch = event->gesture(Qt::PinchGesture))  {
+       QPinchGesture* pinchG = static_cast<QPinchGesture *>(pinch);
+       QPinchGesture::ChangeFlags changeFlags = pinchG->changeFlags();
+       if (changeFlags & QPinchGesture::ScaleFactorChanged) {
+            mPinchGestureOngoing = true;
+            //bring the zoom widget to foreground
+            setZValue(mMaxZValue);
+            //show the black background
+            mBlackBackgroundItem->setParentItem(parentItem());
+            mBlackBackgroundItem->setZValue(mMaxZValue - 1);
+            mBlackBackgroundItem->show();
+
+            //retreive the gesture values
+            qreal value = pinchG->scaleFactor() / pinchG->lastScaleFactor();
+            QPointF center = pinchG->property("centerPoint").toPointF();
+            //set the gesture center to the scene coordinates
+            QPointF sceneGestureCenter = source->sceneTransform().map(center);
+            zoomImage(value, sceneGestureCenter);
+
+        }
+       if (pinchG->state() == Qt::GestureStarted) {
+           emit pinchGestureReceived(mFocusIndex);
+       }
+
+       if (pinchG->state() == Qt::GestureFinished) {
+           if(mStepCurrentSize != mCurrentSize) {
+               //For giving a spring effect when user has zoomed more than normal.
+               if(mStepCurrentSize.width() > mMaxScaleDecSize.width())   {
+                   //scale the image to limited size
+                   qreal value = mMaxScaleDecSize.width()/mCurrentSize.width();
+                   QPointF center(mWindowSize.width()/2, mWindowSize.height()/2);
+                   QPointF sceneGestureCenter = source->sceneTransform().map(center);
+                   zoomImage(value, sceneGestureCenter);
+               }
+               mPinchGestureOngoing = false;
+                //finalize the transforms to the geometry else panning will not work
+                finalizeWidgetTransform();
+           }
+//push the Zoom widget to background when zoomed image size nears FS image
+           if(mStepCurrentSize.width() <= mMinDecScaleSize.width()*1.3)  {
+               mBlackBackgroundItem->hide();
+               //push the widget back to background
+               setZValue(mMinZValue);
+               emit zoomWidgetMovedBackground(mFocusIndex);
+               //do not reset the transform here as it will then zoom-in the widget to decoded image size
+           }
+       }
+       //gesture accepted
+       return true;
+     }
+     //gesture rejected
+     if(!mPinchGestureOngoing) {
+         return false; 
+     }
+     return true;
+
+}
+
+void GlxZoomWidget::zoomImage(qreal zoomFactor, QPointF center)
+{
+    adjustGestureCenter(center, zoomFactor);
+    QSizeF requiredSize(mCurrentSize.width()*zoomFactor, mCurrentSize.height()*zoomFactor);
+    limitRequiredSize(requiredSize);
+    if(requiredSize != mCurrentSize) {
+        QTransform zoomTransform = mZoomWidget->transform();
+        QPointF transformedCenter = mZoomWidget->sceneTransform().inverted().map(center);
+        zoomTransform.translate(transformedCenter.x(),transformedCenter.y());
+        zoomTransform.scale(requiredSize.width()/mCurrentSize.width(), requiredSize.height()/mCurrentSize.height());
+        zoomTransform.translate(-transformedCenter.x(),-transformedCenter.y());
+        mZoomWidget->setTransform(zoomTransform);
+        mCurrentSize = requiredSize;
+    }
+
+}
+
+
+void GlxZoomWidget::limitRequiredSize(QSizeF &requiredSize)
+{
+    if(requiredSize.width() > mMaxScaleSize.width() ) {
+        requiredSize = mMaxScaleSize ;
+    }
+    else if(requiredSize.width() < mMinDecScaleSize.width() ) {
+        requiredSize = mMinDecScaleSize ;
+    }
+
+
+}
+
+//makes sure that the gesture is on the screen center if the image is smaller than the screen
+void GlxZoomWidget::adjustGestureCenter(QPointF & gestureCenter, qreal& zoomFactor)
+{
+    if(zoomFactor > 1 &&zoomFactor > 1.2 )  {
+        zoomFactor = 1.2;
+    }
+
+    if(zoomFactor < 1 &&zoomFactor < 0.8 )   {
+        zoomFactor = 0.8;
+    }
+    QSizeF requiredSize(mCurrentSize.width()*zoomFactor, mCurrentSize.height()*zoomFactor);
+    //keep smaller image centered
+    if(mCurrentSize.width() <= mWindowSize.width() )
+    {
+        gestureCenter.setX(mWindowSize.width()/2);
+
+    }
+    if(mCurrentSize.height() <= mWindowSize.height())
+    {
+        gestureCenter.setY(mWindowSize.height()/2);
+
+    }
+    //maintains the boundary of the edges for zoom out conditions
+    if(zoomFactor < 1)
+    {
+        QPointF itemOriginPos = mZoomWidget->sceneTransform().map(QPointF(0,0));
+        bool hasWidthExceededWindow = mCurrentSize.width() > mWindowSize.width();
+        bool hasHeightExceededWindow = mCurrentSize.height() > mWindowSize.height();
+        if(itemOriginPos.x() >= 0)  {
+        //image has crossed left boundry leaving blank space
+            if(hasWidthExceededWindow) {
+                //stick the gesture to the left corner
+                gestureCenter.setX(itemOriginPos.x());
+            }
+        }
+        //Check if the right boundry can be adjusted
+        if(itemOriginPos.x()+ mCurrentSize.width() <= mWindowSize.width()) {
+                //Image is before the right boundry leaving blank space
+                if(hasWidthExceededWindow) {
+                    //stick the gesture to the right corner
+                    gestureCenter.setX(itemOriginPos.x()+ mCurrentSize.width());
+                }
+        }
+        //check if the upper boundry could be adjusted
+        if(itemOriginPos.y() >= 0) {
+                //image has crossed the upper boundry leaving blank space
+                if(hasHeightExceededWindow) {
+                    //stick the image to the upper boundry
+                    gestureCenter.setY(itemOriginPos.y());
+                }
+        }
+        //check if the lower boundry could be adjusted
+        if(itemOriginPos.y()+ mCurrentSize.height() <= mWindowSize.height()) {
+        //Image is before the right boundry leaving blank space
+            if(hasHeightExceededWindow) {
+                //stick the image to the right corner
+                gestureCenter.setY(itemOriginPos.y()+ mCurrentSize.height());
+            }
+
+        }
+    }
+    //control the zoom Factor to boundaries
+    if(mCurrentSize.width() > mWindowSize.width() && requiredSize.width() <= mWindowSize.width())
+    {
+        zoomFactor =  mWindowSize.width()/mCurrentSize.width();
+
+    }
+    else if(mCurrentSize.height() > mWindowSize.height() && requiredSize.height() <= mWindowSize.height())
+    {
+        zoomFactor =  mWindowSize.height()/mCurrentSize.height();
+
+    }
+
+    //reduce the ZF so as to show a decelerated effect at max/min levels
+
+    if(mCurrentSize.width() > mMaxScaleDecSize.width() && zoomFactor > 1 ) {
+        zoomFactor = 1.0 + ((zoomFactor-1.0)/6) ;
+    }
+        if(mCurrentSize.width() < mMinDecScaleSize.width() && zoomFactor < 1 ) {
+        zoomFactor = 1.0 - ((1.0-zoomFactor)/6) ;
+    }
+
+
+}
+
+//get the latest focused image and set it to mZoomItem
+void GlxZoomWidget::retreiveFocusedImage()
+{
+
+    QPixmap targetPixmap(getFocusedImage());
+    //initialize all the variables wrt the focussed pixmap
+    mZoomWidget->resetTransform();
+    mItemSize = targetPixmap.size();
+    mMaxScaleSize = mItemSize;
+    mMaxScaleSize.scale(mWindowSize*13, Qt::KeepAspectRatio);
+    mMaxScaleDecSize = mItemSize;
+    mMaxScaleDecSize.scale(mWindowSize*7, Qt::KeepAspectRatio);
+    mMinScaleSize = mItemSize* 0.7;
+    mMinDecScaleSize = mItemSize;
+    QPointF originPos = sceneTransform().map(QPointF(0,0));
+    mZoomWidget->setGeometry(QRectF(QPointF(mWindowSize.width()/2 - mItemSize.width()/2,mWindowSize.height()/2 - mItemSize.height()/2),mItemSize )); //chk this
+    mZoomWidget->setPreferredSize(mItemSize);
+    mZoomItem->setPixmap(targetPixmap);
+    mCurrentSize = mItemSize;
+    mStepCurrentSize = mItemSize;
+    setContentWidget(mZoomWidget);
+    show();
+}
+
+
+void GlxZoomWidget::dataChanged(QModelIndex startIndex, QModelIndex endIndex)
+{
+    if(mFocusIndex >= startIndex.row() && mFocusIndex <= endIndex.row()) {
+        //get the latest image from the model
+        //will replace a decoded image if callback is received after decoded image is received so a fix is required
+        //retreiveFocusedImage();
+        if(!mDecodedImageAvailable)  {
+        QPixmap targetPixmap(getFocusedImage());
+        mZoomItem->setPixmap(targetPixmap);
+        finalizeWidgetTransform();
+        }
+    }
+}
+
+void GlxZoomWidget::decodedImageAvailable()
+{
+    //new bitmap with better resolution is available
+    //so set it to the item
+    QPixmap decodedPixmap = mImageDecoder->getPixmap();
+    disconnect(mImageDecoder, SIGNAL(pixmapDecoded()), this, SLOT(decodedImageAvailable()));
+    if(decodedPixmap.isNull()){
+        return;
+    }
+    mDecodedImageAvailable = true;
+    mZoomItem->setPixmap(decodedPixmap);
+    mItemSize = decodedPixmap.size();
+    //this is important if not done then old transforms will be applied on the new image
+    finalizeWidgetTransform();
+}
+
+void GlxZoomWidget::sendDecodeRequest(int index)
+{
+    if(!mImageDecodeRequestSend) {
+        QString imagePath = (mModel->data(mModel->index(index,0),GlxUriRole)).value<QString>();
+        mImageDecoder->decodeImage(imagePath);
+        connect(mImageDecoder, SIGNAL(pixmapDecoded()), this, SLOT(decodedImageAvailable()));
+        mImageDecodeRequestSend = true;
+    }
+}
+
+
+void GlxZoomWidget::finalizeWidgetTransform()
+{
+    QPointF widgetPos = mZoomWidget->sceneTransform().map(QPointF(0,0)); //Map the origin wrt scene
+    mZoomWidget->resetTransform();
+    mZoomWidget->scale(mCurrentSize.width()/mItemSize.width(), mCurrentSize.height()/mItemSize.height());
+    mZoomWidget->setGeometry(QRectF(widgetPos , mCurrentSize));
+    // this updates HbScrollArea on the sizeHint of ZoomWidget
+    mZoomWidget->setPreferredSize(mCurrentSize);
+    mStepCurrentSize = mCurrentSize;
+}
+
+QPixmap GlxZoomWidget::getFocusedImage()
+{
+    mFocusIndex = mModel->data(mModel->index(0,0),GlxFocusIndexRole).value<int>();
+    QVariant iconVariant = mModel->data(mModel->index(mFocusIndex,0),GlxFsImageRole);
+    QVariant sizeVariant = mModel->data(mModel->index(mFocusIndex,0),GlxDimensionsRole);
+    QPixmap targetPixmap;
+    //retreive pixmap from the HbIcon received from model
+    //should change the model to return and save pixmaps and convert to HbIcons Instead
+    if ( iconVariant.isValid() &&  iconVariant.canConvert<HbIcon> () ) {
+         QIcon itemIcon = iconVariant.value<HbIcon>().qicon();
+         QSize itemSize = itemIcon.actualSize(mWindowSize);
+         QSize scaleSize;
+         if(sizeVariant.isValid() &&  sizeVariant.canConvert<QSize> ()) {
+             scaleSize = sizeVariant.toSize();
+             if(!(scaleSize.width() < mWindowSize.width() && scaleSize.height() < mWindowSize.height()))  {
+                 scaleSize = mWindowSize;
+             }
+         }
+         targetPixmap = itemIcon.pixmap(itemSize).scaled(scaleSize, Qt::KeepAspectRatio);
+         mItemSize = targetPixmap.size();
+    }
+    return targetPixmap;
+
+}
+
+
+
+
+
+void GlxZoomWidget::animateZoomIn(QPointF animRefPoint)
+{
+      emit pinchGestureReceived(mFocusIndex);
+            //bring the zoom widget to foreground
+            setZValue(mMaxZValue);
+            //show the black background
+            mBlackBackgroundItem->setParentItem(parentItem());
+            mBlackBackgroundItem->setZValue(mMaxZValue - 1);
+            mBlackBackgroundItem->show();
+	m_AnimRefPoint = animRefPoint;
+    QSizeF requiredSize = mItemSize;
+    requiredSize.scale(mWindowSize*3.5, Qt::KeepAspectRatio);
+	m_FinalAnimatedScaleFactor = requiredSize.width()*3.5/mMinScaleSize.width();
+	m_AnimTimeLine->setDirection(QTimeLine::Forward);
+	m_AnimTimeLine->start();
+  //  zoomImage(5, m_AnimRefPoint);
+
+}
+void GlxZoomWidget::animateZoomOut(QPointF animRefPoint)
+{
+	m_AnimRefPoint = animRefPoint;
+	m_FinalAnimatedScaleFactor = mMinScaleSize.width()/mCurrentSize.width();
+	//m_AnimTimeLine->setDirection(QTimeLine::Backward);
+	m_AnimTimeLine->start();
+}
+void GlxZoomWidget::animationFrameChanged(int frameNumber)
+{
+qreal scaleFactor = 1;
+	if(m_FinalAnimatedScaleFactor > 1) {
+	//	qreal scaleFactor = (100+ ((m_FinalAnimatedScaleFactor*100 - 100)/100)*frameNumber)/100;
+		scaleFactor = 1.0 + (((m_FinalAnimatedScaleFactor - 1)/100)*frameNumber);
+	}
+	if(m_FinalAnimatedScaleFactor < 1) {
+		scaleFactor = (m_FinalAnimatedScaleFactor*100+ ((100 - m_FinalAnimatedScaleFactor*100 )/100)*frameNumber)/100;
+	//	qreal scaleFactor = 1.0 + (((m_FinalAnimatedScaleFactor - 1)/100)*frameNumber)
+	}
+
+	zoomImage(scaleFactor, m_AnimRefPoint);
+
+}
+void GlxZoomWidget::animationTimeLineFinished()
+{
+	finalizeWidgetTransform();
+//push the Zoom widget to background when zoomed image size nears FS image
+           if(mStepCurrentSize.width() <= mMinDecScaleSize.width()*1.3)  {
+               mBlackBackgroundItem->hide();
+               //push the widget back to background
+               setZValue(mMinZValue);
+               emit zoomWidgetMovedBackground(mFocusIndex);
+               //do not reset the transform here as it will then zoom-in the widget to decoded image size
+           }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/widgets/widgets.pro	Fri May 28 21:11:54 2010 +0530
@@ -0,0 +1,19 @@
+#/* 
+#* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+#* All rights reserved.
+#* This component and the accompanying materials are made available
+#* under the terms of "Eclipse Public License v1.0"
+#* which accompanies this distribution, and is available
+#* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#*
+#* Initial Contributors:
+#* Nokia Corporation - initial contribution.
+#*
+#* Contributors:
+#* 
+#* Description:
+#*
+#*/ 
+TEMPLATE    = subdirs
+CONFIG += ordered
+SUBDIRS	    = glxzoomwidget