Revision: 201019 RCL_3 PDK_3.0.0
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 25 May 2010 12:42:31 +0300
branchRCL_3
changeset 32 78ad99c24f08
parent 30 a60acebbbd9d
child 35 420f6808bf21
Revision: 201019 Kit: 2010121
photosgallery/controllers/imageviewer/src/glximageviewermanager.cpp
photosgallery/inc/glxlog.h
photosgallery/slideshow/engine/controlsrc/shwmusiccontrol.cpp
photosgallery/slideshow/view/inc/shwslideshowview.h
photosgallery/slideshow/view/src/shwslideshowview.cpp
photosgallery/viewframework/commandhandlers/commoncommandhandlers/bwins/glxcommoncommandhandlersu.def
photosgallery/viewframework/commandhandlers/commoncommandhandlers/eabi/glxcommoncommandhandlersu.def
photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandlervideoplayback.h
photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxmediaselectionpopup.h
photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdetails.cpp
photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlervideoplayback.cpp
photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp
photosgallery/viewframework/dataprovider/group/dataprovider.mmp
photosgallery/viewframework/dataprovider/inc/glxmulthumbnailvarianttype.h
photosgallery/viewframework/dataprovider/src/glxthumbnailvarianttype.cpp
photosgallery/viewframework/drmutility/bwins/glxdrmutilityu.def
photosgallery/viewframework/drmutility/eabi/glxdrmutilityu.def
photosgallery/viewframework/drmutility/inc/glxdrmutility.h
photosgallery/viewframework/drmutility/src/glxdrmutility.cpp
photosgallery/viewframework/inc/glxtvconstants.h
photosgallery/viewframework/medialists/src/glxcachemanager.cpp
photosgallery/viewframework/medialists/src/glximagereader.cpp
photosgallery/viewframework/medialists/src/glxmedialist.cpp
photosgallery/viewframework/medialists/src/glxmedialistiterator.cpp
photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxalbumfullscreenviewplugin.cpp
photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxcameraalbumfullscreenviewplugin.cpp
photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxdownloadsfullscreenviewplugin.cpp
photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxmainfullscreenviewplugin.cpp
photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxmonthsfullscreenviewplugin.cpp
photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxtagfullscreenviewplugin.cpp
photosgallery/viewframework/plugins/fullscreenviewpluginbase/src/glxfullscreenviewpluginbase.cpp
photosgallery/viewframework/texturemanager/group/glxtexturemanager.mmp
photosgallery/viewframework/texturemanager/inc/glxtexturemanagerimpl.h
photosgallery/viewframework/texturemanager/src/glxbitmapdecoderwrapper.cpp
photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp
photosgallery/viewframework/tvout/inc/glxhdmicontroller.h
photosgallery/viewframework/tvout/inc/glxtv.h
photosgallery/viewframework/tvout/inc/glxtvconnectionmonitor.h
photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp
photosgallery/viewframework/tvout/src/glxtv.cpp
photosgallery/viewframework/tvout/src/glxtvconnectionmonitor.cpp
photosgallery/viewframework/views/cloudview/inc/glxbubbletimer.h
photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h
photosgallery/viewframework/views/cloudview/inc/glxcontainerinfobubble.h
photosgallery/viewframework/views/cloudview/inc/glxtagscontextmenucontrol.h
photosgallery/viewframework/views/cloudview/src/glxbubbletimer.cpp
photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp
photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp
photosgallery/viewframework/views/cloudview/src/glxcontainerinfobubble.cpp
photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp
photosgallery/viewframework/views/fullscreenview/group/glxfullscreenview.mmp
photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h
photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp
photosgallery/viewframework/views/gridview/inc/glxgridviewcontainer.h
photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h
photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp
photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp
photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp
photosgallery/viewframework/views/listview/inc/glxlistviewimp.h
photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp
photosgallery/viewframework/views/metadatadialog/group/glxmetadatadialog.mmp
photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatacontainer.h
photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatacontainer.cpp
photosgallery/viewframework/views/zoomview/inc/glxzoommathsengine.h
photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp
photosgallery/viewframework/views/zoomview/src/glxzoomeventhandler.cpp
photosgallery/viewframework/views/zoomview/src/glxzoommathsengine.cpp
--- a/photosgallery/controllers/imageviewer/src/glximageviewermanager.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/controllers/imageviewer/src/glximageviewermanager.cpp	Tue May 25 12:42:31 2010 +0300
@@ -110,6 +110,7 @@
 EXPORT_C void CGlxImageViewerManager::SetImageUriL(const TDesC& aFileName)
     {
     TRACER("void CGlxImageViewerManager::SetImageUriL()");    
+    GLX_LOG_URI("CGlxImageViewerManager::SetImageUriL(%S)", &aFileName);
     if ( iImageUri )
         {
         delete iImageUri;
--- a/photosgallery/inc/glxlog.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/inc/glxlog.h	Tue May 25 12:42:31 2010 +0300
@@ -52,7 +52,7 @@
     #define GLX_DEBUG3( s, i, j )
     #define GLX_DEBUG4( s, i, j, k )
     #define GLX_DEBUG5( s, i, j, k, l )
-
+    #define GLX_LOG_URI( s, i )
 #else
 
 // only include headers if logging is enabled
@@ -338,6 +338,16 @@
     #define GLX_DEBUG5( s, i, j, k, l ) GLX_LOG_INFO4( s, i, j, k, l )
 
     /**
+     * Logs a single line of information with two parameters
+     * Example usage:
+	 * CFoo::SetImageUriL(const TDesC& aFileName) {
+     * GLX_LOG_URI( "CFoo::SetImageUriL(%S)", &aFileName ); }
+     * @param s, the string to be inserted to the log, plain compile time string, not a descriptor
+     * @param i, the string value to be inserted to the string
+	 */
+    #define GLX_LOG_URI( s, i )    RDebug::Print( _L( s ), i )
+
+    /**
      * TRAP instrumentation for Leave
      */
     #undef TRAP_INSTRUMENTATION_LEAVE
--- a/photosgallery/slideshow/engine/controlsrc/shwmusiccontrol.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/slideshow/engine/controlsrc/shwmusiccontrol.cpp	Tue May 25 12:42:31 2010 +0300
@@ -57,7 +57,6 @@
     MShwMusicObserver& aMusicObsvr, const TDesC& aFilePath )
     {
     TRACER(" CShwMusicControl::NewL");
-    GLX_LOG_INFO( "CShwMusicControl::NewL" );
     CShwMusicControl* self = 
         new( ELeave ) CShwMusicControl( aMusicObsvr, aFilePath );
     CleanupStack::PushL( self );
@@ -72,7 +71,6 @@
 CShwMusicControl::~CShwMusicControl()
     {
     TRACER(" CShwMusicControl::~CShwMusicControl");
-    GLX_LOG_INFO( "CShwMusicControl::~CShwMusicControl" );
     if( iPlaybackUtility )
         {
         //The Code Scanner Error is not corrected here in the case of
@@ -96,7 +94,6 @@
 void CShwMusicControl::ConstructL()
     {
     TRACER("CShwMusicControl::ConstructL");
-    GLX_LOG_INFO("CShwMusicControl::ConstructL");
     // need to specify the mode and observer, without these we get a crash
     iPlaybackUtility = MMPXPlaybackUtility::NewL( KPbModeNewPlayer, this );
     // music playback is sacrificed if MPX fails
@@ -113,7 +110,6 @@
 void CShwMusicControl::InitPlayerL()
     {
     TRACER("CShwMusicControl::InitPlayerL");
-    GLX_LOG_INFO( "CShwMusicControl::InitPlayerL" );
     RFs fs;
     User::LeaveIfError( fs.Connect() );
     CleanupClosePushL( fs );
@@ -150,7 +146,6 @@
 void CShwMusicControl::VolumeL()
     {
     TRACER("CShwMusicControl::VolumeL");
-    GLX_LOG_INFO( "CShwMusicControl::VolumeL" );
     // Retrieve the volume - Volume indicator is shown upon slideshow start and
     // when the volume is changed
     if (iMaxVolume == KErrNotFound)
@@ -158,6 +153,7 @@
         iPlaybackUtility->ValueL( *this, EPbPropertyMaxVolume );	
         }
     iPlaybackUtility->ValueL( *this, EPbPropertyVolume );
+    iPlaybackUtility->ValueL( *this, EPbPropertyMute );
     }
 
 // -----------------------------------------------------------------------------
@@ -166,7 +162,6 @@
 void CShwMusicControl::NotifyL( MShwEvent* aEvent )
     {
     TRACER("CShwMusicControl::NotifyL");
-    GLX_LOG_INFO( "CShwMusicControl::NotifyL" );
     // only handle events if music initialisation succeeded
     if( iState == EMusicOn )
         {
@@ -193,7 +188,6 @@
                                         TInt aError )
     {
     TRACER("CShwMusicControl::HandlePropertyL");
-    GLX_LOG_INFO( "CShwMusicControl::HandlePropertyL" );
 
     // leave if there was an error
     User::LeaveIfError( aError );
@@ -201,10 +195,12 @@
     // handle max volume and volume, ignore other properties
     if( EPbPropertyMaxVolume == aProperty )
         {
+        GLX_LOG_INFO("EPbPropertyMaxVolume = aProperty");
         iMaxVolume = aValue;
         }
     else if( EPbPropertyVolume == aProperty )
         {
+        GLX_LOG_INFO1("EPbPropertyVolume = aProperty - aValue: %d",aValue);
         // set the current volume
         iCurrentVolume = aValue;
         // call observer only when max volume is also known
@@ -214,6 +210,19 @@
         	iMusicObsvr.MusicVolumeL( iCurrentVolume, iMaxVolume );
         	}
         }
+    else if( EPbPropertyMute == aProperty)
+        {
+        GLX_LOG_INFO1("EPbPropertyMute = aProperty - aValue: %d",aValue);
+        //Ref: TMPXPlaybackProperty - EPbPropertyMute - aValue 0(normal), 1(muted)
+        if(aValue == 1)
+            {
+            iCurrentVolume = 0;
+            if( iMaxVolume != KErrNotFound )
+                {                
+                iMusicObsvr.MusicVolumeL( iCurrentVolume, iMaxVolume );
+                }
+            }
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -265,7 +274,6 @@
 void CShwMusicControl::HandlePlaybackMessage(const CMPXMessage& aMsg)
     {
     TRACER("CShwMusicControl::HandlePlaybackMessage");
-    GLX_LOG_ENTRY_EXIT( "CShwMusicControl::HandlePlaybackMessageL()" );
     
     switch(*aMsg.Value<TMPXPlaybackMessage::TEvent>( KMPXMessageGeneralEvent ))
         {
@@ -307,7 +315,6 @@
 void CShwMusicControl::HandleEventL( MShwEvent* aEvent )
     {
     TRACER("CShwMusicControl::HandleEventL( MShwEvent* aEvent )");
-    GLX_LOG_INFO( "CShwTimerControl::HandleEventL" );
     // we got an event, was it start
     if( dynamic_cast< TShwEventStart* >( aEvent ) )
         {
--- a/photosgallery/slideshow/view/inc/shwslideshowview.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/slideshow/view/inc/shwslideshowview.h	Tue May 25 12:42:31 2010 +0300
@@ -427,6 +427,9 @@
 	//to check if slideshow is paused in BG 
 	//and after that we are bringing to foreground
 	TBool iPrevNotInBackground;
+
+	TInt iHdmiWidth;
+    TInt iHdmiHeight;
     };
 
 #endif  // C_SHWSLIDESHOWVIEW_H
--- a/photosgallery/slideshow/view/src/shwslideshowview.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/slideshow/view/src/shwslideshowview.cpp	Tue May 25 12:42:31 2010 +0300
@@ -250,11 +250,16 @@
 	       	SetListFocusL();
 	       	// Need to take latest screen size as layout has changed
 	       	TRect currentScreen;
-	       	TSize screenSize;
 	       	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen,currentScreen);
-	       	screenSize = currentScreen.Size();
+	       	iScrnSize = currentScreen.Size();
+
+	       	iHdmiWidth = (iScrnSize.iWidth > iScrnSize.iHeight ?
+                                iScrnSize.iWidth :iScrnSize.iHeight);
+	        iHdmiHeight = (iScrnSize.iWidth < iScrnSize.iHeight ?
+                                iScrnSize.iWidth :iScrnSize.iHeight);
+
 	    	iEngine->StartL( 
-	    	    *iEnv, *iDisplay, *iFilteredList, *this, screenSize );
+	    	    *iEnv, *iDisplay, *iFilteredList, *this, iScrnSize );
 	        }
         }  
     // return value needed as this is a TCallBack
@@ -329,7 +334,6 @@
     
 	iEnv = iUiUtility->Env();
    	iDisplay = iUiUtility->Display();
-   	iScrnSize = iUiUtility->DisplaySize();
    	iGridIconSize = iUiUtility->GetGridIconSize();
    	
     // Construct the volume control
@@ -495,8 +499,7 @@
     iUiUtility->Display()->SetVisibleArea(TRect(TPoint(0,0),AlfUtil::ScreenSize()));
 	// We will require to act on events ONLY when the view is active.
 	// So listen to them only when the view is active.
-    iShwGestureControl->AddObserver(this);
-
+    iShwGestureControl->AddObserver(this);    
     }
 
 // -----------------------------------------------------------------------------
@@ -1244,45 +1247,45 @@
 // -----------------------------------------------------------------------------
 //
 void CShwSlideshowView::ProcessCommandL(TInt aCommandId)
-	{
-	TRACER("CShwSlideshowView::ProcessCommandL");
-	GLX_LOG_INFO( "CShwSlideshowView::ProcessCommandL" );
-	switch(aCommandId)
-		{
+    {
+    TRACER("CShwSlideshowView::ProcessCommandL");
+    GLX_LOG_INFO( "CShwSlideshowView::ProcessCommandL" );
+    switch(aCommandId)
+        {
         case EShwSlideshowCmdEnd:
-        	{
-        	iShwState = EShwExiting;
-        	aCommandId = EAknSoftkeyBack;
-        	iDisplay->Roster().Hide( *iGestureControlGroup );        
-        	break;
-        	}
-        //When user presses MSK or LSK this cmd will Generated
+            {
+            iShwState = EShwExiting;
+            aCommandId = EAknSoftkeyBack;
+            iDisplay->Roster().Hide( *iGestureControlGroup );        
+            break;
+            }
+            //When user presses MSK or LSK this cmd will Generated
         case EShwSlideshowCmdPause:
-		case EShwSlideshowCmdContinue:
-			{
-					// If MSK preesed to toggle visibility of softekey
-					if(iMSKPressed)
-		                {
-		                iMSKPressed = EFalse;
-		                }            
-		            else if(iLSKPressed)
-		                {
-		                iLSKPressed = EFalse;// Already Handlled
-		                }
-		            else
-		                {
-		                iPauseHandler->UserToggledPauseL();
-		                }
-		            break;  
-					}
+        case EShwSlideshowCmdContinue:
+            {
+            // If MSK preesed to toggle visibility of softekey
+            if(iMSKPressed)
+                {
+                iMSKPressed = EFalse;
+                }            
+            else if(iLSKPressed)
+                {
+                iLSKPressed = EFalse;// Already Handlled
+                }
+            else
+                {
+                iPauseHandler->UserToggledPauseL();
+                }
+            break;  
+            }
 
         default:
-        	{
-        	break;
-        	}
-		}
-	CGlxViewBase::ProcessCommandL(aCommandId);
-	}
+            {
+            break;
+            }
+        }
+    CGlxViewBase::ProcessCommandL(aCommandId);
+    }
 // ----------------------------------------------------------------------------- 
 // Set the image to external display - HDMI
 // -----------------------------------------------------------------------------
@@ -1360,10 +1363,13 @@
                 GLX_LOG_INFO("CShwSlideshowView::SetImageToHDMIL - CGlxHdmi - Setting Null Bitmap");
                 TFileName resFile(KDC_APP_BITMAP_DIR);
                 resFile.Append(KGlxIconsFilename);
-                CFbsBitmap* defaultBitmap = new (ELeave) CFbsBitmap;
+                CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile,
+                        EMbmGlxiconsQgn_prop_image_notcreated);
                 CleanupStack::PushL(defaultBitmap);
-                defaultBitmap = AknIconUtils::CreateIconL(resFile,
-                        EMbmGlxiconsQgn_prop_image_notcreated);
+                
+                // always need to setsize on the raw bitmap for it to be visible
+                AknIconUtils::SetSize(defaultBitmap, TSize(iHdmiWidth,iHdmiHeight),EAspectRatioPreserved);
+                
                 GLX_LOG_INFO2("CShwSlideshowView::SetImageToHDMIL - CGlxHdmi - Default Size width=%d, height=%d", 
                         defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight);
                 iHdmiController->SetImageL(item.Uri(),defaultBitmap);
@@ -1455,19 +1461,17 @@
 //
 void CShwSlideshowView::HandleTvStatusChangedL(TTvChangeType aChangeType )
 	{
-	TRACER("CShwSlideshowView::HandleTvConnectionStatusChangedL");
-    // This is a common function for both HDMI and TV-out status changes 
-    // (see CGlxTv::HandleTvConnectionStatusChangedL)
-    if ((aChangeType == ETvConnectionChanged)
-            && (!iTvConnection->IsHDMIConnected()
-                   	&& !iTvConnection->IsConnected()))
-	         {
-                 GLX_LOG_INFO("CShwSlideshowView::HandleTvConnectionStatusChangedL- Acessory Not Connected");
-	         //Issue pause command if not already paused
-                 if (!iPauseHandler->IsSlideShowEngineStatePaused())
-                    {
-	              ProcessCommandL(EShwSlideshowCmdPause);
-	            }
+	TRACER("CShwSlideshowView::HandleTvStatusChangedL");
+	// This is a common function for both HDMI ,TV-out and Headset disconnected.  
+	// (see CGlxTv::HandleTvConnectionStatusChangedL)
+	if (aChangeType == EDisconnected)
+		{
+		GLX_LOG_INFO("CShwSlideshowView::HandleTvStatusChangedL- Acessory Not Connected");
+		//Issue pause command if not already paused
+		if (!iPauseHandler->IsSlideShowEngineStatePaused())
+			{
+			ProcessCommandL(EShwSlideshowCmdPause);
+			}
 		}
+
 	}
-
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/bwins/glxcommoncommandhandlersu.def	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/bwins/glxcommoncommandhandlersu.def	Tue May 25 12:42:31 2010 +0300
@@ -5,62 +5,61 @@
 	?HandleItemAddedL@CGlxCommandHandlerNewMedia@@MAEXHHPAVMGlxMediaList@@@Z @ 4 NONAME ; void CGlxCommandHandlerNewMedia::HandleItemAddedL(int, int, class MGlxMediaList *)
 	?ExecuteLD@CGlxCommandHandlerNewMedia@@QAEHAAVTGlxMediaId@@@Z @ 5 NONAME ; int CGlxCommandHandlerNewMedia::ExecuteLD(class TGlxMediaId &)
 	??1CGlxCommandHandlerFilterImagesOrVideos@@UAE@XZ @ 6 NONAME ; CGlxCommandHandlerFilterImagesOrVideos::~CGlxCommandHandlerFilterImagesOrVideos(void)
-	?OfferKeyEventL@CGlxSingleGraphicPopupMenuStyleListBox@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 7 NONAME ; enum TKeyResponse CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode)
-	?NewL@CGlxCommandHandlerNewMedia@@SAPAV1@PAVMGlxMediaListProvider@@ABVTDesC16@@@Z @ 8 NONAME ; class CGlxCommandHandlerNewMedia * CGlxCommandHandlerNewMedia::NewL(class MGlxMediaListProvider *, class TDesC16 const &)
-	?NewL@CGlxCommandHandlerRemoveFrom@@SAPAV1@PAVMGlxMediaListProvider@@W4TMPXGeneralCategory@@ABVTDesC16@@@Z @ 9 NONAME ; class CGlxCommandHandlerRemoveFrom * CGlxCommandHandlerRemoveFrom::NewL(class MGlxMediaListProvider *, enum TMPXGeneralCategory, class TDesC16 const &)
-	??0CGlxMediaListAdaptor@@QAE@PBVMGlxMediaList@@H@Z @ 10 NONAME ; CGlxMediaListAdaptor::CGlxMediaListAdaptor(class MGlxMediaList const *, int)
-	?NewL@CGlxCommandHandlerUpload@@SAPAV1@PAVMGlxMediaListProvider@@H@Z @ 11 NONAME ; class CGlxCommandHandlerUpload * CGlxCommandHandlerUpload::NewL(class MGlxMediaListProvider *, int)
-	??1CGlxCommandHandlerUpload@@UAE@XZ @ 12 NONAME ; CGlxCommandHandlerUpload::~CGlxCommandHandlerUpload(void)
-	??1CGlxCommandHandlerNewMedia@@UAE@XZ @ 13 NONAME ; CGlxCommandHandlerNewMedia::~CGlxCommandHandlerNewMedia(void)
-	?NewL@CGlxCommandHandlerAiwPrintPreview@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 14 NONAME ; class CGlxCommandHandlerAiwPrintPreview * CGlxCommandHandlerAiwPrintPreview::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	??1CGlxCommandHandlerSlideshow@@UAE@XZ @ 15 NONAME ; CGlxCommandHandlerSlideshow::~CGlxCommandHandlerSlideshow(void)
-	??1CGlxCommandHandlerSave@@UAE@XZ @ 16 NONAME ; CGlxCommandHandlerSave::~CGlxCommandHandlerSave(void)
-	?NewAddToFavCommandHandlerL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 17 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewAddToFavCommandHandlerL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	??1CGlxCommandHandlerAddToContainer@@UAE@XZ @ 18 NONAME ; CGlxCommandHandlerAddToContainer::~CGlxCommandHandlerAddToContainer(void)
-	??0CGlxMediaSelectionPopup@@QAE@XZ @ 19 NONAME ; CGlxMediaSelectionPopup::CGlxMediaSelectionPopup(void)
-	?NewL@CGlxCommandHandlerRotate@@SAPAV1@PAVMGlxMediaListProvider@@PAVMGlxLayoutOwner@@H@Z @ 20 NONAME ; class CGlxCommandHandlerRotate * CGlxCommandHandlerRotate::NewL(class MGlxMediaListProvider *, class MGlxLayoutOwner *, int)
-	?NewAddToTagSingleClickCommandHandlerL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 21 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewAddToTagSingleClickCommandHandlerL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	?ExecuteLD@CGlxMediaSelectionPopup@@QAEPAVCMPXCollectionPath@@AAV2@AAHHHPAVCMPXMedia@@@Z @ 22 NONAME ; class CMPXCollectionPath * CGlxMediaSelectionPopup::ExecuteLD(class CMPXCollectionPath &, int &, int, int, class CMPXMedia *)
-	?NewL@CGlxCommandHandlerSend@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 23 NONAME ; class CGlxCommandHandlerSend * CGlxCommandHandlerSend::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	?OkToExit@CGlxCommandHandlerNewMedia@@UBEHXZ @ 24 NONAME ; int CGlxCommandHandlerNewMedia::OkToExit(void) const
-	?NewL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HHABVTDesC16@@@Z @ 25 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewL(class MGlxMediaListProvider *, int, int, class TDesC16 const &)
-	??1CGlxCommandHandlerBack@@UAE@XZ @ 26 NONAME ; CGlxCommandHandlerBack::~CGlxCommandHandlerBack(void)
-	?NewPreviousViewCommandHandlerL@CGlxCommandHandlerBack@@SAPAV1@PAVMGlxMediaListProvider@@@Z @ 27 NONAME ; class CGlxCommandHandlerBack * CGlxCommandHandlerBack::NewPreviousViewCommandHandlerL(class MGlxMediaListProvider *)
-	??1CGlxCommandHandlerCopyAndMove@@UAE@XZ @ 28 NONAME ; CGlxCommandHandlerCopyAndMove::~CGlxCommandHandlerCopyAndMove(void)
-	??1CGlxCommandHandlerAiwEdit@@UAE@XZ @ 29 NONAME ; CGlxCommandHandlerAiwEdit::~CGlxCommandHandlerAiwEdit(void)
-	?SetContainerId@CGlxCommandHandlerRemoveFrom@@QAEXVTGlxMediaId@@@Z @ 30 NONAME ; void CGlxCommandHandlerRemoveFrom::SetContainerId(class TGlxMediaId)
-	?NewL@CGlxCommandHandlerVideoPlayback@@SAPAV1@PAVMGlxMediaListProvider@@@Z @ 31 NONAME ; class CGlxCommandHandlerVideoPlayback * CGlxCommandHandlerVideoPlayback::NewL(class MGlxMediaListProvider *)
-	?MdcaCount@CGlxMediaListAdaptor@@UBEHXZ @ 32 NONAME ; int CGlxMediaListAdaptor::MdcaCount(void) const
-	??0TGlxHelpContext@@QAE@XZ @ 33 NONAME ; TGlxHelpContext::TGlxHelpContext(void)
-	??1CGlxCommandHandlerSortOrder@@UAE@XZ @ 34 NONAME ; CGlxCommandHandlerSortOrder::~CGlxCommandHandlerSortOrder(void)
-	?NewL@CGlxCommandHandlerFilterImagesOrVideos@@SAPAV1@PAVMGlxMediaListProvider@@@Z @ 35 NONAME ; class CGlxCommandHandlerFilterImagesOrVideos * CGlxCommandHandlerFilterImagesOrVideos::NewL(class MGlxMediaListProvider *)
-	??1CGlxCommandHandlerRemoveFrom@@UAE@XZ @ 36 NONAME ; CGlxCommandHandlerRemoveFrom::~CGlxCommandHandlerRemoveFrom(void)
-	?NewL@CGlxCommandHandlerAiwShowMapHardKey@@SAPAV1@PAVMGlxMediaListProvider@@H@Z @ 37 NONAME ; class CGlxCommandHandlerAiwShowMapHardKey * CGlxCommandHandlerAiwShowMapHardKey::NewL(class MGlxMediaListProvider *, int)
-	?NewL@CGlxCommandHandlerHideUi@@SAPAV1@XZ @ 38 NONAME ; class CGlxCommandHandlerHideUi * CGlxCommandHandlerHideUi::NewL(void)
-	??1CGlxCommandHandlerSend@@UAE@XZ @ 39 NONAME ; CGlxCommandHandlerSend::~CGlxCommandHandlerSend(void)
-	?NewL@CGlxCommandHandlerAiwShowMap@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 40 NONAME ; class CGlxCommandHandlerAiwShowMap * CGlxCommandHandlerAiwShowMap::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	?NewL@CGlxCommandHandlerOpen@@SAPAV1@PAVMGlxMediaListProvider@@@Z @ 41 NONAME ; class CGlxCommandHandlerOpen * CGlxCommandHandlerOpen::NewL(class MGlxMediaListProvider *)
-	??1CGlxCommandHandlerDelete@@UAE@XZ @ 42 NONAME ; CGlxCommandHandlerDelete::~CGlxCommandHandlerDelete(void)
-	??1CGlxCommandHandlerDetails@@UAE@XZ @ 43 NONAME ; CGlxCommandHandlerDetails::~CGlxCommandHandlerDetails(void)
-	??1CGlxCommandHandlerDownload@@UAE@XZ @ 44 NONAME ; CGlxCommandHandlerDownload::~CGlxCommandHandlerDownload(void)
-	?NewAddToTagCommandHandlerL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 45 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewAddToTagCommandHandlerL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	?NewL@CGlxCommandHandlerSave@@SAPAV1@XZ @ 46 NONAME ; class CGlxCommandHandlerSave * CGlxCommandHandlerSave::NewL(void)
-	?NewL@CGlxCommandHandlerCopyAndMove@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 47 NONAME ; class CGlxCommandHandlerCopyAndMove * CGlxCommandHandlerCopyAndMove::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	?NewL@CGlxCommandHandlerDelete@@SAPAV1@PAVMGlxMediaListProvider@@HHABVTDesC16@@@Z @ 48 NONAME ; class CGlxCommandHandlerDelete * CGlxCommandHandlerDelete::NewL(class MGlxMediaListProvider *, int, int, class TDesC16 const &)
-	??1CGlxCommandHandlerOpen@@UAE@XZ @ 49 NONAME ; CGlxCommandHandlerOpen::~CGlxCommandHandlerOpen(void)
-	??1CGlxCommandHandlerRename@@UAE@XZ @ 50 NONAME ; CGlxCommandHandlerRename::~CGlxCommandHandlerRename(void)
-	??1CGlxCommandHandlerVideoPlayback@@UAE@XZ @ 51 NONAME ; CGlxCommandHandlerVideoPlayback::~CGlxCommandHandlerVideoPlayback(void)
-	?MdcaPoint@CGlxMediaListAdaptor@@UBE?AVTPtrC16@@H@Z @ 52 NONAME ; class TPtrC16 CGlxMediaListAdaptor::MdcaPoint(int) const
-	?NewAddToAlbumCommandHandlerL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 53 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewAddToAlbumCommandHandlerL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	?NewL@CGlxCommandHandlerDownload@@SAPAV1@XZ @ 54 NONAME ; class CGlxCommandHandlerDownload * CGlxCommandHandlerDownload::NewL(void)
-	?NewL@CGlxCommandHandlerDetails@@SAPAV1@PAVMGlxMediaListProvider@@ABVTDesC16@@@Z @ 55 NONAME ; class CGlxCommandHandlerDetails * CGlxCommandHandlerDetails::NewL(class MGlxMediaListProvider *, class TDesC16 const &)
-	??1CGlxCommandHandlerHelp@@UAE@XZ @ 56 NONAME ; CGlxCommandHandlerHelp::~CGlxCommandHandlerHelp(void)
-	?BypassFiltersForExecute@CGlxCommandHandlerNewMedia@@UBEHXZ @ 57 NONAME ; int CGlxCommandHandlerNewMedia::BypassFiltersForExecute(void) const
-	?NewL@CGlxCommandHandlerAiwShareOnOvi@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 58 NONAME ; class CGlxCommandHandlerAiwShareOnOvi * CGlxCommandHandlerAiwShareOnOvi::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	?NewL@CGlxCommandHandlerSortOrder@@SAPAV1@PAVMGlxMediaListProvider@@K@Z @ 59 NONAME ; class CGlxCommandHandlerSortOrder * CGlxCommandHandlerSortOrder::NewL(class MGlxMediaListProvider *, unsigned long)
-	?NewL@CGlxCommandHandlerSlideshow@@SAPAV1@PAVMGlxMediaListProvider@@HHABVTDesC16@@@Z @ 60 NONAME ; class CGlxCommandHandlerSlideshow * CGlxCommandHandlerSlideshow::NewL(class MGlxMediaListProvider *, int, int, class TDesC16 const &)
-	?NewBackCommandHandlerL@CGlxCommandHandlerBack@@SAPAV1@XZ @ 61 NONAME ; class CGlxCommandHandlerBack * CGlxCommandHandlerBack::NewBackCommandHandlerL(void)
-	?NewL@CGlxCommandHandlerAiwEdit@@SAPAV1@PAVMGlxMediaListProvider@@H@Z @ 62 NONAME ; class CGlxCommandHandlerAiwEdit * CGlxCommandHandlerAiwEdit::NewL(class MGlxMediaListProvider *, int)
-	?NewL@CGlxCommandHandlerRename@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 63 NONAME ; class CGlxCommandHandlerRename * CGlxCommandHandlerRename::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
-	?NewContainerPreviousViewCommandHandlerL@CGlxCommandHandlerBack@@SAPAV1@PAVMGlxMediaListProvider@@H@Z @ 64 NONAME ; class CGlxCommandHandlerBack * CGlxCommandHandlerBack::NewContainerPreviousViewCommandHandlerL(class MGlxMediaListProvider *, int)
+	?NewL@CGlxCommandHandlerNewMedia@@SAPAV1@PAVMGlxMediaListProvider@@ABVTDesC16@@@Z @ 7 NONAME ; class CGlxCommandHandlerNewMedia * CGlxCommandHandlerNewMedia::NewL(class MGlxMediaListProvider *, class TDesC16 const &)
+	?NewL@CGlxCommandHandlerRemoveFrom@@SAPAV1@PAVMGlxMediaListProvider@@W4TMPXGeneralCategory@@ABVTDesC16@@@Z @ 8 NONAME ; class CGlxCommandHandlerRemoveFrom * CGlxCommandHandlerRemoveFrom::NewL(class MGlxMediaListProvider *, enum TMPXGeneralCategory, class TDesC16 const &)
+	??0CGlxMediaListAdaptor@@QAE@PBVMGlxMediaList@@H@Z @ 9 NONAME ; CGlxMediaListAdaptor::CGlxMediaListAdaptor(class MGlxMediaList const *, int)
+	?NewL@CGlxCommandHandlerUpload@@SAPAV1@PAVMGlxMediaListProvider@@H@Z @ 10 NONAME ; class CGlxCommandHandlerUpload * CGlxCommandHandlerUpload::NewL(class MGlxMediaListProvider *, int)
+	??1CGlxCommandHandlerUpload@@UAE@XZ @ 11 NONAME ; CGlxCommandHandlerUpload::~CGlxCommandHandlerUpload(void)
+	??1CGlxCommandHandlerNewMedia@@UAE@XZ @ 12 NONAME ; CGlxCommandHandlerNewMedia::~CGlxCommandHandlerNewMedia(void)
+	?NewL@CGlxCommandHandlerAiwPrintPreview@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 13 NONAME ; class CGlxCommandHandlerAiwPrintPreview * CGlxCommandHandlerAiwPrintPreview::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	??1CGlxCommandHandlerSlideshow@@UAE@XZ @ 14 NONAME ; CGlxCommandHandlerSlideshow::~CGlxCommandHandlerSlideshow(void)
+	??1CGlxCommandHandlerSave@@UAE@XZ @ 15 NONAME ; CGlxCommandHandlerSave::~CGlxCommandHandlerSave(void)
+	?NewAddToFavCommandHandlerL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 16 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewAddToFavCommandHandlerL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	??1CGlxCommandHandlerAddToContainer@@UAE@XZ @ 17 NONAME ; CGlxCommandHandlerAddToContainer::~CGlxCommandHandlerAddToContainer(void)
+	??0CGlxMediaSelectionPopup@@QAE@XZ @ 18 NONAME ; CGlxMediaSelectionPopup::CGlxMediaSelectionPopup(void)
+	?NewL@CGlxCommandHandlerRotate@@SAPAV1@PAVMGlxMediaListProvider@@PAVMGlxLayoutOwner@@H@Z @ 19 NONAME ; class CGlxCommandHandlerRotate * CGlxCommandHandlerRotate::NewL(class MGlxMediaListProvider *, class MGlxLayoutOwner *, int)
+	?NewAddToTagSingleClickCommandHandlerL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 20 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewAddToTagSingleClickCommandHandlerL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	?ExecuteLD@CGlxMediaSelectionPopup@@QAEPAVCMPXCollectionPath@@AAV2@AAHHHPAVCMPXMedia@@@Z @ 21 NONAME ; class CMPXCollectionPath * CGlxMediaSelectionPopup::ExecuteLD(class CMPXCollectionPath &, int &, int, int, class CMPXMedia *)
+	?NewL@CGlxCommandHandlerSend@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 22 NONAME ; class CGlxCommandHandlerSend * CGlxCommandHandlerSend::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	?OkToExit@CGlxCommandHandlerNewMedia@@UBEHXZ @ 23 NONAME ; int CGlxCommandHandlerNewMedia::OkToExit(void) const
+	?NewL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HHABVTDesC16@@@Z @ 24 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewL(class MGlxMediaListProvider *, int, int, class TDesC16 const &)
+	??1CGlxCommandHandlerBack@@UAE@XZ @ 25 NONAME ; CGlxCommandHandlerBack::~CGlxCommandHandlerBack(void)
+	?NewPreviousViewCommandHandlerL@CGlxCommandHandlerBack@@SAPAV1@PAVMGlxMediaListProvider@@@Z @ 26 NONAME ; class CGlxCommandHandlerBack * CGlxCommandHandlerBack::NewPreviousViewCommandHandlerL(class MGlxMediaListProvider *)
+	??1CGlxCommandHandlerCopyAndMove@@UAE@XZ @ 27 NONAME ; CGlxCommandHandlerCopyAndMove::~CGlxCommandHandlerCopyAndMove(void)
+	??1CGlxCommandHandlerAiwEdit@@UAE@XZ @ 28 NONAME ; CGlxCommandHandlerAiwEdit::~CGlxCommandHandlerAiwEdit(void)
+	?SetContainerId@CGlxCommandHandlerRemoveFrom@@QAEXVTGlxMediaId@@@Z @ 29 NONAME ; void CGlxCommandHandlerRemoveFrom::SetContainerId(class TGlxMediaId)
+	?NewL@CGlxCommandHandlerVideoPlayback@@SAPAV1@PAVMGlxMediaListProvider@@@Z @ 30 NONAME ; class CGlxCommandHandlerVideoPlayback * CGlxCommandHandlerVideoPlayback::NewL(class MGlxMediaListProvider *)
+	?MdcaCount@CGlxMediaListAdaptor@@UBEHXZ @ 31 NONAME ; int CGlxMediaListAdaptor::MdcaCount(void) const
+	??0TGlxHelpContext@@QAE@XZ @ 32 NONAME ; TGlxHelpContext::TGlxHelpContext(void)
+	??1CGlxCommandHandlerSortOrder@@UAE@XZ @ 33 NONAME ; CGlxCommandHandlerSortOrder::~CGlxCommandHandlerSortOrder(void)
+	?NewL@CGlxCommandHandlerFilterImagesOrVideos@@SAPAV1@PAVMGlxMediaListProvider@@@Z @ 34 NONAME ; class CGlxCommandHandlerFilterImagesOrVideos * CGlxCommandHandlerFilterImagesOrVideos::NewL(class MGlxMediaListProvider *)
+	??1CGlxCommandHandlerRemoveFrom@@UAE@XZ @ 35 NONAME ; CGlxCommandHandlerRemoveFrom::~CGlxCommandHandlerRemoveFrom(void)
+	?NewL@CGlxCommandHandlerAiwShowMapHardKey@@SAPAV1@PAVMGlxMediaListProvider@@H@Z @ 36 NONAME ; class CGlxCommandHandlerAiwShowMapHardKey * CGlxCommandHandlerAiwShowMapHardKey::NewL(class MGlxMediaListProvider *, int)
+	?NewL@CGlxCommandHandlerHideUi@@SAPAV1@XZ @ 37 NONAME ; class CGlxCommandHandlerHideUi * CGlxCommandHandlerHideUi::NewL(void)
+	??1CGlxCommandHandlerSend@@UAE@XZ @ 38 NONAME ; CGlxCommandHandlerSend::~CGlxCommandHandlerSend(void)
+	?NewL@CGlxCommandHandlerAiwShowMap@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 39 NONAME ; class CGlxCommandHandlerAiwShowMap * CGlxCommandHandlerAiwShowMap::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	?NewL@CGlxCommandHandlerOpen@@SAPAV1@PAVMGlxMediaListProvider@@@Z @ 40 NONAME ; class CGlxCommandHandlerOpen * CGlxCommandHandlerOpen::NewL(class MGlxMediaListProvider *)
+	??1CGlxCommandHandlerDelete@@UAE@XZ @ 41 NONAME ; CGlxCommandHandlerDelete::~CGlxCommandHandlerDelete(void)
+	??1CGlxCommandHandlerDetails@@UAE@XZ @ 42 NONAME ; CGlxCommandHandlerDetails::~CGlxCommandHandlerDetails(void)
+	??1CGlxCommandHandlerDownload@@UAE@XZ @ 43 NONAME ; CGlxCommandHandlerDownload::~CGlxCommandHandlerDownload(void)
+	?NewAddToTagCommandHandlerL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 44 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewAddToTagCommandHandlerL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	?NewL@CGlxCommandHandlerSave@@SAPAV1@XZ @ 45 NONAME ; class CGlxCommandHandlerSave * CGlxCommandHandlerSave::NewL(void)
+	?NewL@CGlxCommandHandlerCopyAndMove@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 46 NONAME ; class CGlxCommandHandlerCopyAndMove * CGlxCommandHandlerCopyAndMove::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	?NewL@CGlxCommandHandlerDelete@@SAPAV1@PAVMGlxMediaListProvider@@HHABVTDesC16@@@Z @ 47 NONAME ; class CGlxCommandHandlerDelete * CGlxCommandHandlerDelete::NewL(class MGlxMediaListProvider *, int, int, class TDesC16 const &)
+	??1CGlxCommandHandlerOpen@@UAE@XZ @ 48 NONAME ; CGlxCommandHandlerOpen::~CGlxCommandHandlerOpen(void)
+	??1CGlxCommandHandlerRename@@UAE@XZ @ 49 NONAME ; CGlxCommandHandlerRename::~CGlxCommandHandlerRename(void)
+	??1CGlxCommandHandlerVideoPlayback@@UAE@XZ @ 50 NONAME ; CGlxCommandHandlerVideoPlayback::~CGlxCommandHandlerVideoPlayback(void)
+	?MdcaPoint@CGlxMediaListAdaptor@@UBE?AVTPtrC16@@H@Z @ 51 NONAME ; class TPtrC16 CGlxMediaListAdaptor::MdcaPoint(int) const
+	?NewAddToAlbumCommandHandlerL@CGlxCommandHandlerAddToContainer@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 52 NONAME ; class CGlxCommandHandlerAddToContainer * CGlxCommandHandlerAddToContainer::NewAddToAlbumCommandHandlerL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	?NewL@CGlxCommandHandlerDownload@@SAPAV1@XZ @ 53 NONAME ; class CGlxCommandHandlerDownload * CGlxCommandHandlerDownload::NewL(void)
+	?NewL@CGlxCommandHandlerDetails@@SAPAV1@PAVMGlxMediaListProvider@@ABVTDesC16@@@Z @ 54 NONAME ; class CGlxCommandHandlerDetails * CGlxCommandHandlerDetails::NewL(class MGlxMediaListProvider *, class TDesC16 const &)
+	??1CGlxCommandHandlerHelp@@UAE@XZ @ 55 NONAME ; CGlxCommandHandlerHelp::~CGlxCommandHandlerHelp(void)
+	?BypassFiltersForExecute@CGlxCommandHandlerNewMedia@@UBEHXZ @ 56 NONAME ; int CGlxCommandHandlerNewMedia::BypassFiltersForExecute(void) const
+	?NewL@CGlxCommandHandlerAiwShareOnOvi@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 57 NONAME ; class CGlxCommandHandlerAiwShareOnOvi * CGlxCommandHandlerAiwShareOnOvi::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	?NewL@CGlxCommandHandlerSortOrder@@SAPAV1@PAVMGlxMediaListProvider@@K@Z @ 58 NONAME ; class CGlxCommandHandlerSortOrder * CGlxCommandHandlerSortOrder::NewL(class MGlxMediaListProvider *, unsigned long)
+	?NewL@CGlxCommandHandlerSlideshow@@SAPAV1@PAVMGlxMediaListProvider@@HHABVTDesC16@@@Z @ 59 NONAME ; class CGlxCommandHandlerSlideshow * CGlxCommandHandlerSlideshow::NewL(class MGlxMediaListProvider *, int, int, class TDesC16 const &)
+	?NewBackCommandHandlerL@CGlxCommandHandlerBack@@SAPAV1@XZ @ 60 NONAME ; class CGlxCommandHandlerBack * CGlxCommandHandlerBack::NewBackCommandHandlerL(void)
+	?NewL@CGlxCommandHandlerAiwEdit@@SAPAV1@PAVMGlxMediaListProvider@@H@Z @ 61 NONAME ; class CGlxCommandHandlerAiwEdit * CGlxCommandHandlerAiwEdit::NewL(class MGlxMediaListProvider *, int)
+	?NewL@CGlxCommandHandlerRename@@SAPAV1@PAVMGlxMediaListProvider@@HABVTDesC16@@@Z @ 62 NONAME ; class CGlxCommandHandlerRename * CGlxCommandHandlerRename::NewL(class MGlxMediaListProvider *, int, class TDesC16 const &)
+	?NewContainerPreviousViewCommandHandlerL@CGlxCommandHandlerBack@@SAPAV1@PAVMGlxMediaListProvider@@H@Z @ 63 NONAME ; class CGlxCommandHandlerBack * CGlxCommandHandlerBack::NewContainerPreviousViewCommandHandlerL(class MGlxMediaListProvider *, int)
 
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/eabi/glxcommoncommandhandlersu.def	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/eabi/glxcommoncommandhandlersu.def	Tue May 25 12:42:31 2010 +0300
@@ -99,12 +99,11 @@
 	_ZN38CGlxCommandHandlerFilterImagesOrVideosD0Ev @ 98 NONAME
 	_ZN38CGlxCommandHandlerFilterImagesOrVideosD1Ev @ 99 NONAME
 	_ZN38CGlxCommandHandlerFilterImagesOrVideosD2Ev @ 100 NONAME
-	_ZN38CGlxSingleGraphicPopupMenuStyleListBox14OfferKeyEventLERK9TKeyEvent10TEventCode @ 101 NONAME
-	_ZNK20CGlxMediaListAdaptor9MdcaCountEv @ 102 NONAME
-	_ZNK20CGlxMediaListAdaptor9MdcaPointEi @ 103 NONAME
-	_ZNK26CGlxCommandHandlerNewMedia23BypassFiltersForExecuteEv @ 104 NONAME
-	_ZNK26CGlxCommandHandlerNewMedia8OkToExitEv @ 105 NONAME
-	_ZThn48_N26CGlxCommandHandlerNewMedia16HandleItemAddedLEiiP13MGlxMediaList @ 106 NONAME
-	_ZThn4_NK20CGlxMediaListAdaptor9MdcaCountEv @ 107 NONAME
-	_ZThn4_NK20CGlxMediaListAdaptor9MdcaPointEi @ 108 NONAME
+	_ZNK20CGlxMediaListAdaptor9MdcaCountEv @ 101 NONAME
+	_ZNK20CGlxMediaListAdaptor9MdcaPointEi @ 102 NONAME
+	_ZNK26CGlxCommandHandlerNewMedia23BypassFiltersForExecuteEv @ 103 NONAME
+	_ZNK26CGlxCommandHandlerNewMedia8OkToExitEv @ 104 NONAME
+	_ZThn48_N26CGlxCommandHandlerNewMedia16HandleItemAddedLEiiP13MGlxMediaList @ 105 NONAME
+	_ZThn4_NK20CGlxMediaListAdaptor9MdcaCountEv @ 106 NONAME
+	_ZThn4_NK20CGlxMediaListAdaptor9MdcaPointEi @ 107 NONAME
 
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandlervideoplayback.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxcommandhandlervideoplayback.h	Tue May 25 12:42:31 2010 +0300
@@ -129,6 +129,25 @@
     void DoHandlePlaybackMessageL( const CMPXMessage& aMessage ); 
  
     void HandlePlaybackPlayerChangedL(); 
+    
+    /**
+	 *  Provides the static function for the callback to 
+	 *  finish the MMPXPlaybackUtility construction
+	 *  Called by CPeriodic iConstructTimer
+	 *  @param aPtr Pointer to callback class
+	 *  @return KErrNone
+	 */
+	static TInt LateConstructCallback( TAny* aPtr );
+	
+	/**
+	 *  Called to finalize the MMPXPlaybackUtility construction.
+	 */
+	virtual void DoLateConstruct();
+	
+	/**
+	 *  Retrieves playback utility and creates it if needed
+	 */
+	void PlaybackUtilityL();
   
 private:
     // Pointer to the CGlxHuiUtility (reference counted).
@@ -148,6 +167,12 @@
     
     MMPXPlaybackUtility*   iPlaybackUtility; 
     MMPXViewUtility*       iViewUtility; 
+    
+    /**
+	 * For Late construction of 'MMPXPlaybackUtility'.
+	 */
+	CPeriodic* iPbUtilityConstructTimer;
+        
  	};
 
 #endif // C_GLXCOMMANDHANDLERVIDEOPLAYBACK_H
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxmediaselectionpopup.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/inc/glxmediaselectionpopup.h	Tue May 25 12:42:31 2010 +0300
@@ -91,6 +91,17 @@
      */
     TBool MultiSelectionEnabled();
     
+    /**
+	  * Returns ETrue if a static item is selected
+	  * otherwise EFalse.
+	  */
+    TBool IsStaticItemSelected();
+    
+    /**
+     * Save the status whether selected item is static.
+     */
+    void SetStaticItemSelected(TBool aSelected);
+    
 public: // from MDesCArray 
 	/** See @ref MDesCArray::MdcaCount */
     IMPORT_C TInt MdcaCount() const;
@@ -116,54 +127,42 @@
      * returns 0.
      */
     TBool iEnabled;
+    
+    /**
+	 * Indicates if a static item is selected.
+	 */
+	TBool iStaticItemSelected;
 	};
 
 /**
- * CGlxSingleGraphicPopupMenuStyleListBox
+ * CGlxSingleGraphicPopupMenuStyleList
  * 
- * Adds behaviour to CAknSingleGraphicPopupMenuStyleListBox:
- * If the currently selected item has a TMPXGeneralCateroy
- * equal to EMPXCommand, item selection will be disabled; Pressing
- * the OK key will result in the item being actioned. 
+ * Adds behaviour to CAknPopupList:
+ * If the currently selected item is user-defined item,
+ * the item is marked & 'OK' key is shown; Pressing
+ * the OK key will result in the item being actioned.
  * 
- * This is achieved by disabling multiple selection if the OK is
- * pressed when the currently selected item has TMPXGeneralCateroy equal
- * to EMPXCommand.
+ * Else on selecting static item, the input text dialog is shown
+ * with default media name, to create a new media.
  * 
- * @internal reviewed 06/06/2007 by Dave Schofield
  */
-NONSHARABLE_CLASS( CGlxSingleGraphicPopupMenuStyleListBox )
-   : public CAknSingleGraphicPopupMenuStyleListBox,
-   	 public MEikListBoxObserver 					
+NONSHARABLE_CLASS( CGlxSingleGraphicPopupMenuStyleList )
+   : public CAknPopupList
     {
-public: // new    
-    /**
-     * Determines if a particular item is visible.
-     * @param aItemIndex index of the item
-     * @return ETrue if the item is visible, else EFalse
-     */
-    TBool IsVisible(TInt aItemIndex);
-    
-     /**
-     * Populates iPopupList with the parameter passed.
-     * @param aPopupList Pointer to CAknPopupList object
-     */
-     void SetPopupList(CAknPopupList* aPopupList);
-    
-public: // from CCoeControl
-    /** See @ref CCoeControl::OfferKeyEventL */
-    IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
-    //From MEikListBoxObserver
+public: // new
+	
+	/**
+	 * Two phase constructor
+	 */
+	static CGlxSingleGraphicPopupMenuStyleList* NewL( 
+	   CEikListBox* aListBox, 
+	   TInt aCbaResource,
+	   AknPopupLayouts::TAknPopupLayouts aType = AknPopupLayouts::EMenuWindow);
+
+public: 
+	//From CAknPopupList
 	void HandleListBoxEventL (CEikListBox *aListBox, TListBoxEvent aEventType) ;
- 	void HandlePointerEventL(const TPointerEvent& aPointerEvent) ;
-
-private:
-
-	 /**
-     *  The popup list. (Owned)
-     */
-    CAknPopupList* iPopupList;
-    
+	void HandlePointerEventL(const TPointerEvent& aPointerEvent);
     };
     
 /**
@@ -306,12 +305,18 @@
     void FetchTitlesL();
 
     /**
-     * Instantiates the CAknPopupList and
-     * CGlxSingleGraphicPopupMenuStyleListBox
+     * Instantiates the CGlxSingleGraphicPopupMenuStyleList and
+     * CAknSingleGraphicPopupMenuStyleListBox
      * @param aMultiSelection Create a multi selection dialog.
      */
     void ConstructPopupListL(TBool aMultiSelection);
     
+    /**
+     * Retruns ETrue, if item index (i.e 'aIndex') 
+     * lies between TOP & BOTTOM item.
+     */
+    TBool IsListBoxItemVisible(TInt aIndex);
+    
 private:
 	/**
      *  The list of selected items. (Owned)
@@ -321,12 +326,12 @@
     /**
      *  The list box used by popup. (Owned)
      */
-    CGlxSingleGraphicPopupMenuStyleListBox* iListBox;
+    CAknSingleGraphicPopupMenuStyleListBox* iListBox;
     
     /**
      *  The popup list. (Owned)
      */
-    CAknPopupList* iPopupList;
+    CGlxSingleGraphicPopupMenuStyleList* iPopupList;
     
     /**
      * Resource offset
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdetails.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdetails.cpp	Tue May 25 12:42:31 2010 +0300
@@ -178,6 +178,11 @@
 			if ( err == KErrNone )
 				{
 				TInt focusIndex = aList.FocusIndex();
+				// In Grid view, details will be shown for the selected item
+				if (aList.SelectionCount() == 1) 
+					{ 
+					focusIndex = aList.SelectedItemIndex(0); 
+					} 
 				TGlxMedia item = aList.Item(focusIndex);
 				const CGlxMedia* media = item.Properties();
 
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlervideoplayback.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlervideoplayback.cpp	Tue May 25 12:42:31 2010 +0300
@@ -47,13 +47,20 @@
 #include <mpxmessage2.h> 
 #include <mpxplaybackmessage.h> 
 #include <mpxmessagegeneraldefs.h> 
-
+#include <glxgallery.hrh>
 /**
  * @internal reviewed 11/06/2007 by Alex Birkett
  */
 
 const TUid KVideoHelixPlaybackPluginUid = { 0x10282551 };
 
+/**
+ * Periodic interval for late construction.
+ * GridView construction would take about 2 sec,
+ * hence this can happen only after 2 secs 
+ */
+const TTimeIntervalMicroSeconds32 KPeriodicInterval  = 2000000; // 2 sec
+
 #include "glxcommandfactory.h"
 
 // ---------------------------------------------------------------------------
@@ -90,12 +97,16 @@
 void CGlxCommandHandlerVideoPlayback::ConstructL()
     {
     iUiUtility = CGlxUiUtility::UtilityL();
-    
      
     iViewUtility = MMPXViewUtility::UtilityL(); 
 
+    //Start construct timer for late initialization of "MMPXPlaybackUtility"
+    TCallBack callback(
+            CGlxCommandHandlerVideoPlayback::LateConstructCallback, this);
+    iPbUtilityConstructTimer = CPeriodic::NewL(CActive::EPriorityIdle);
+    iPbUtilityConstructTimer->Start(KPeriodicInterval, 0, callback);
+    
    	// Add supported commands
-   	
    	// Play videoplayback
    	TCommandInfo info(EGlxCmdPlay);
 	// filter out everything except videos
@@ -122,6 +133,12 @@
         iViewUtility->Close(); 
         } 
 
+    if (iPbUtilityConstructTimer)
+        {
+        iPbUtilityConstructTimer->Cancel();
+        delete iPbUtilityConstructTimer;
+        }
+    
     if ( iPlaybackUtility ) 
         { 
         TRAP_IGNORE( iPlaybackUtility->CommandL( EPbCmdClose ) ); 
@@ -188,46 +205,43 @@
 	// get the focused item from the media list
 	MGlxMediaList& mediaList = MediaList();
 
-    CGlxDefaultAttributeContext* attributeContext = CGlxDefaultAttributeContext::NewL();
+    CGlxDefaultAttributeContext* attributeContext =
+            CGlxDefaultAttributeContext::NewL();
     CleanupStack::PushL(attributeContext);
-    attributeContext->AddAttributeL(KMPXMediaGeneralUri);
-    attributeContext->AddAttributeL(KMPXMediaGeneralTitle);
-    attributeContext->AddAttributeL(KMPXMediaGeneralCategory);
-    mediaList.AddContextL(attributeContext, KGlxFetchContextPriorityBlocking);
-    
-    // TGlxContextRemover will remove the context when it goes out of scope
-    // Used here to avoid a trap and still have safe cleanup   
-    TGlxFetchContextRemover contextRemover (attributeContext, mediaList);    
-	CleanupClosePushL( contextRemover );
-	User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, mediaList));
-	// context off the list
-    CleanupStack::PopAndDestroy( &contextRemover );	
-	
-	TInt index = mediaList.FocusIndex();
-	TGlxMedia  item = mediaList.Item(index);
-	const CGlxMedia* media = item.Properties();
-	if(media)
-		{
-        if(media->IsSupported(KMPXMediaGeneralUri))
-            {
-            if (!iPlaybackUtility)
-                {
-                GLX_LOG_INFO( "CmdHandler VideoPlayback - SelectPlayerL(+)" );
-                const TUid playbackMode = { 0x200009EE };  // photos UID
-                iPlaybackUtility = MMPXPlaybackUtility::UtilityL(EMPXCategoryVideo, playbackMode );
-                MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
-                manager.SelectPlayerL( KVideoHelixPlaybackPluginUid );
-                iPlaybackUtility->AddObserverL( *this ); 
-                GLX_LOG_INFO( "CmdHandler VideoPlayback - SelectPlayerL(-)" );
-                }
-            // MPX playbackutility instead of VIA Player 
-            const TDesC& filename = media->ValueText(KMPXMediaGeneralUri); 
-            // Causes callback to HandlePlaybackMessage() 
-            iPlaybackUtility->InitL(filename); 
-            }
+
+    TInt focusIndex = mediaList.FocusIndex();
+    const TGlxMedia& mediaItem = mediaList.Item(focusIndex);
+    //If Item's uri is not present, only then retrieve 'uri'
+    if (!mediaItem.Uri().Length())
+        {
+        //Blocking call to retrieve Item Uri
+        attributeContext->AddAttributeL(KMPXMediaGeneralUri);
+        mediaList.AddContextL(attributeContext,
+                KGlxFetchContextPriorityBlocking);
+
+        // TGlxContextRemover will remove the context when it goes out of scope
+        // Used here to avoid a trap and still have safe cleanup   
+        TGlxFetchContextRemover contextRemover(attributeContext, mediaList);
+        CleanupClosePushL(contextRemover);
+
+        User::LeaveIfError(GlxAttributeRetriever::RetrieveL(
+                *attributeContext, mediaList));
+        // context off the list
+        CleanupStack::PopAndDestroy(&contextRemover);
         }
+
+    //Check if 'MPXPlaybackUtility' is already constructed
+    if (!iPlaybackUtility)
+        {
+        PlaybackUtilityL();
+        }
+    // MPX playbackutility instead of VIA Player 	
+    // Causes callback to HandlePlaybackMessage() 
+    iPlaybackUtility->InitL(mediaItem.Uri());
+
     CleanupStack::PopAndDestroy(attributeContext);
     }
+
 // -----------------------------------------------------------------------------
 // DoActivateL - Activate this command handler
 // -----------------------------------------------------------------------------
@@ -462,3 +476,40 @@
     CleanupStack::PopAndDestroy( &array ); 
     } 
 
+// -----------------------------------------------------------------------------
+// CGlxCommandHandlerVideoPlayback::LateConstructCallback
+// -----------------------------------------------------------------------------
+TInt CGlxCommandHandlerVideoPlayback::LateConstructCallback(TAny* aPtr)
+    {
+    TRACER("CGlxCommandHandlerVideoPlayback::LateConstructCallback");
+    static_cast<CGlxCommandHandlerVideoPlayback*>(aPtr)->DoLateConstruct();
+    return KErrNone;
+    }
+
+// -----------------------------------------------------------------------------
+// CGlxCommandHandlerVideoPlayback::DoLateConstruct
+// -----------------------------------------------------------------------------
+void CGlxCommandHandlerVideoPlayback::DoLateConstruct()
+    {
+    TRACER("CGlxCommandHandlerVideoPlayback::DoLateConstruct");
+    //Cancel the periodic timer
+    iPbUtilityConstructTimer->Cancel();
+    //Start 'MMPXPlaybackUtility' construction
+    TRAP_IGNORE( PlaybackUtilityL());
+    }
+
+// -----------------------------------------------------------------------------
+// CGlxCommandHandlerVideoPlayback::PlaybackUtilityL
+// -----------------------------------------------------------------------------
+void CGlxCommandHandlerVideoPlayback::PlaybackUtilityL()
+    {
+    TRACER("CGlxCommandHandlerVideoPlayback::PlaybackUtilityL");
+    if (!iPlaybackUtility)
+        {
+        iPlaybackUtility = MMPXPlaybackUtility::UtilityL(EMPXCategoryVideo,
+				TUid::Uid(KGlxGalleryApplicationUid) ); //use photos UID
+        MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
+        manager.SelectPlayerL(KVideoHelixPlaybackPluginUid);
+        iPlaybackUtility->AddObserverL(*this);
+        }
+    }
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxmediaselectionpopup.cpp	Tue May 25 12:42:31 2010 +0300
@@ -67,7 +67,8 @@
 //   
 EXPORT_C CGlxMediaListAdaptor::CGlxMediaListAdaptor(
         const MGlxMediaList* aMediaList, TBool aMultiSelection) :
-    iMediaList(aMediaList), iMultiSelection(aMultiSelection)
+    iMediaList(aMediaList), iMultiSelection(aMultiSelection),
+			iStaticItemSelected(EFalse)
     {
     }
 
@@ -153,174 +154,158 @@
     }
 
 // ---------------------------------------------------------------------------
-// CGlxSingleGraphicPopupMenuStyleListBox::IsVisible
+// CGlxMediaListAdaptor::IsStaticItemSelected
 // ---------------------------------------------------------------------------
-// 
-TBool CGlxSingleGraphicPopupMenuStyleListBox::IsVisible(TInt aItemIndex)
-    {
-    TRACER("CGlxSingleGraphicPopupMenuStyleListBox::IsVisible");
-    return (TopItemIndex() <= aItemIndex && aItemIndex <= BottomItemIndex());
-    }
+TBool CGlxMediaListAdaptor::IsStaticItemSelected()
+	{
+	TRACER("CGlxMediaListAdaptor::IsStaticItemSelected");
+	return iStaticItemSelected;
+	}
 
 // ---------------------------------------------------------------------------
-// CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL()
+// CGlxMediaListAdaptor::SetStaticItemSelected
 // ---------------------------------------------------------------------------
-//   
-EXPORT_C TKeyResponse CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL(
-        const TKeyEvent& aKeyEvent, TEventCode aType)
-    {
-    TRACER("CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL");
-    __ASSERT_DEBUG(dynamic_cast< CGlxMediaListAdaptor*>(Model()->ItemTextArray()), Panic(EGlxPanicCastFailed));
-
-    if (aKeyEvent.iCode == EKeyOK && iView)
-        {
-        CGlxMediaListAdaptor* mediaListAdaptor =
-                static_cast<CGlxMediaListAdaptor*> (Model()->ItemTextArray());
+void CGlxMediaListAdaptor::SetStaticItemSelected(TBool aSelected)
+	{
+	TRACER("CGlxMediaListAdaptor::SetStaticItemSelected");
+	iStaticItemSelected = aSelected;
+	}
 
-        if (mediaListAdaptor->MultiSelectionEnabled()
-                && View()->CurrentItemIndex() >= 0)
-            {
-            const TGlxMedia& item = mediaListAdaptor->MediaList()->Item(
-                    View()->CurrentItemIndex());
-            // Reset the observer to populist
-            SetListBoxObserver(iPopupList);
-            if (item.IsStatic())
-                {
-                iListBoxFlags &= (~EMultipleSelection); // turn off multiple selection
-                }
-            else
-                {
-                iListBoxFlags |= EMultipleSelection; // turn on multiple selection
-                }
-            }
-        }
+//---------------------------------------------------------------------------
+// CGlxSingleGraphicPopupMenuStyleList::NewL
+//---------------------------------------------------------------------------
+CGlxSingleGraphicPopupMenuStyleList* CGlxSingleGraphicPopupMenuStyleList::NewL(
+		CEikListBox* aListBox, TInt aCbaResource,
+		AknPopupLayouts::TAknPopupLayouts aType)
+	{
+	TRACER("CGlxSingleGraphicPopupMenuStyleList::NewL");
 
-    return CAknSingleGraphicPopupMenuStyleListBox::OfferKeyEventL(aKeyEvent,
-            aType);
-    }
+	CGlxSingleGraphicPopupMenuStyleList* self =
+		new (ELeave) CGlxSingleGraphicPopupMenuStyleList;
+	CleanupStack::PushL(self);
+	self->ConstructL(aListBox, aCbaResource, aType);
+	CleanupStack::Pop(self);
+	return self;
+	}
 
 // ---------------------------------------------------------------------------
-// CGlxSingleGraphicPopupMenuStyleListBox::HandleListBoxEventL()
+// CGlxSingleGraphicPopupMenuStyleList::HandleListBoxEventL()
 // ---------------------------------------------------------------------------
-// 
-void CGlxSingleGraphicPopupMenuStyleListBox::HandleListBoxEventL(
-        CEikListBox *aListBox, TListBoxEvent aEventType)
+//
+void CGlxSingleGraphicPopupMenuStyleList::HandleListBoxEventL(
+		CEikListBox *aListBox, TListBoxEvent aEventType)
     {
-    TRACER("CGlxSingleGraphicPopupMenuStyleListBox::HandleListBoxEventL");
+    TRACER("CGlxSingleGraphicPopupMenuStyleList::HandleListBoxEventL");
+
+    CAknSingleGraphicPopupMenuStyleListBox* listBox =
+			static_cast<CAknSingleGraphicPopupMenuStyleListBox*> (aListBox);
+
+    CGlxMediaListAdaptor
+			* mediaListAdaptor =
+					static_cast<CGlxMediaListAdaptor*> (listBox->Model()->ItemTextArray());
+
+    TBool staticItemSelected = EFalse;
+    TInt currItemIndx = listBox->View()->CurrentItemIndex();
+
     switch (aEventType)
         {
         case EEventItemClicked:
         case EEventItemSingleClicked:
             {
-            CGlxMediaListAdaptor
-                    * mediaListAdaptor =
-                            static_cast<CGlxMediaListAdaptor*> (Model()->ItemTextArray());
-            if (mediaListAdaptor->MultiSelectionEnabled()
-                    && View()->CurrentItemIndex() >= 0)
+
+            if (mediaListAdaptor->MultiSelectionEnabled() && currItemIndx >= 0)
                 {
                 const TGlxMedia& item = mediaListAdaptor->MediaList()->Item(
-                        View()->CurrentItemIndex());
-                if (item.IsStatic())
+						currItemIndx);
+
+                //Check if media item is user-defined or static
+                staticItemSelected = item.IsStatic();
+                mediaListAdaptor->SetStaticItemSelected(staticItemSelected);
+                if (!staticItemSelected)
                     {
-                    // when the user marks a non-static item and then clicks on
-                    // a static item without moving highlight, the control comes here.
-                    iListBoxFlags &= (~EMultipleSelection); // turn off multiple selection
+					//Mark or UnMark the user-defined item
+                    TBool isMarked = listBox->View()->ItemIsSelected(currItemIndx);
+                    (isMarked == (TBool) ETrue) ? (listBox->View()->DeselectItem(
+							currItemIndx))
+							: (listBox->View()->SelectItemL(currItemIndx));
                     }
-                else
-                    {
-                    iListBoxFlags |= EMultipleSelection; // turn on multiple selection
 
-                    TBool isMarked = View()->ItemIsSelected(
-                            View()->CurrentItemIndex());
-                    (isMarked == (TBool) ETrue)
-                                                ? (View()->DeselectItem(
-                                                       View()->CurrentItemIndex()))
-                                                   : (View()->SelectItemL(
-                                                           View()->CurrentItemIndex()));
-                    }
+                //Show Command Set based on selected items
+                TInt selectCount = listBox->View()->SelectionIndexes()->Count();
+				CEikButtonGroupContainer* cbaContainer = ButtonGroupContainer();
+				//Show 'OK' only if a static item or more than
+				//1 user-defined item is selected
+				if(staticItemSelected || selectCount)
+					{
+					cbaContainer->SetCommandSetL(R_GLX_SOFTKEYS_OK_CANCEL);
+					}
+				else
+					{
+					cbaContainer->SetCommandSetL(R_AVKON_SOFTKEYS_CANCEL);
+					}
+				cbaContainer->DrawDeferred();
+
                 }
-            aListBox->DrawDeferred();
+            listBox->DrawDeferred();
+
+            //Forward for default processing, if static item is selected(i.e. For Tags)
+			//or if List Box's Multiple selection is Disabled(i.e. For Albums)
+			if (staticItemSelected
+					|| (!mediaListAdaptor->MultiSelectionEnabled()))
+				{
+				CAknPopupList::HandleListBoxEventL( aListBox, aEventType);
+				}
+
+			//After Scrolling, then Select "New Tag" i.e Static item is selected
+			if (staticItemSelected)
+				{
+				ProcessCommandL(EAknSoftkeyOk);
+				}
+
             break;
             }
         default:
-            break;
+        	{
+        	CAknPopupList::HandleListBoxEventL( aListBox, aEventType);
+        	break;
+        	}
         }
     }
 
 // ---------------------------------------------------------------------------
-// CGlxSingleGraphicPopupMenuStyleListBox::HandlePointerEventL()
+// CGlxSingleGraphicPopupMenuStyleList::HandlePointerEventL()
 // ---------------------------------------------------------------------------
-//  
-void CGlxSingleGraphicPopupMenuStyleListBox::HandlePointerEventL(
-        const TPointerEvent& aPointerEvent)
+//
+void CGlxSingleGraphicPopupMenuStyleList::HandlePointerEventL(
+		const TPointerEvent& aPointerEvent)
     {
-    TRACER("CGlxSingleGraphicPopupMenuStyleListBox::HandlePointerEventL");
-    CGlxMediaListAdaptor* mediaListAdaptor =
-            static_cast<CGlxMediaListAdaptor*> (Model()->ItemTextArray());
-    if (mediaListAdaptor->MultiSelectionEnabled())
-        {
-        // Need to handle the case when the highlight is on one item
-        // and the user clicks on another media item. The notification 
-        // of changed item index is received very late. In order to
-        // handle this, checking if the index has changed.
-        TInt changedItemIndex = -1;
-        TInt itemIndex = View()->CurrentItemIndex();
-        TBool isItemChanged = View()->XYPosToItemIndex(
-                aPointerEvent.iPosition, changedItemIndex);
-        if (isItemChanged)
-            {
-            itemIndex = changedItemIndex;
-            }
-        const TGlxMedia& item =
-                mediaListAdaptor->MediaList()->Item(itemIndex);
-        if (item.IsStatic())
-            {
-            // A static item is not markable. Turn off multiple selection
-            // Set the listbox observer to default that is CAknPopupList 
-            // object, which will process it further.
-            iListBoxFlags &= (~EMultipleSelection);
-            SetListBoxObserver(iPopupList);
-            }
-        else
-            {
-            // Markable object. The event is handled in HandleListBoxEventL()
-            // Set the listbox observer to the current object.
-            SetListBoxObserver(this);
-            }
+	TRACER("CGlxSingleGraphicPopupMenuStyleList::HandlePointerEventL");
+
+    CAknSingleGraphicPopupMenuStyleListBox* listBox =
+			static_cast<CAknSingleGraphicPopupMenuStyleListBox*> (ListBox());
+	CGlxMediaListAdaptor
+			* mediaListAdaptor =
+					static_cast<CGlxMediaListAdaptor*> (listBox->Model()->ItemTextArray());
 
-        CAknSingleGraphicPopupMenuStyleListBox::HandlePointerEventL(
-                aPointerEvent);
-
-        const CListBoxView::CSelectionIndexArray* selectionIndices =
-                View()->SelectionIndexes();
-        CEikButtonGroupContainer* cbaContainer =
-                iPopupList->ButtonGroupContainer();
-        if (selectionIndices->Count() || item.IsStatic())
-            {
-            cbaContainer->SetCommandSetL(R_GLX_SOFTKEYS_OK_CANCEL);
-            }
-        else
-            {
-            cbaContainer->SetCommandSetL(R_AVKON_SOFTKEYS_CANCEL);
-            }
-        cbaContainer->DrawDeferred();
+	//Check for MultipleSelection is Disbaled
+    if ( !(mediaListAdaptor->MultiSelectionEnabled()) )
+    	{
+		//checking if the index has changed & has valid item available
+		TInt changedItemIndex = KErrNotFound;
+        TBool isItemAvailable = listBox->View()->XYPosToItemIndex(
+				aPointerEvent.iPosition, changedItemIndex);
+        if(isItemAvailable)
+			{
+			//Check if Selected item is static
+			const TGlxMedia& item = mediaListAdaptor->MediaList()->Item(
+					changedItemIndex);
+			mediaListAdaptor->SetStaticItemSelected( item.IsStatic() );
+			}
         }
-    else
-        {
-        CAknSingleGraphicPopupMenuStyleListBox::HandlePointerEventL(
-                aPointerEvent);
-        }
-    }
 
-// ---------------------------------------------------------------------------
-// CGlxSingleGraphicPopupMenuStyleListBox::SetPopupList()
-// ---------------------------------------------------------------------------
-// 
-void CGlxSingleGraphicPopupMenuStyleListBox::SetPopupList(
-        CAknPopupList* aPopupList)
-    {
-    TRACER("CGlxSingleGraphicPopupMenuStyleListBox::SetPopupList");
-    iPopupList = aPopupList;
+    //Forward for default processing
+    CAknPopupList::HandlePointerEventL( aPointerEvent);
+
     }
 
 // ---------------------------------------------------------------------------
@@ -411,11 +396,13 @@
     if (aAccepted)
         {
 
-        if (iMediaList->Item(iListBox->CurrentItemIndex()).IsStatic())
+		//Check if a static item is selected
+		if (iMediaListAdaptor->IsStaticItemSelected())
             {
 			TFileName uiutilitiesrscfile;
-			uiutilitiesrscfile.Append(CGlxResourceUtilities::GetUiUtilitiesResourceFilenameL());
-			CGlxCommandHandlerNewMedia* commandHandlerNewMedia =
+			uiutilitiesrscfile.Append(
+					CGlxResourceUtilities::GetUiUtilitiesResourceFilenameL());
+            CGlxCommandHandlerNewMedia* commandHandlerNewMedia =
 			CGlxCommandHandlerNewMedia::NewL(this,uiutilitiesrscfile);
             TGlxMediaId newMediaId;
             TInt error = commandHandlerNewMedia->ExecuteLD(newMediaId);
@@ -595,7 +582,7 @@
         {
         for (TInt i = 0; i < aItemIndexes.Count(); i++)
             {
-            if (iListBox->IsVisible(aItemIndexes[i]))
+            if (IsListBoxItemVisible(aItemIndexes[i]))
                 {
                 iListBox->RedrawItem(aItemIndexes[i]);
                 }
@@ -618,8 +605,8 @@
             iListBox->HandleItemAdditionL();
             iHandleItemAdditionRequired = EFalse;
             }
-        if (iListBox->IsVisible(aItemIndex))
-            {
+        if (IsListBoxItemVisible(aItemIndex))
+			{
             iListBox->RedrawItem(aItemIndex);
             }
         }
@@ -841,10 +828,10 @@
     {
     TRACER("CGlxMediaSelectionPopup::ConstructPopupListL");
     // create the list box
-    iListBox = new (ELeave) CGlxSingleGraphicPopupMenuStyleListBox;
+    iListBox = new (ELeave) CAknSingleGraphicPopupMenuStyleListBox;
 
     // create the popup list
-    iPopupList = CAknPopupList::NewL(iListBox, R_AVKON_SOFTKEYS_CANCEL);
+    iPopupList = CGlxSingleGraphicPopupMenuStyleList::NewL( iListBox, R_AVKON_SOFTKEYS_CANCEL) ;
 
     // set the title of the popup
     __ASSERT_DEBUG(iSelectMediaPopupTitle, Panic(EGlxPanicNullPointer));
@@ -853,7 +840,7 @@
 
     iListBox ->ConstructL(iPopupList,
             aMultiSelection
-                            ? EAknListBoxMultiselectionList
+                            ?  EAknListBoxMultiselectionList
                                : EAknListBoxMenuList);
     iListBox->CreateScrollBarFrameL();
     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
@@ -863,7 +850,16 @@
     iListBox->View()->CalcBottomItemIndex();
     iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
 
-    // Store the pointer of AknPopupList
-    iListBox->SetPopupList(iPopupList);
+    //set 'iPopupList' as List Box observer
+    iListBox->SetListBoxObserver(iPopupList);
     }
 
+//-----------------------------------------------------------------------------
+// CGlxMediaSelectionPopup::IsListBoxItemVisible
+//-----------------------------------------------------------------------------
+TBool CGlxMediaSelectionPopup::IsListBoxItemVisible(TInt aIndex)
+	{
+	TRACER("CGlxMediaSelectionPopup::IsListBoxItemVisible");
+	return iListBox && (iListBox->TopItemIndex() <= aIndex &&
+			aIndex <= iListBox->BottomItemIndex());
+	}
--- a/photosgallery/viewframework/dataprovider/group/dataprovider.mmp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/dataprovider/group/dataprovider.mmp	Tue May 25 12:42:31 2010 +0300
@@ -94,5 +94,6 @@
 LIBRARY					flogger.lib
 LIBRARY					exiflib.lib                     //For CExifModify
 LIBRARY			avkon.lib eikcore.lib  // For AknUtils.h
+LIBRARY                 glximageviewermanager.lib
 // End of File
  
\ No newline at end of file
--- a/photosgallery/viewframework/dataprovider/inc/glxmulthumbnailvarianttype.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/dataprovider/inc/glxmulthumbnailvarianttype.h	Tue May 25 12:42:31 2010 +0300
@@ -25,6 +25,7 @@
 #include <e32base.h>                  // Container Base Class
 #include <mul/mulvarianttype.h>       // Observer interface used to be notified when texture content changes
 #include "mglxtextureobserver.h"      // Observer interface used to be notified when texture content changes
+#include <glximageviewermanager.h>
 
 class TGlxMedia;                      // Reference to a media item in the item pool.
 class CGlxUiUtility;                  // Alf utils ; lib glxalfutils.lib
@@ -82,12 +83,24 @@
      */     
      TBool HasRelevantThumbnail(const TGlxMedia& aMedia, 
                                      const TSize& aSize);
+     /**
+      * Create Image Viewer manager Instance
+      */
+     void CreateImageViewerInstanceL();
+     
+     /**
+      * Delete Image Viewer manager Instance
+      */
+     void DeleteImageViewerInstance();
+
         
 private:
     int mTextureId;
     CGlxUiUtility* iUiUtility;
     /** Poniter to instance of DRM utility (owned) */
     CGlxDRMUtility* iDrmUtility; 
+    /** For image viewer, not own */
+    CGlxImageViewerManager* iImageViewerInstance;
     };  
 
 /**
--- a/photosgallery/viewframework/dataprovider/src/glxthumbnailvarianttype.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/dataprovider/src/glxthumbnailvarianttype.cpp	Tue May 25 12:42:31 2010 +0300
@@ -129,47 +129,71 @@
     //URI length could be zero for Media Id based Thumbnail fetch
     else if ( fsTnmAvailable ) 
 	    {
-	    GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL");
-	    TMPXGeneralCategory cat = aMedia.Category();
-	    //Check if media is DRM rights protected
-	    if(drm)
+        GLX_DEBUG1("GlxThumbnailVariantType::CreateThumbnailTextureL");
+        TMPXGeneralCategory cat = aMedia.Category();
+        //Check if media is DRM rights protected
+        if (drm)
             {
+            TBool privatePath = EFalse;
+            CreateImageViewerInstanceL();
+            if (iImageViewerInstance->IsPrivate())
+                {
+                privatePath = ETrue;
+                }
 
             //call 'DisplayItemRightsCheckL' only for focused item
-            if(aIsFocused)
-            	{
-            	expired = !iDrmUtility->DisplayItemRightsCheckL(uri, (cat == EMPXImage));
-            	}
-            else
-            	{
-            	//call 'ItemRightsValidityCheckL' for validity check of non-focused item
-            	expired = !iDrmUtility->ItemRightsValidityCheckL(uri, (cat == EMPXImage));
-            	}
-
-            //Check If DRM rights have expired.
-            if( expired )
+            if (aIsFocused)
                 {
-                TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL(
-                                                                    EMbmGlxiconsQgn_prop_image_notcreated, resFile, defaultSize ).Id() );
+                if (privatePath)
+                    {
+                    expired = !iDrmUtility->DisplayItemRightsCheckL
+                                        (iImageViewerInstance->ImageFileHandle(),(cat == EMPXImage));
+                    }
+                else
+                    {
+                    expired = !iDrmUtility->DisplayItemRightsCheckL(uri, (cat == EMPXImage));
+                    }
                 }
             else
                 {
-                if ( isValid == EGlxDrmRightsValid)
-					{
-					// Fix for EABI-7RL9DD
-					// Replaced defaultSize with aSize
-					TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL(
-													aMedia, aMedia.IdSpaceId(), aSize, this ).Id() );
-					}
+                if (privatePath)
+                    {
+                    expired = !iDrmUtility->ItemRightsValidityCheckL(
+                            iImageViewerInstance->ImageFileHandle(), (cat
+                                    == EMPXImage));
+                    }
+                else
+                    {
+                    //call 'ItemRightsValidityCheckL' for validity check of non-focused item
+                    expired = !iDrmUtility->ItemRightsValidityCheckL(uri,
+                            (cat == EMPXImage));
+                    }
+                }
+            DeleteImageViewerInstance();
+            //Check If DRM rights have expired.
+            if (expired)
+                {
+                TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateIconTextureL(
+                                EMbmGlxiconsQgn_prop_image_notcreated, resFile, defaultSize ).Id() );
+                }
+            else
+                {
+                if (isValid == EGlxDrmRightsValid)
+                    {
+                    // Fix for EABI-7RL9DD
+                    // Replaced defaultSize with aSize
+                    TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL(
+                                    aMedia, aMedia.IdSpaceId(), aSize, this ).Id() );
+                    }
 
                 }
-            } 
-		else
-		    {
-			TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL( 
-				aMedia, aMedia.IdSpaceId(), aSize, this ).Id() );
-		    }
-	    }
+            }
+        else
+            {
+            TRAP( err, mTextureId = iUiUtility->GlxTextureManager().CreateThumbnailTextureL(
+                            aMedia, aMedia.IdSpaceId(), aSize, this ).Id() );
+            }
+        }
     else if ( aMedia.GetIconInfo(icon) )
 	    {  
 	    GLX_DEBUG1("GlxThumbnailVariantType::CreateIconTextureL");
@@ -398,6 +422,30 @@
         }
     return EFalse;
     }
+	
+// -----------------------------------------------------------------------------
+// CreateImageViewerInstanceL
+// -----------------------------------------------------------------------------
+//
+void GlxThumbnailVariantType::CreateImageViewerInstanceL()
+    {
+    TRACER("GlxThumbnailVariantType::CreateImageViewerInstanceL");
+    iImageViewerInstance = CGlxImageViewerManager::InstanceL();    
+    __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer));
+    }
+
+// -----------------------------------------------------------------------------
+// DeleteImageViewerInstance
+// -----------------------------------------------------------------------------
+//
+void GlxThumbnailVariantType::DeleteImageViewerInstance()
+    {
+    TRACER("GlxThumbnailVariantType::DeleteImageViewerInstance");
+    if ( iImageViewerInstance )
+        {
+        iImageViewerInstance->DeleteInstance();
+        }
+    }
 
 // ----------------------------------------------------------------------------
 // type
--- a/photosgallery/viewframework/drmutility/bwins/glxdrmutilityu.def	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/drmutility/bwins/glxdrmutilityu.def	Tue May 25 12:42:31 2010 +0300
@@ -1,16 +1,21 @@
 EXPORTS
-	?SetAsAutomatedL@CGlxDRMUtility@@QAEXABVTDesC16@@W4TGlxDrmAutomatedType@@@Z @ 1 NONAME ; void CGlxDRMUtility::SetAsAutomatedL(class TDesC16 const &, enum TGlxDrmAutomatedType)
-	?DisplayItemRightsCheckL@CGlxDRMUtility@@QAEHABVTDesC16@@H@Z @ 2 NONAME ; int CGlxDRMUtility::DisplayItemRightsCheckL(class TDesC16 const &, int)
-	?CanSetAsAutomatedL@CGlxDRMUtility@@QAEHABVTDesC16@@W4TGlxDrmAutomatedType@@@Z @ 3 NONAME ; int CGlxDRMUtility::CanSetAsAutomatedL(class TDesC16 const &, enum TGlxDrmAutomatedType)
-	?IsForwardLockedL@CGlxDRMUtility@@QAEHABVTDesC16@@@Z @ 4 NONAME ; int CGlxDRMUtility::IsForwardLockedL(class TDesC16 const &)
-	?ClearLastConsumedItemUriL@CGlxDRMUtility@@QAEXXZ @ 5 NONAME ; void CGlxDRMUtility::ClearLastConsumedItemUriL(void)
-	?ConsumeRightsL@CGlxDRMUtility@@QAEHABVTDesC16@@@Z @ 6 NONAME ; int CGlxDRMUtility::ConsumeRightsL(class TDesC16 const &)
-	?ShowRightsInfoL@CGlxDRMUtility@@QAEXABVTDesC16@@@Z @ 7 NONAME ; void CGlxDRMUtility::ShowRightsInfoL(class TDesC16 const &)
-	?InstanceL@CGlxDRMUtility@@SAPAV1@XZ @ 8 NONAME ; class CGlxDRMUtility * CGlxDRMUtility::InstanceL(void)
-	?ShowInfoOnlineL@CGlxDRMUtility@@QAEXABVTDesC16@@@Z @ 9 NONAME ; void CGlxDRMUtility::ShowInfoOnlineL(class TDesC16 const &)
-	?ShowDRMDetailsPaneL@CGlxDRMUtility@@QAEXABVTDesC16@@@Z @ 10 NONAME ; void CGlxDRMUtility::ShowDRMDetailsPaneL(class TDesC16 const &)
-	?CanShowInfoOnlineL@CGlxDRMUtility@@QAEHABVTDesC16@@@Z @ 11 NONAME ; int CGlxDRMUtility::CanShowInfoOnlineL(class TDesC16 const &)
-	?DRMThumbnailSize@CGlxDRMUtility@@QAE?AVTSize@@AAV2@@Z @ 12 NONAME ; class TSize CGlxDRMUtility::DRMThumbnailSize(class TSize &)
-	?ItemRightsValidityCheckL@CGlxDRMUtility@@QAEHABVTDesC16@@H@Z @ 13 NONAME ; int CGlxDRMUtility::ItemRightsValidityCheckL(class TDesC16 const &, int)
-	?Close@CGlxDRMUtility@@QAEXXZ @ 14 NONAME ; void CGlxDRMUtility::Close(void)
+	?InstanceL@CGlxDRMUtility@@SAPAV1@XZ @ 1 NONAME ; class CGlxDRMUtility * CGlxDRMUtility::InstanceL(void)
+	?ShowDRMDetailsPaneL@CGlxDRMUtility@@QAEXAAVRFile@@@Z @ 2 NONAME ; void CGlxDRMUtility::ShowDRMDetailsPaneL(class RFile &)
+	?ShowRightsInfoL@CGlxDRMUtility@@QAEXABVTDesC16@@@Z @ 3 NONAME ; void CGlxDRMUtility::ShowRightsInfoL(class TDesC16 const &)
+	?DRMThumbnailSize@CGlxDRMUtility@@QAE?AVTSize@@AAV2@@Z @ 4 NONAME ; class TSize CGlxDRMUtility::DRMThumbnailSize(class TSize &)
+	?ItemRightsValidityCheckL@CGlxDRMUtility@@QAEHABVTDesC16@@H@Z @ 5 NONAME ; int CGlxDRMUtility::ItemRightsValidityCheckL(class TDesC16 const &, int)
+	?ClearLastConsumedItemUriL@CGlxDRMUtility@@QAEXXZ @ 6 NONAME ; void CGlxDRMUtility::ClearLastConsumedItemUriL(void)
+	?DisplayItemRightsCheckL@CGlxDRMUtility@@QAEHAAVRFile@@H@Z @ 7 NONAME ; int CGlxDRMUtility::DisplayItemRightsCheckL(class RFile &, int)
+	?ShowRightsInfoL@CGlxDRMUtility@@QAEXAAVRFile@@@Z @ 8 NONAME ; void CGlxDRMUtility::ShowRightsInfoL(class RFile &)
+	?CanShowInfoOnlineL@CGlxDRMUtility@@QAEHABVTDesC16@@@Z @ 9 NONAME ; int CGlxDRMUtility::CanShowInfoOnlineL(class TDesC16 const &)
+	?Close@CGlxDRMUtility@@QAEXXZ @ 10 NONAME ; void CGlxDRMUtility::Close(void)
+	?SetAsAutomatedL@CGlxDRMUtility@@QAEXABVTDesC16@@W4TGlxDrmAutomatedType@@@Z @ 11 NONAME ; void CGlxDRMUtility::SetAsAutomatedL(class TDesC16 const &, enum TGlxDrmAutomatedType)
+	?CanSetAsAutomatedL@CGlxDRMUtility@@QAEHABVTDesC16@@W4TGlxDrmAutomatedType@@@Z @ 12 NONAME ; int CGlxDRMUtility::CanSetAsAutomatedL(class TDesC16 const &, enum TGlxDrmAutomatedType)
+	?ConsumeRightsL@CGlxDRMUtility@@QAEHABVTDesC16@@@Z @ 13 NONAME ; int CGlxDRMUtility::ConsumeRightsL(class TDesC16 const &)
+	?IsForwardLockedL@CGlxDRMUtility@@QAEHABVTDesC16@@@Z @ 14 NONAME ; int CGlxDRMUtility::IsForwardLockedL(class TDesC16 const &)
+	?DisplayItemRightsCheckL@CGlxDRMUtility@@QAEHABVTDesC16@@H@Z @ 15 NONAME ; int CGlxDRMUtility::DisplayItemRightsCheckL(class TDesC16 const &, int)
+	?ItemRightsValidityCheckL@CGlxDRMUtility@@QAEHAAVRFile@@H@Z @ 16 NONAME ; int CGlxDRMUtility::ItemRightsValidityCheckL(class RFile &, int)
+	?ShowDRMDetailsPaneL@CGlxDRMUtility@@QAEXABVTDesC16@@@Z @ 17 NONAME ; void CGlxDRMUtility::ShowDRMDetailsPaneL(class TDesC16 const &)
+	?ShowInfoOnlineL@CGlxDRMUtility@@QAEXABVTDesC16@@@Z @ 18 NONAME ; void CGlxDRMUtility::ShowInfoOnlineL(class TDesC16 const &)
+	?ConsumeRightsL@CGlxDRMUtility@@QAEHAAVRFile@@@Z @ 19 NONAME ; int CGlxDRMUtility::ConsumeRightsL(class RFile &)
 
--- a/photosgallery/viewframework/drmutility/eabi/glxdrmutilityu.def	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/drmutility/eabi/glxdrmutilityu.def	Tue May 25 12:42:31 2010 +0300
@@ -1,16 +1,21 @@
 EXPORTS
-	_ZN14CGlxDRMUtility14ConsumeRightsLERK7TDesC16 @ 1 NONAME
-	_ZN14CGlxDRMUtility15SetAsAutomatedLERK7TDesC1620TGlxDrmAutomatedType @ 2 NONAME
-	_ZN14CGlxDRMUtility15ShowInfoOnlineLERK7TDesC16 @ 3 NONAME
-	_ZN14CGlxDRMUtility15ShowRightsInfoLERK7TDesC16 @ 4 NONAME
-	_ZN14CGlxDRMUtility16DRMThumbnailSizeER5TSize @ 5 NONAME
-	_ZN14CGlxDRMUtility16IsForwardLockedLERK7TDesC16 @ 6 NONAME
-	_ZN14CGlxDRMUtility18CanSetAsAutomatedLERK7TDesC1620TGlxDrmAutomatedType @ 7 NONAME
-	_ZN14CGlxDRMUtility18CanShowInfoOnlineLERK7TDesC16 @ 8 NONAME
-	_ZN14CGlxDRMUtility19ShowDRMDetailsPaneLERK7TDesC16 @ 9 NONAME
-	_ZN14CGlxDRMUtility23DisplayItemRightsCheckLERK7TDesC16i @ 10 NONAME
-	_ZN14CGlxDRMUtility24ItemRightsValidityCheckLERK7TDesC16i @ 11 NONAME
-	_ZN14CGlxDRMUtility25ClearLastConsumedItemUriLEv @ 12 NONAME
-	_ZN14CGlxDRMUtility5CloseEv @ 13 NONAME
-	_ZN14CGlxDRMUtility9InstanceLEv @ 14 NONAME
+	_ZN14CGlxDRMUtility14ConsumeRightsLER5RFile @ 1 NONAME
+	_ZN14CGlxDRMUtility14ConsumeRightsLERK7TDesC16 @ 2 NONAME
+	_ZN14CGlxDRMUtility15SetAsAutomatedLERK7TDesC1620TGlxDrmAutomatedType @ 3 NONAME
+	_ZN14CGlxDRMUtility15ShowInfoOnlineLERK7TDesC16 @ 4 NONAME
+	_ZN14CGlxDRMUtility15ShowRightsInfoLER5RFile @ 5 NONAME
+	_ZN14CGlxDRMUtility15ShowRightsInfoLERK7TDesC16 @ 6 NONAME
+	_ZN14CGlxDRMUtility16DRMThumbnailSizeER5TSize @ 7 NONAME
+	_ZN14CGlxDRMUtility16IsForwardLockedLERK7TDesC16 @ 8 NONAME
+	_ZN14CGlxDRMUtility18CanSetAsAutomatedLERK7TDesC1620TGlxDrmAutomatedType @ 9 NONAME
+	_ZN14CGlxDRMUtility18CanShowInfoOnlineLERK7TDesC16 @ 10 NONAME
+	_ZN14CGlxDRMUtility19ShowDRMDetailsPaneLER5RFile @ 11 NONAME
+	_ZN14CGlxDRMUtility19ShowDRMDetailsPaneLERK7TDesC16 @ 12 NONAME
+	_ZN14CGlxDRMUtility23DisplayItemRightsCheckLER5RFilei @ 13 NONAME
+	_ZN14CGlxDRMUtility23DisplayItemRightsCheckLERK7TDesC16i @ 14 NONAME
+	_ZN14CGlxDRMUtility24ItemRightsValidityCheckLER5RFilei @ 15 NONAME
+	_ZN14CGlxDRMUtility24ItemRightsValidityCheckLERK7TDesC16i @ 16 NONAME
+	_ZN14CGlxDRMUtility25ClearLastConsumedItemUriLEv @ 17 NONAME
+	_ZN14CGlxDRMUtility5CloseEv @ 18 NONAME
+	_ZN14CGlxDRMUtility9InstanceLEv @ 19 NONAME
 
--- a/photosgallery/viewframework/drmutility/inc/glxdrmutility.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/drmutility/inc/glxdrmutility.h	Tue May 25 12:42:31 2010 +0300
@@ -29,7 +29,7 @@
 // INCLUDES
 
 #include <e32base.h>
-
+#include <f32file.h>
 // FORWARD DECLARATIONS
 
 class CDRMHelper;
@@ -90,6 +90,16 @@
      * @return ETrue if valid rights exist for the media item.
      */
     IMPORT_C TBool ItemRightsValidityCheckL(const TDesC& aUri, TBool aCheckViewRights);
+    
+    /**
+     * Check whether DRM rights are valid for specified item
+     * is called before right is consumed and for all items (focused or unfocused).
+     * 
+     * @param filehandle of the media item.
+     * @param aCheckViewRights, check view rights if true, play if false
+     * @return ETrue if valid rights exist for the media item.
+     */
+    IMPORT_C TBool ItemRightsValidityCheckL(RFile& aFileHandle, TBool aCheckViewRights);
 
     /**
      * Check whether DRM rights are valid for specified item
@@ -104,6 +114,18 @@
     IMPORT_C TBool DisplayItemRightsCheckL(const TDesC& aUri, TBool aCheckViewRights);
     
     /**
+     * Check whether DRM rights are valid for specified item
+     * If the rights were just consumed, then allow to display
+     * Otherwise, obtain current rights
+     * is called after right is consumed and for only focused/displayed item.
+     * 
+     * @param filehandle of the media item.
+     * @param aCheckViewRights, check view rights if true, play if false
+     * @return ETrue if valid rights exist for the media item.
+     */
+    IMPORT_C TBool DisplayItemRightsCheckL(RFile& aFileHandle, TBool aCheckViewRights);
+    
+    /**
       * Consume rights for specified item
       * Caches item so that a client has right to display the item
       *
@@ -111,6 +133,15 @@
       * @return ETrue to no error in rights consumption
       */
     IMPORT_C TBool ConsumeRightsL(const TDesC& aUri);
+    
+    /**
+      * Consume rights for specified item
+      * Caches item so that a client has right to display the item
+      *
+      * @param  Filehandle for item
+      * @return ETrue to no error in rights consumption
+      */
+    IMPORT_C TBool ConsumeRightsL(RFile& aFileHandle);
 
     /**
      * Clears Last Consumed Uri
@@ -153,6 +184,12 @@
     IMPORT_C void ShowDRMDetailsPaneL(const TDesC& aUri);
     
     /**
+     * Show DRM details for specified item.
+     * @param Filehandle of the media item.
+     */
+    IMPORT_C void ShowDRMDetailsPaneL(RFile& aFileHandle);
+    
+    /**
       * Ask DRM manager if file is forward locked
       */
     IMPORT_C TBool IsForwardLockedL(const TDesC& aUri);
@@ -164,6 +201,12 @@
     IMPORT_C void ShowRightsInfoL(const TDesC& aUri);
     
     /**
+      * Show rights info
+      * @param filehandle of the media item.
+      */
+    IMPORT_C void ShowRightsInfoL(RFile& aFileHandle);
+    
+    /**
       * Get size of thumbnail to be requested for DRM invalid item
       * @param aSize size of image
       * @return suggested thumbnail size (1/4 of original size)
--- a/photosgallery/viewframework/drmutility/src/glxdrmutility.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/drmutility/src/glxdrmutility.cpp	Tue May 25 12:42:31 2010 +0300
@@ -154,6 +154,23 @@
     }
 
 //============================================================================
+// ItemRightsValidityCheckL
+// for checking DRM rights validity for item.
+// is called before right is consumed and for all items (focused or unfocused).
+//============================================================================
+EXPORT_C TBool CGlxDRMUtility::ItemRightsValidityCheckL( RFile& aFileHandle,
+                                                TBool aCheckViewRights )
+    {
+    TRACER("CGlxDRMUtility::ItemRightsValidityCheckL()");
+    TBool rightsValid = EFalse;
+
+    ContentAccess::CContent* content = ContentAccess::CContent::NewLC( aFileHandle );
+    TInt err( content->GetAttribute( ContentAccess::ECanView, rightsValid ) );
+    CleanupStack::PopAndDestroy( content );
+    return rightsValid;
+    }
+
+//============================================================================
 // DisplayItemRightsCheckL
 // is called after right is consumed and for only focused/displayed item.
 //============================================================================
@@ -179,6 +196,19 @@
     }
 
 //============================================================================
+// DisplayItemRightsCheckL
+// is called after right is consumed and for only focused/displayed item.
+//============================================================================
+EXPORT_C TBool CGlxDRMUtility::DisplayItemRightsCheckL( RFile& aFileHandle,
+                                                    TBool aCheckViewRights )
+    {
+    TRACER("CGlxDRMUtility::DisplayItemRightsCheckL()");
+    // Otherwise, check current rights for the URI of newly focused item
+    return ItemRightsValidityCheckL( aFileHandle, aCheckViewRights );
+    }
+
+
+//============================================================================
 // ConsumeRightsL
 //============================================================================    
 EXPORT_C TBool CGlxDRMUtility::ConsumeRightsL(const TDesC& aUri)
@@ -209,6 +239,19 @@
     return (err == KErrNone);
     }
 
+
+//============================================================================
+// ConsumeRightsL
+//============================================================================    
+EXPORT_C TBool CGlxDRMUtility::ConsumeRightsL(RFile& aFileHandle)
+    {
+    TRACER("CGlxDRMUtility::ConsumeRightsL(RFile& aFileHandle)");
+    CData* data = CData::NewLC( aFileHandle, KDefaultContentObject(), EPeek );
+    TInt err = data->ExecuteIntent(ContentAccess::EView);
+    CleanupStack::PopAndDestroy( data );
+    return (err == KErrNone);
+    }
+
 //============================================================================
 //Clears Last Consumed Uri
 //============================================================================
@@ -315,6 +358,21 @@
     }
 
 //============================================================================
+// ShowDRMDetailsPane
+//============================================================================  
+EXPORT_C void CGlxDRMUtility::ShowDRMDetailsPaneL(RFile& aFileHandle)
+    {
+    TRACER("CGlxDRMUtility::ShowDRMDetailsPaneL()");
+    TRAPD( err, iDrmHelper->LaunchDetailsViewEmbeddedL( aFileHandle ) );
+    // if no rights ask user to re-activate
+    if( err == KErrCANoRights )
+        {
+        //need to check if we need to handle.
+        }
+
+    }
+
+//============================================================================
 // IsForwardLockedL
 //============================================================================  
 EXPORT_C TBool CGlxDRMUtility::IsForwardLockedL(const TDesC& aUri)
@@ -339,6 +397,15 @@
     }
 
 //============================================================================
+// ShowRightsInfoL
+//============================================================================    
+EXPORT_C void CGlxDRMUtility::ShowRightsInfoL(RFile& aFileHandle)    
+    {
+    TRACER("CGlxDRMUtility::ShowRightsInfoL(aFileHandle)");
+    iDrmHelper->CheckRightsAmountL( aFileHandle );
+    }
+
+//============================================================================
 // Return size for DRM thumbnail request.
 //============================================================================
 EXPORT_C TSize CGlxDRMUtility::DRMThumbnailSize(TSize& aSize)
--- a/photosgallery/viewframework/inc/glxtvconstants.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/inc/glxtvconstants.h	Tue May 25 12:42:31 2010 +0300
@@ -30,7 +30,8 @@
     {
     ETvConnectionChanged = 0,
     ETvDisplayIsVisible,
-    ETvDisplayNotVisible
+    ETvDisplayNotVisible,
+    EDisconnected
     };
 
 /** TV size constants */
--- a/photosgallery/viewframework/medialists/src/glxcachemanager.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/medialists/src/glxcachemanager.cpp	Tue May 25 12:42:31 2010 +0300
@@ -42,6 +42,7 @@
 #include <aknViewAppUi.h>
 #include <caf/content.h>
 #include <caf/attributeset.h>
+#include <caf/caferr.h>
 #include <DRMHelper.h>
 
 #ifdef USE_S60_TNM
@@ -812,16 +813,29 @@
                                 time.HomeTime();
                                 if (errInImage == KErrNone)
                                     {
-                                    RFs fs;
-                                    CleanupClosePushL(fs);
-                                    TInt err = fs.Connect();
-                                    if (err == KErrNone)
+                                    if (iImageViewerInstance->IsPrivate())
+                                        {
+                                        RFile64 & imageHandle =
+                                                        iImageViewerInstance->ImageFileHandle();
+                                        if (imageHandle.SubSessionHandle()
+                                                != KNullHandle)
+                                            {
+                                            imageHandle.Modified(time);
+                                            }
+                                        }
+                                    else
                                         {
-                                        TEntry entry;
-                                        fs.Entry(fileName, entry);
-                                        time = entry.iModified;
+                                        RFs fs;
+                                        CleanupClosePushL(fs);
+                                        TInt err = fs.Connect();
+                                        if (err == KErrNone)
+                                            {
+                                            TEntry entry;
+                                            fs.Entry(fileName, entry);
+                                            time = entry.iModified;
+                                            }
+                                        CleanupStack::PopAndDestroy(&fs);
                                         }
-                                    CleanupStack::PopAndDestroy(&fs);
                                     }
                                 iMPXMedia->SetTObjectValueL(attrib,
                                         time.Int64());
@@ -926,19 +940,35 @@
                                     protection = iReader->GetDRMRightsL
                                     (ContentAccess::EIsProtected);
                                     }
-                                iMPXMedia->SetTObjectValueL(KMPXMediaDrmProtected, protection);
+                                else if (errInImage == KErrCANoRights
+                                        || errInImage == KErrCAPendingRights
+                                        || errInImage == KErrCACorruptRights)
+                                    {
+                                    protection = ETrue;
+                                    }
+                                iMPXMedia->SetTObjectValueL(
+                                        KMPXMediaDrmProtected, protection);
                                 }
                             else if ( iRequestedAttrs[i] == KGlxMediaGeneralDRMRightsValid )
                                 {
                                 TInt rightsValid = EGlxDrmRightsValidityUnknown;
                                 if(errInImage == KErrNone)
                                     {
-                                    TBool canView = iReader->GetDRMRightsL(ContentAccess::ECanView);
-                                    rightsValid = canView ? 
-                                        EGlxDrmRightsValid : EGlxDrmRightsInvalid;
+                                    TBool canView = iReader->GetDRMRightsL(
+                                            ContentAccess::ECanView);
+                                    rightsValid
+                                            = canView
+                                                      ? EGlxDrmRightsValid
+                                                         : EGlxDrmRightsInvalid;
                                     }
-                                iMPXMedia->SetTObjectValueL(KGlxMediaGeneralDRMRightsValid,
-                                        rightsValid); 
+                                else if (errInImage == KErrCANoRights
+                                        || errInImage == KErrCACorruptRights)
+                                    {
+                                    rightsValid = EGlxDrmRightsInvalid;
+                                    }
+                                iMPXMedia->SetTObjectValueL(
+                                        KGlxMediaGeneralDRMRightsValid,
+                                        rightsValid);
                                 }
                             else if ( iRequestedAttrs[i] == KMPXMediaGeneralCount )
                                 {
--- a/photosgallery/viewframework/medialists/src/glximagereader.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/medialists/src/glximagereader.cpp	Tue May 25 12:42:31 2010 +0300
@@ -103,6 +103,7 @@
         if ( &(iImgViewerMgr->ImageFileHandle()) )
             {
             TRAP(errInImage,iImageDecoder = CImageDecoder::FileNewL(iImgViewerMgr->ImageFileHandle(), ContentAccess::EPeek));
+            GLX_DEBUG2("CGlxImageReader::ConstructL() FH:errInImage=%d", errInImage);
             }
         }
     else
@@ -110,11 +111,13 @@
         if ( iImgViewerMgr->ImageUri() )
             {
             TRAP(errInImage,iImageDecoder = CImageDecoder::FileNewL(CCoeEnv::Static()->FsSession(), iImgViewerMgr->ImageUri()->Des()));
+            GLX_DEBUG2("CGlxImageReader::ConstructL() FN:errInImage=%d", errInImage);
             }
         }
     
     if (errInImage != KErrNone)
         {
+        GLX_DEBUG2("CGlxImageReader::ConstructL() LEAVE(%d)", errInImage);
         User::Leave(errInImage);
         }
     }
@@ -147,7 +150,7 @@
     __ASSERT_ALWAYS(content, Panic(EGlxPanicNullPointer));
     error = content->GetAttribute(aAttribute, value);
     CleanupStack::PopAndDestroy( content );
-    GLX_DEBUG2("CGlxImageReader::GetDRMRightsL value=%d", value);
+    
     if(error != KErrNone)
 	    {
 	    switch	( aAttribute )
@@ -162,6 +165,8 @@
 		    	value = EFalse;
 			}
 	    }
+    GLX_DEBUG2("CGlxImageReader::GetDRMRightsL error =%d", error);
+    GLX_DEBUG2("CGlxImageReader::GetDRMRightsL value=%d", value);
     return value;
     }
 
--- a/photosgallery/viewframework/medialists/src/glxmedialist.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/medialists/src/glxmedialist.cpp	Tue May 25 12:42:31 2010 +0300
@@ -39,6 +39,17 @@
 #include "mglxmedialistobserver.h"
 #include "glxmediastaticitemdefs.h"
 
+/**
+ * Min & Max wait interval for a modify event, in microseconds
+ * This is to allow thumbnail manager to procees the event first.
+ */
+const TInt KModifyEventMinWaitInterval = 2000000;
+const TInt KModifyEventMaxWaitInterval = 3000000;
+/**
+ * Maximum items count for minimum wait interval.
+ */
+const TInt KMaxItemsCount = 500;
+
 namespace NGlxMediaList
     {
     /**
@@ -1288,6 +1299,7 @@
     iMediaListArray = CGlxMediaListArray::InstanceL();
     iCountAttributes.AppendL(KGlxMediaCollectionPluginSpecificSubTitle);
     iCountAttributes.AppendL(KGlxMediaGeneralSlideshowableContent);
+    iCountAttributes.AppendL(KMPXMediaGeneralCount);
     }
 
 // -----------------------------------------------------------------------------
@@ -1510,6 +1522,32 @@
             }
 
         CleanupStack::PopAndDestroy(&itemIndices);
+		
+        RPointerArray<CGlxMediaList>& mediaLists = iMediaListArray->Array();
+        TInt listCount = mediaLists.Count();
+        GLX_DEBUG2("ML:HandleItemModifiedL listCount=%d", listCount);
+        if (listCount > 0)
+            {
+            CGlxMediaList* mediaList = mediaLists[listCount-1];
+            // Force a delay to allow TNM to process the modified event
+            if (mediaList == this)
+                {
+                GLX_DEBUG3("ML:HandleItemModifiedL(wait) listCount=%d, Id=%d",
+                                                  listCount, id.Value());
+                TTimeIntervalMicroSeconds32 timeout;
+                timeout = (mediaList->Count() > KMaxItemsCount ?
+                  KModifyEventMaxWaitInterval : KModifyEventMinWaitInterval );
+                RTimer timer;
+                CleanupClosePushL(timer);
+                TRequestStatus status;
+                timer.CreateLocal();
+                timer.After(status, timeout);
+			 	// User::WaitForRequest() will add codescanner warning but is necessary 
+			 	// as User::WaitForAnyRequest() cannot be used in this case
+                User::WaitForRequest(status);
+                CleanupStack::PopAndDestroy(&timer);
+                }
+            }
         }
     }
 
@@ -1847,17 +1885,8 @@
 
 void CGlxMediaList::CancelPreviousRequests()
 	{
-	TRACER("CGlxMediaList::CancelPreviousRequests");	
-	
-	TInt focusIndex = FocusIndex();
-	
-	if(focusIndex >= KErrNone)
-		{	
-		if(!Item(focusIndex).Properties())
-			{
-			// If media is NULL, cancel the previous pending request.
-			// Place a new request for the item in focus, to fetch the media attributes
-			iManager->CancelPreviousRequest();		
-			}
-		}
-	}
+    TRACER("CGlxMediaList::CancelPreviousRequests");
+    // Cancel the previous pending request.
+    // Place a new request for the item in focus, to fetch the media attributes
+    iManager->CancelPreviousRequest();
+    }
--- a/photosgallery/viewframework/medialists/src/glxmedialistiterator.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/medialists/src/glxmedialistiterator.cpp	Tue May 25 12:42:31 2010 +0300
@@ -487,8 +487,14 @@
     // |-------F----------------------|
     // |< jumping zone>|
 
-    TInt index = iIndexFunctor.Index();
-    __ASSERT_ALWAYS( index >= 0 && index < iList->Count(), Panic( EGlxPanicIllegalState ) );
+    TInt index = iIndexFunctor.Index();    
+    __ASSERT_DEBUG( index >= 0 && index < count, Panic( EGlxPanicIllegalState ) );
+    if (index < 0 || index >= count)
+        {
+		// Invalid index, out of bounds
+        return KErrNotFound;
+        }
+    
     index -= index % KGlxBlockyIteratorDefaultGranularity;
 
     TInt min = Min(iFrontOffset, iRearOffset);
@@ -549,7 +555,12 @@
         }
   
     TInt index = iIndexFunctor.Index();
-    __ASSERT_ALWAYS( index >= 0 && index < iList->Count(), Panic( EGlxPanicIllegalState ) );
+    __ASSERT_DEBUG( index >= 0 && index < count, Panic( EGlxPanicIllegalState ) );
+    if (index < 0 || index >= count)
+        {
+		// Invalid index, must be out of range
+        return EFalse;
+        }	
     index -= index % KGlxBlockyIteratorDefaultGranularity;
     TInt firstInRange = GlxListUtils::NormalizedIndex(index - iRearOffset, count);
     TInt lastInRange = GlxListUtils::NormalizedIndex(index + iFrontOffset, count);
@@ -974,7 +985,13 @@
     TInt visIndex = iList->VisibleWindowIndex();
     TInt index = visIndex;
     TInt listCount = iList->Count();
-    __ASSERT_ALWAYS( index >= 0 && index <= listCount, Panic( EGlxPanicIllegalState ) );
+    __ASSERT_DEBUG( index >= 0 && index <= listCount, Panic( EGlxPanicIllegalState ) );
+    if (index < 0 || index >= listCount)
+        {
+		// Invalid index, out of bounds
+        return KErrNotFound;
+        }
+    
     //Inorder to ensure that the start of refresh of thumbnails is contained in
     //in the current visible window. We set the startIndex to center element of 
     //the current visible window.
@@ -1053,7 +1070,12 @@
         }
   
     TInt index = iList->VisibleWindowIndex();
-    __ASSERT_ALWAYS( index >= 0 && index < iList->Count(), Panic( EGlxPanicIllegalState ) );
+    __ASSERT_DEBUG( index >= 0 && index < count, Panic( EGlxPanicIllegalState ) );
+    if (index < 0 || index >= count)
+        {
+		// Invalid index, must be out of range
+        return EFalse;
+        }    
     
     TInt firstInRange = GlxListUtils::NormalizedIndex(index - iRearOffset, count);
     TInt lastInRange = GlxListUtils::NormalizedIndex(index + iFrontOffset, count);
--- a/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxalbumfullscreenviewplugin.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxalbumfullscreenviewplugin.cpp	Tue May 25 12:42:31 2010 +0300
@@ -39,6 +39,7 @@
 
 #include "glxcommandhandlerdetails.h"
 #include "glxfullscreenview.h"
+#include <glxcommandhandlervideoplayback.h>
 
 _LIT(KGlxFullScreenResource,"glxfullscreenviewdata.rsc");
 
@@ -92,6 +93,12 @@
     
 void CGlxAlbumFullScreenViewPlugin::AddCommandHandlersL()
 	{
+	//Fix for error ID EVTY-7M87LF
+	//@ Registration of Video Playback Command handler has to before UPnP.
+	//@ else UPnP will not get play command once video playback command is consumed.
+	iFullScreenView->AddCommandHandlerL(
+			CGlxCommandHandlerVideoPlayback::NewL(iFullScreenView));
+	
 	CGlxFullScreenViewPluginBase::AddCommandHandlersL();
 	TFileName uiutilitiesrscfile;
 	uiutilitiesrscfile.Append(
--- a/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxcameraalbumfullscreenviewplugin.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxcameraalbumfullscreenviewplugin.cpp	Tue May 25 12:42:31 2010 +0300
@@ -38,6 +38,7 @@
 #include <mpxcollectionutility.h>
 #include <mpxmediageneraldefs.h>
 #include "glxfullscreenview.h"
+#include <glxcommandhandlervideoplayback.h>
 
 _LIT(KGlxFullScreenResource,"glxfullscreenviewdata.rsc");
 
@@ -92,6 +93,12 @@
     
 void CGlxCameraAlbumFullScreenViewPlugin::AddCommandHandlersL()
     {
+	//Fix for error ID EVTY-7M87LF
+	//@ Registration of Video Playback Command handler has to before UPnP.
+	//@ else UPnP will not get play command once video playback command is consumed.
+	iFullScreenView->AddCommandHandlerL(
+			CGlxCommandHandlerVideoPlayback::NewL(iFullScreenView));
+
     CGlxFullScreenViewPluginBase::AddCommandHandlersL();
       
     TGlxHelpContext helpInfo;
--- a/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxdownloadsfullscreenviewplugin.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxdownloadsfullscreenviewplugin.cpp	Tue May 25 12:42:31 2010 +0300
@@ -46,6 +46,7 @@
 
 #include <glxfullscreenviewdata.rsg>
 #include <glxicons.mbg> // icons 
+#include <glxcommandhandlervideoplayback.h>
 
 _LIT(KGlxFullScreenResource,"glxfullscreenviewdata.rsc");
 
@@ -110,6 +111,13 @@
 void CGlxDownloadsFullScreenViewPlugin::AddCommandHandlersL()
     {
     GLX_LOG_ENTRY_EXIT_LEAVE_L("CGlxDownloadsFullScreenViewPlugin::AddCommandHandlersL()");
+    
+    //Fix for error ID EVTY-7M87LF
+	//@ Registration of Video Playback Command handler has to before UPnP.
+	//@ else UPnP will not get play command once video playback command is consumed.
+	iFullScreenView->AddCommandHandlerL(
+			CGlxCommandHandlerVideoPlayback::NewL(iFullScreenView));
+	
     CGlxFullScreenViewPluginBase::AddCommandHandlersL();
     
     TGlxHelpContext helpInfo;
--- a/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxmainfullscreenviewplugin.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxmainfullscreenviewplugin.cpp	Tue May 25 12:42:31 2010 +0300
@@ -37,7 +37,7 @@
 #include <glxfullscreenview.h>
 #include <glxlog.h>
 #include <glxtracer.h>
-
+#include <glxcommandhandlervideoplayback.h>
 
 _LIT(KGlxFullScreenResource,"glxfullscreenviewdata.rsc");
 
@@ -100,6 +100,12 @@
 //
 void CGlxMainFullScreenViewPlugin::AddCommandHandlersL()
     {
+	//Fix for error ID EVTY-7M87LF
+	//@ Registration of Video Playback Command handler has to before UPnP.
+	//@ else UPnP will not get play command once video playback command is consumed.
+	iFullScreenView->AddCommandHandlerL(
+			CGlxCommandHandlerVideoPlayback::NewL(iFullScreenView));
+	
     CGlxFullScreenViewPluginBase::AddCommandHandlersL();
 
     TGlxHelpContext helpInfo;
--- a/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxmonthsfullscreenviewplugin.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxmonthsfullscreenviewplugin.cpp	Tue May 25 12:42:31 2010 +0300
@@ -41,6 +41,7 @@
 #include "glxfullscreenview.h"
 
 #include <glxcommandhandlers.hrh>
+#include <glxcommandhandlervideoplayback.h>
 
 _LIT(KGlxFullScreenResource,"glxfullscreenviewdata.rsc");
 
@@ -97,6 +98,12 @@
 //    
 void CGlxMonthsFullScreenViewPlugin::AddCommandHandlersL()
     {
+	//Fix for error ID EVTY-7M87LF
+	//@ Registration of Video Playback Command handler has to before UPnP.
+	//@ else UPnP will not get play command once video playback command is consumed.
+	iFullScreenView->AddCommandHandlerL(
+			CGlxCommandHandlerVideoPlayback::NewL(iFullScreenView));
+		
     CGlxFullScreenViewPluginBase::AddCommandHandlersL();
     
     TGlxHelpContext helpInfo;
--- a/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxtagfullscreenviewplugin.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/plugins/fullscreenviewplugin/src/glxtagfullscreenviewplugin.cpp	Tue May 25 12:42:31 2010 +0300
@@ -33,8 +33,7 @@
 #include <glxlog.h>
 
 #include <glxresourceutilities.h>                       // for CGlxResourceUtilities
-
-
+#include <glxcommandhandlervideoplayback.h>
 
 _LIT(KGlxTileResource,"glxfullscreenviewdata.rsc");		//TagTileView Resource File
 
@@ -93,7 +92,13 @@
 void CGlxTagFullScreenViewPlugin::AddCommandHandlersL()
 	{
 	TRACER( "CGlxTagFullScreenViewPlugin::AddCommandHandlersL");
-
+	
+	//Fix for error ID EVTY-7M87LF
+	//@ Registration of Video Playback Command handler has to before UPnP.
+	//@ else UPnP will not get play command once video playback command is consumed.
+	iFullScreenView->AddCommandHandlerL(
+			CGlxCommandHandlerVideoPlayback::NewL(iFullScreenView));
+		
 	CGlxFullScreenViewPluginBase::AddCommandHandlersL();
 	TFileName uiutilitiesrscfile;
 	uiutilitiesrscfile.Append(
--- a/photosgallery/viewframework/plugins/fullscreenviewpluginbase/src/glxfullscreenviewpluginbase.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/plugins/fullscreenviewpluginbase/src/glxfullscreenviewpluginbase.cpp	Tue May 25 12:42:31 2010 +0300
@@ -40,7 +40,6 @@
 #include <mpxmediageneraldefs.h>
 #include <mpxcollectionutility.h>
 #include <mpxcollectionpath.h>
-#include <glxcommandhandlervideoplayback.h>
 #include <glxcommandhandlerupload.h>
 #include <glxcommandhandlermoreinfo.h>
 #include <glxtracer.h>
@@ -208,15 +207,7 @@
 			iFullScreenView, iResourceIds.iMenuId, uiutilitiesrscfile));
 	// End of AIW service handlers                            
 
-
-	//Fix for error ID EVTY-7M87LF
-	//@ Registration of Video Playback Command handler has to before UPnP.
-	//@ else UPnP will not get play command once video playback command is consumed.
-	GLX_LOG_INFO("Adding CGlxCommandHandlerVideoPlayback");
-	iFullScreenView->AddCommandHandlerL(CGlxCommandHandlerVideoPlayback::NewL(
-			iFullScreenView));
-
-	//Toolbar commands for all Fullscreen views. May also be present in Options menu.
+    //Toolbar commands for all Fullscreen views. May also be present in Options menu.
 	GLX_LOG_INFO("Adding CGlxCommandHandlerSend");
 	iFullScreenView->AddCommandHandlerL(CGlxCommandHandlerSend::NewL(
 			iFullScreenView, ETrue, uiutilitiesrscfile));
--- a/photosgallery/viewframework/texturemanager/group/glxtexturemanager.mmp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/texturemanager/group/glxtexturemanager.mmp	Tue May 25 12:42:31 2010 +0300
@@ -65,8 +65,9 @@
 LIBRARY    	imageconversion.lib 
 LIBRARY  	bitmaptransforms.lib 
 LIBRARY         iclextjpegapi.lib
-LIBRARY efsrv.lib
-LIBRARY hal.lib              // HAL, HALData
+LIBRARY         efsrv.lib
+LIBRARY         hal.lib              // HAL, HALData
 LIBRARY         exiflib.lib
 LIBRARY         oommonitor.lib       // For Requesting RAM
+LIBRARY         glximageviewermanager.lib
 // End of File
--- a/photosgallery/viewframework/texturemanager/inc/glxtexturemanagerimpl.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/texturemanager/inc/glxtexturemanagerimpl.h	Tue May 25 12:42:31 2010 +0300
@@ -33,7 +33,7 @@
 #include <mglxresolutionchangeobserver.h>
 #include "glxbitmapdecoderwrapper.h"
 #include <glxmediaid.h>
-
+#include <glximageviewermanager.h>
 #include <imageconversion.h>
 #include <bitmaptransforms.h>
 #include <mglxcacheobserver.h>
@@ -248,6 +248,16 @@
         TMPXAttribute& aThumbnailAttribute );
 
     /**
+     * Create Image Viewer manager Instance
+     */
+    void CreateImageViewerInstanceL();
+    
+    /**
+     * Delete Image Viewer manager Instance
+     */
+    void DeleteImageViewerInstance();
+    
+    /**
      * TGlxIcon
      * Values associated with a bitmap/svg icon
      */
@@ -419,7 +429,8 @@
     // Temporary storage class used between call to create a texture and the 
     //callback from alf to ProvideBitmap 
     TGlxProvideBitmapHolder iProvideBitmapHolder;
-    
+    // For image viewer, not own
+    CGlxImageViewerManager* iImageViewerInstance;
     };
 
 #endif // C_GLXTEXTUREMANAGERIMPL_H
--- a/photosgallery/viewframework/texturemanager/src/glxbitmapdecoderwrapper.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/texturemanager/src/glxbitmapdecoderwrapper.cpp	Tue May 25 12:42:31 2010 +0300
@@ -32,6 +32,7 @@
 namespace
 {
 const TInt KGlxDecodingThreshold = 3000000;
+const TInt KGlxDecodingThresholdDimension = 2000;
 
 
 // Photos low_ram_threshold [8.637 MB] as in oomconfig.xml
@@ -113,19 +114,23 @@
         delete iImageDecoder;
         iImageDecoder = NULL;
         }
+    
+    CImageDecoder::TOptions options = (CImageDecoder::TOptions)
+            ( CImageDecoder::EOptionNoDither | CImageDecoder::EOptionAlwaysThread );
+
     // Use extended JPEG decoder
     TRAPD( err, iImageDecoder = CExtJpegDecoder::FileNewL(
-            CExtJpegDecoder::EHwImplementation, iFs, aSourceFileName, CImageDecoder::EOptionNone ) );
+            CExtJpegDecoder::EHwImplementation, iFs, aSourceFileName, options  ) );
     if ( KErrNone != err )
         {
         GLX_LOG_INFO( "DoDecodeImageL:: ESwImplementation" );
         TRAP(err,iImageDecoder = CExtJpegDecoder::FileNewL(
-                CExtJpegDecoder::ESwImplementation, iFs, aSourceFileName, CImageDecoder::EOptionNone ) );
+                CExtJpegDecoder::ESwImplementation, iFs, aSourceFileName, options  ) );
         if ( KErrNone != err )
             {
             GLX_LOG_INFO( "DoDecodeImageL:: CImageDecoder" );
             // Not a JPEG - use standard decoder
-            iImageDecoder = CImageDecoder::FileNewL( iFs, aSourceFileName, CImageDecoder::EOptionNone );
+            iImageDecoder = CImageDecoder::FileNewL( iFs, aSourceFileName, options  );
             isExtDecoderUsed = EFalse;
             }
         }
@@ -182,17 +187,28 @@
     {
     TRACER("CGlxBitmapDecoderWrapper:: DecodeImageL ");
     TReal32 mFactor = 1;
+    TReal32 mFactor1 = 1;
+    TReal32 mFactor2 = 1;
     //Set Size according to level and state
     TReal32 width = iOriginalSize.iWidth;
     TReal32 height = iOriginalSize.iHeight;
     GLX_LOG_INFO1("DecodeImageL:width=%f", width);
     GLX_LOG_INFO1("DecodeImageL:height=%f",height);
-
     
     if ( KGlxDecodingThreshold < (width * height))
         {
-        mFactor = TReal32(KGlxDecodingThreshold) / (width*height);
+        mFactor1 = TReal32(KGlxDecodingThreshold) / (width*height);
+        GLX_LOG_INFO1("mFactor1 =%f",mFactor1);
         }
+    
+    if ( KGlxDecodingThresholdDimension < width || KGlxDecodingThresholdDimension < height)
+        {
+        mFactor2 = TReal32(KGlxDecodingThresholdDimension) / Max(width, height);
+        GLX_LOG_INFO1("mFactor2 =%f",mFactor2);
+        }
+
+    mFactor = Min(mFactor1 , mFactor2);
+    GLX_LOG_INFO1("Final mFactor =%f",mFactor);
 
     // create the destination bitmap
     if(!iBitmap)
--- a/photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/texturemanager/src/glxtexturemanagerimpl.cpp	Tue May 25 12:42:31 2010 +0300
@@ -1071,8 +1071,16 @@
 
         //Since uri can be either focused or unfocused item
         //better call ItemRightsValidityCheckL which doesn't modify lastconsumedUri.
-        drmInvalid = !iDrmUtility->ItemRightsValidityCheckL(uri, checkViewRights);
-
+        CreateImageViewerInstanceL();
+        if(iImageViewerInstance->IsPrivate())
+            {
+            drmInvalid = !iDrmUtility->ItemRightsValidityCheckL(iImageViewerInstance->ImageFileHandle(), checkViewRights);
+            }
+        else
+            {
+            drmInvalid = !iDrmUtility->ItemRightsValidityCheckL(uri, checkViewRights);
+            }
+        DeleteImageViewerInstance();
         CGlxMedia* properties = const_cast<CGlxMedia*>(aMedia.Properties());
         if( !drmInvalid )
             {
@@ -1303,3 +1311,27 @@
         }
     return ETrue;
     }
+
+// -----------------------------------------------------------------------------
+// CreateImageViewerInstanceL
+// -----------------------------------------------------------------------------
+//
+void CGlxTextureManagerImpl::CreateImageViewerInstanceL()
+    {
+    TRACER("CGlxTextureManagerImpl::CreateImageViewerInstanceL");
+    iImageViewerInstance = CGlxImageViewerManager::InstanceL();    
+    __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer));
+    }
+
+// -----------------------------------------------------------------------------
+// DeleteImageViewerInstance
+// -----------------------------------------------------------------------------
+//
+void CGlxTextureManagerImpl::DeleteImageViewerInstance()
+    {
+    TRACER("CGlxTextureManagerImpl::DeleteImageViewerInstance");
+    if ( iImageViewerInstance )
+        {
+        iImageViewerInstance->DeleteInstance();
+        }
+    }
--- a/photosgallery/viewframework/tvout/inc/glxhdmicontroller.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/tvout/inc/glxhdmicontroller.h	Tue May 25 12:42:31 2010 +0300
@@ -128,7 +128,7 @@
     CGlxHdmiSurfaceUpdater* iSurfaceUpdater;
     CGlxTv*  iGlxTvOut;
     TBool   iIsImageSupported;          // Flag to see if Image is supported
-    TBool   iPhotosForeground;             // Flag for determining if the image needs to be in posting mode
+    TBool   iIsPhotosInForeground;          // Flag for determine if Photos is in foreground
     };
 
 #endif /* GLXHDMICONTROLLER_H_ */
--- a/photosgallery/viewframework/tvout/inc/glxtv.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/tvout/inc/glxtv.h	Tue May 25 12:42:31 2010 +0300
@@ -12,7 +12,8 @@
 * Contributors:
 *
 * Description:    Handles & propogates UI state change notifications.
-*
+* Though the name might suggest it handles only Tv events but it handles
+* other related peripherals as well - e.g. HDMI, Headsets.
 */
 
 
@@ -56,9 +57,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 +137,7 @@
     /**
      * @ref MGlxTvConnectionObserver::HandleTvConnectionStatusChangedL
      */
-    void HandleTvConnectionStatusChangedL( );
+    void HandleTvConnectionStatusChangedL(TTvChangeType aChangeType);
     
 private: // new private methods
     /**
--- a/photosgallery/viewframework/tvout/inc/glxtvconnectionmonitor.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/tvout/inc/glxtvconnectionmonitor.h	Tue May 25 12:42:31 2010 +0300
@@ -84,7 +84,6 @@
      */
     TBool IsHDMIConnected() const;
 
-
 private: // From CActive
     /**
      * @ref CActive::RunL
@@ -127,9 +126,12 @@
     // TVout The Connection state
     TBool iTvOutConnectionState;
 
-    // TVout The Connection state
+    // HDMI The Connection state
     TBool iHDMIConnectionState;
 
+    // Headset The Connection state
+    TBool iHeadSetConnectionState;
+
     // The (external device) Accessory Server
     RAccessoryServer iTvAccServer;
 
--- a/photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp	Tue May 25 12:42:31 2010 +0300
@@ -78,7 +78,7 @@
         }
     if (iGlxTvOut->IsHDMIConnected())
         {
-        iPhotosForeground = ETrue;         // the image should be in posting mode
+        iIsPhotosInForeground = ETrue;         // the image should be in posting mode
         GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2");
         // do not close the surface , use the same surface instead.
         // Call a function to pass imagefile
@@ -145,7 +145,7 @@
 EXPORT_C void CGlxHdmiController::ShiftToCloningMode()
     {
     TRACER("CGlxHdmiController::ShiftToCloningMode()");
-    iPhotosForeground = EFalse;
+    iIsPhotosInForeground = EFalse;
     // Shift to cloning only if HDMI is connected and surfaceupdater available.
     if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater)
         {
@@ -159,7 +159,7 @@
 EXPORT_C void CGlxHdmiController::ShiftToPostingMode()
     {
     TRACER("CGlxHdmiController::ShiftToPostingMode()");
-    iPhotosForeground = ETrue;
+    iIsPhotosInForeground = ETrue;
     if (iGlxTvOut->IsHDMIConnected())
         {
         if (!iSurfaceUpdater)
@@ -199,7 +199,7 @@
 CGlxHdmiController::CGlxHdmiController():
             iFsBitmap(NULL),
             iStoredImagePath(NULL),
-            iPhotosForeground(EFalse)
+            iIsPhotosInForeground(EFalse)
     {
     TRACER("CGlxHdmiController::CGlxHdmiController()");
     // Implement nothing here
@@ -299,7 +299,7 @@
             // meaning we shouldnt destroy HDMI and neither have to create surface updater.
             return;
             }
-        else if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported && iPhotosForeground)
+        else if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported && iIsPhotosInForeground)
             {
             GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected");
             // Calling SetImageL() with appropriate parameters
@@ -308,7 +308,7 @@
         else
             {
             GLX_LOG_INFO3("CGlxHdmiController::HandleTvStatusChangedL() iIsImageSupported=%d, iGlxTvOut->IsHDMIConnected()=%d, iIsPostingMode=%d", 
-                    iIsImageSupported,iGlxTvOut->IsHDMIConnected(),iPhotosForeground);
+                    iIsImageSupported,iGlxTvOut->IsHDMIConnected(),iIsPhotosInForeground);
             // if it gets disconnected, destroy the surface 
             GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected");
             DestroySurfaceUpdater();
--- a/photosgallery/viewframework/tvout/src/glxtv.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/tvout/src/glxtv.cpp	Tue May 25 12:42:31 2010 +0300
@@ -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/photosgallery/viewframework/tvout/src/glxtvconnectionmonitor.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/tvout/src/glxtvconnectionmonitor.cpp	Tue May 25 12:42:31 2010 +0300
@@ -71,7 +71,8 @@
 CGlxTvConnectionMonitor::CGlxTvConnectionMonitor(
 		MGlxTvConnectionObserver& aConnectionObserver) :
 	CActive(EPriorityStandard), iConnectionObserver(aConnectionObserver),
-			iTvOutConnectionState(EFalse), iHDMIConnectionState(EFalse)
+			iTvOutConnectionState(EFalse), iHDMIConnectionState(EFalse),
+			iHeadSetConnectionState(EFalse)
 
 	{
 	TRACER("CGlxTvConnectionMonitor");
@@ -182,17 +183,31 @@
 	TRACER("CGlxTvConnectionMonitor::IssueNotificationL");
 	TBool previousTvState = iTvOutConnectionState;
 	TBool previousHDMIState = iHDMIConnectionState;
-
+	TBool previousHeadSetState = iHeadSetConnectionState;
+	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 != iTvOutConnectionState || previousHDMIState
-			!= iHDMIConnectionState)
+	if (previousTvState != iTvOutConnectionState)
+		{
+		changeType = iTvOutConnectionState == EFalse ? EDisconnected : ETvConnectionChanged;
+		GLX_LOG_INFO1("CGlxTvConnectionMonitor::IssueNotificationL - TVOut Connection Changed %d", changeType);
+		iConnectionObserver.HandleTvConnectionStatusChangedL(changeType);	
+		}
+	else if (previousHDMIState != iHDMIConnectionState)
 		{
-		GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueNotificationL - Connection Altered");
-		iConnectionObserver.HandleTvConnectionStatusChangedL();
+		changeType = iHDMIConnectionState == EFalse ? EDisconnected : ETvConnectionChanged;
+		GLX_LOG_INFO1("CGlxTvConnectionMonitor::IssueNotificationL - HDMI Connection Changed %d", changeType);
+		iConnectionObserver.HandleTvConnectionStatusChangedL(changeType);	
+		}
+	else if (previousHeadSetState != iHeadSetConnectionState)
+		{
+		changeType = iHeadSetConnectionState == EFalse ? EDisconnected : ETvConnectionChanged;
+		GLX_LOG_INFO1("CGlxTvConnectionMonitor::IssueNotificationL - Headset Connection Changed %d", changeType);
+		iConnectionObserver.HandleTvConnectionStatusChangedL(changeType);	
 		}
 	}
 
@@ -202,67 +217,74 @@
 //
 void CGlxTvConnectionMonitor::UpdateConnectionStatusL()
     {
-    TRACER("CGlxTvConnectionMonitor::UpdateConnectionStatusL()");
+	TRACER("CGlxTvConnectionMonitor::UpdateConnectionStatusL()");
 
-    GLX_LOG_INFO2("CGlxTvConnectionMonitor::UpdateConnectionStatusL previousTvState = %d , previousHDMIState = %d",
-            iTvOutConnectionState,iHDMIConnectionState);
+	GLX_LOG_INFO2("CGlxTvConnectionMonitor::UpdateConnectionStatusL previousTvState = %d , previousHDMIState = %d",
+			iTvOutConnectionState,iHDMIConnectionState);
 
-    // reset the states
-    iHDMIConnectionState = EFalse;
-    iTvOutConnectionState = EFalse;
+	// reset the states
+	iHDMIConnectionState = EFalse;
+	iTvOutConnectionState = EFalse;
+	iHeadSetConnectionState = EFalse;
 
-    //gets the TV status in to the iCurrentAccArray and haves the Latest Accesory in 0-index
-    User::LeaveIfError(iTvAccCon.GetAccessoryConnectionStatus(iCurrentAccArray));
-
-    CAccPolSubblockNameArray* nameArray = CAccPolSubblockNameArray::NewL();
-    CleanupStack::PushL(nameArray);
+	//gets the TV status in to the iCurrentAccArray and haves the Latest Accesory in 0-index
+	User::LeaveIfError(iTvAccCon.GetAccessoryConnectionStatus(iCurrentAccArray));
 
-    //  Get the number of currently connected accessories
-    //  Loop through each connected accessory looking for
-    //  the desired capabilities
-    //
-    const TInt count = iCurrentAccArray.Count();
-    GLX_LOG_INFO1("CGlxTvConnectionMonitor::UpdateConnectionStatusL current count value is %d",count);
-    for (TInt index = 0; index < count; index++)
-        {
-        const TAccPolGenericID genId = iCurrentAccArray.GetGenericIDL(index);
-        //  Check if this connected accessory supports TV-Out capabality.
-        GLX_LOG_INFO1("CGlxTvConnectionMonitor::UpdateConnectionStatusL current index value is %d",index);
-        GLX_LOG_INFO("CGlxTvConnectionMonitor::UpdateConnectionStatusL Video Accessory Supported");
-        TAccPolNameRecord nameRecord;
-        nameRecord.SetNameL(KAccVideoOut);
+	CAccPolSubblockNameArray* nameArray = CAccPolSubblockNameArray::NewL();
+	CleanupStack::PushL(nameArray);
+
+	//  Get the number of currently connected accessories
+	//  Loop through each connected accessory looking for
+	//  the desired capabilities
+	//
+	const TInt count = iCurrentAccArray.Count();
+	GLX_LOG_INFO1("CGlxTvConnectionMonitor::UpdateConnectionStatusL current count value is %d",count);
+	for (TInt index = 0; index < count; index++)
+		{
+		const TAccPolGenericID genId = iCurrentAccArray.GetGenericIDL(index);
+		//  Check if this connected accessory supports TV-Out capabality.
+		GLX_LOG_INFO1("CGlxTvConnectionMonitor::UpdateConnectionStatusL current index value is %d",index);
+		GLX_LOG_INFO("CGlxTvConnectionMonitor::UpdateConnectionStatusL Video Accessory Supported");
+		TAccPolNameRecord nameRecord;
+		nameRecord.SetNameL(KAccVideoOut);
 
-        if (genId.DeviceTypeCaps( KDTAVDevice ) &&
-                genId.PhysicalConnectionCaps( KPCHDMI ))
-            {
-            TAccValueTypeTInt value;
-            TInt err = iTvAccCon.GetValueL(genId, nameRecord, value);
-            if (err ==KErrNone)
-                {
-                if (value.iValue == EAccVideoOutEHDMI)
-                    {
-                    GLX_LOG_INFO("CGlxTvConnectionMonitor::UpdateConnectionStatusL HDMI is connected");
-                    iHDMIConnectionState = ETrue;
-                    }
-                }
-            }
-        else if (genId.DeviceTypeCaps( KDTAVDevice ) &&
-                genId.PhysicalConnectionCaps( KPCWired ))
-            {
-            TAccValueTypeTInt value;
-            TInt err = iTvAccCon.GetValueL(genId, nameRecord, value);
-            if (err ==KErrNone)
-                {
-                if (value.iValue == EAccVideoOutCVideo)
-                    {
-                    GLX_LOG_INFO("CGlxTvConnectionMonitor::UpdateConnectionStatusL Tv is connected");
-                    iTvOutConnectionState = ETrue;
-                    }
-                }
-            }
-        }
-    CleanupStack::PopAndDestroy(nameArray);
+		if (genId.DeviceTypeCaps(KDTAVDevice) && genId.PhysicalConnectionCaps(
+				KPCHDMI))
+			{
+			TAccValueTypeTInt value;
+			TInt err = iTvAccCon.GetValueL(genId, nameRecord, value);
+			if (err == KErrNone)
+				{
+				if (value.iValue == EAccVideoOutEHDMI)
+					{
+					GLX_LOG_INFO("CGlxTvConnectionMonitor::UpdateConnectionStatusL HDMI is connected");
+					iHDMIConnectionState = ETrue;
+					}
+				}
+			}
+		else if (genId.DeviceTypeCaps(KDTAVDevice)
+				&& genId.PhysicalConnectionCaps(KPCWired))
+			{
+			TAccValueTypeTInt value;
+			TInt err = iTvAccCon.GetValueL(genId, nameRecord, value);
+			if (err == KErrNone)
+				{
+				if (value.iValue == EAccVideoOutCVideo)
+					{
+					GLX_LOG_INFO("CGlxTvConnectionMonitor::UpdateConnectionStatusL Tv is connected");
+					iTvOutConnectionState = ETrue;
+					}
+				}
+			}
+		else if (genId.DeviceTypeCaps(KDTHeadset)
+				&& genId.PhysicalConnectionCaps(KPCWired))
+			{
+			GLX_LOG_INFO("CGlxTvConnectionMonitor::UpdateConnectionStatusL HeadSet connect");
+			iHeadSetConnectionState = ETrue;
+			}
+		}
+	CleanupStack::PopAndDestroy(nameArray);
 
-    GLX_LOG_INFO2("CGlxTvConnectionMonitor::UpdateConnectionStatusL CurrentTvState = %d , CurrentHDMIState = %d",
-            iTvOutConnectionState,iHDMIConnectionState);
-    }
+	GLX_LOG_INFO2("CGlxTvConnectionMonitor::UpdateConnectionStatusL CurrentTvState = %d , CurrentHDMIState = %d",
+			iTvOutConnectionState,iHDMIConnectionState);
+	}
--- a/photosgallery/viewframework/views/cloudview/inc/glxbubbletimer.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/inc/glxbubbletimer.h	Tue May 25 12:42:31 2010 +0300
@@ -31,11 +31,11 @@
 	{
 public:
 	/** 	
-	 *  @function TimerComplete
+	 *  @function TimerCompleteL
 	 *  @since S60 3.2
 	 *  Function is used to get timer notification
 	 */
-	virtual void TimerComplete() = 0;
+	virtual void TimerCompleteL() = 0;
 	};
 
 //Forward Declaration
--- a/photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/inc/glxcloudviewcontrol.h	Tue May 25 12:42:31 2010 +0300
@@ -192,13 +192,13 @@
      * Hides/shows the grid layout
      * @param aShow - Show value
      */
-    void ShowContextItemMenu(TBool aShow);
+    void ShowContextItemMenuL(TBool aShow);
     
 public://MGlxTimernotifier
     /**
      * Virtual Function from MGlxTimernotifier
      */
-    void TimerComplete();
+    void TimerCompleteL();
     
 private:
 	/** 	
--- a/photosgallery/viewframework/views/cloudview/inc/glxcontainerinfobubble.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/inc/glxcontainerinfobubble.h	Tue May 25 12:42:31 2010 +0300
@@ -74,7 +74,7 @@
 	/**
 	 * Virtual Function from MGlxTimernotifier
 	 */
-	void TimerComplete();
+	void TimerCompleteL();
 
 	/**
 	 * Destructor
--- a/photosgallery/viewframework/views/cloudview/inc/glxtagscontextmenucontrol.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/inc/glxtagscontextmenucontrol.h	Tue May 25 12:42:31 2010 +0300
@@ -69,7 +69,7 @@
     /**
      * Virtual Function from MGlxTimernotifier
      */
-    void TimerComplete();
+    void TimerCompleteL();
 
 public:
     /**
@@ -81,7 +81,7 @@
      * Hides/shows the grid layout
      * @param aOpacity - Opacity value
      */
-    void ShowItemMenu(TBool aOpacity);
+    void ShowItemMenuL(TBool aOpacity);
     /**
      * Hides/shows the grid layout
      * @return value of menu's visibility
@@ -95,6 +95,11 @@
      */
     void SetViewableRect(TRect aRect);
 
+    /**
+    * Handles the Up event when moved away from stylus menu
+    */
+    void HandleUpEventL();
+    
 private:
     /**     
      *  constructor 
@@ -164,6 +169,10 @@
 
     //flag for stylus menu visibility
     TBool iItemMenuVisibility;
+    
+    //Menu item selected
+    TInt iCommandId;
+    
     //Maximum text width of a menu item
     TInt iMaxTextWidth;
     };
--- a/photosgallery/viewframework/views/cloudview/src/glxbubbletimer.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/src/glxbubbletimer.cpp	Tue May 25 12:42:31 2010 +0300
@@ -103,7 +103,7 @@
 void CGlxBubbleTimer::RunL()
 	{
 	TRACER("GLX_CLOUD::CGlxBubbleTimer::RunL");
-	iNotifier->TimerComplete (); //notify that timer is over
+	iNotifier->TimerCompleteL(); //notify that timer is over
 	}
 
 // ---------------------------------------------------------------------------
--- a/photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/src/glxcloudviewcontrol.cpp	Tue May 25 12:42:31 2010 +0300
@@ -226,7 +226,7 @@
 	//If the grid is already shown , disable it
     if(iTagsContextMenuControl->ItemMenuVisibility())
        {
-       iTagsContextMenuControl->ShowItemMenu(EFalse);
+       iTagsContextMenuControl->ShowItemMenuL(EFalse);
        }
     TRect rect;
     AknLayoutUtils::LayoutMetricsRect (AknLayoutUtils::EMainPane, rect);
@@ -1432,7 +1432,7 @@
         if(iTagsContextMenuControl->ItemMenuVisibility())
            {
            iDownEventReceived = ETrue;
-           iTagsContextMenuControl->ShowItemMenu(EFalse);
+           iTagsContextMenuControl->ShowItemMenuL(EFalse);
            return ETrue;
            }
         if(tappedvisual)
@@ -1967,13 +1967,13 @@
         }
     }
 // ---------------------------------------------------------------------------
-// TimerComplete()
+// TimerCompleteL()
 // ---------------------------------------------------------------------------
 //
-void CGlxCloudViewControl::TimerComplete()
+void CGlxCloudViewControl::TimerCompleteL()
     {
     iTimerComplete = ETrue;
-    iTagsContextMenuControl->ShowItemMenu(EFalse);
+    iTagsContextMenuControl->ShowItemMenuL(EFalse);
 
     CAlfVisual& visual = iLayout->Visual( iMediaList.FocusIndex() );
     TRect focussedItemRect = visual.DisplayRect();
@@ -1989,17 +1989,17 @@
     if(!iPhysicsStarted)//only if physics hasnt started
         {
         iTagsContextMenuControl->SetViewableRect(rect);
-        iTagsContextMenuControl->ShowItemMenu(ETrue);
+        iTagsContextMenuControl->ShowItemMenuL(ETrue);
         iTagsContextMenuControl->SetDisplay(midpoint);
         }
    }
 // ---------------------------------------------------------------------------
-// ShowContextItemMenu()
+// ShowContextItemMenuL()
 // ---------------------------------------------------------------------------
 //
-void CGlxCloudViewControl::ShowContextItemMenu(TBool aShow)
+void CGlxCloudViewControl::ShowContextItemMenuL(TBool aShow)
     {
-    iTagsContextMenuControl->ShowItemMenu(aShow);
+    iTagsContextMenuControl->ShowItemMenuL(aShow);
     if(!aShow)
         {
         iViewPortLayout->UpdateChildrenLayout(0);
--- a/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp	Tue May 25 12:42:31 2010 +0300
@@ -453,7 +453,7 @@
     TRACER("GLX_CLOUD::CGlxCloudViewImp::ViewDynInitMenuPaneL");
     if( aMenuId == R_TAGSBROWSER_MENU)
         {
-        iCloudControl->ShowContextItemMenu(EFalse);
+        iCloudControl->ShowContextItemMenuL(EFalse);
         }
     }
 
--- a/photosgallery/viewframework/views/cloudview/src/glxcontainerinfobubble.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/src/glxcontainerinfobubble.cpp	Tue May 25 12:42:31 2010 +0300
@@ -341,12 +341,12 @@
     
         	
 // ---------------------------------------------------------------------------
-// TimerComplete()
+// TimerCompleteL()
 // ---------------------------------------------------------------------------
 //
-void CGlxContainerInfoBubble::TimerComplete()
+void CGlxContainerInfoBubble::TimerCompleteL()
 	{
-	TRACER("GLX_CLOUD::CGlxContainerInfoBubble::TimerComplete");
+	TRACER("GLX_CLOUD::CGlxContainerInfoBubble::TimerCompleteL");
 	iTimerComplete =ETrue;
 	TRAP_IGNORE (ShowNowL ());
 	}
--- a/photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/cloudview/src/glxtagscontextmenucontrol.cpp	Tue May 25 12:42:31 2010 +0300
@@ -19,6 +19,7 @@
 #include <alf/alflayout.h>
 #include <alf/alfgridlayout.h> // For CAlfGridLayout
 #include <alf/alfborderbrush.h> // For CAlfBorderBrush
+#include <alf/alfroster.h> // For CalfRoster
 #include <alf/alfanchorlayout.h>
 #include <alf/alftextvisual.h>
 #include <alf/alfimagevisual.h>
@@ -65,7 +66,7 @@
 //6 Seconds delay for menu control visibility on screen 
 const TInt KTimerDelay = 6000000;
 //Control complete height
-const TInt KGridHeight = KReqHeightPerMenuItem * KNumofMenuItems;
+const TInt KGridHeight = ((KReqHeightPerMenuItem * KNumofMenuItems) + (KMinimalGap * (KNumofMenuItems + 1)));
 //Text size for menu items
 const TInt KTextSizeInPixels = 20;
 //X shrink factor for stylus menu border to be drawn/visible
@@ -73,7 +74,7 @@
 //Y shrink factor for stylus menu border to be drawn/visible
 const TInt KShrinkYCoord = 5;
 //Padding value for Minimum width for control
-const TInt KWidthPadding = 20;
+const TInt KWidthPadding = 30;
 //Padding value for Minimum spacing for line separators
 const TInt KLinePadding = 5;
 //Context menu separator line thickness value
@@ -116,7 +117,7 @@
 //
 CGlxTagsContextMenuControl::CGlxTagsContextMenuControl(
         MGlxItemMenuObserver& aItemMenuObserver) :
-    iItemMenuObserver(aItemMenuObserver)
+    iItemMenuObserver(aItemMenuObserver), iCommandId(KErrNotFound)
     {
     TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::CGlxTagsContextMenuControl");
     //Nothing more to do for now
@@ -142,11 +143,14 @@
     // Create a new 3x1 grid layout visual.
     iGrid = CAlfGridLayout::AddNewL(*this, KNoOfColumns, KNumofMenuItems,
             iMainVisual);//columns, rows
-
+    iGrid->SetFlag(EAlfVisualFlagManualLayout);
     //Finally create the menu list that will appear in screen
     CreateMenuListL(CreateFontL());
     CalculateMaxWidth();
     iMainVisual->SetSize(TSize(KWidthPadding + iMaxTextWidth, KGridHeight));
+    iGrid->SetInnerPadding(TPoint(KLinePadding,KLinePadding));
+    const TRect gridSize(TPoint(KLinePadding,KLinePadding),TSize(KTextSizeInPixels + iMaxTextWidth, KGridHeight - 10));
+    iGrid->SetRect(TAlfRealRect(gridSize));
     
     iMainVisual->EnableBrushesL(ETrue);
 
@@ -163,7 +167,7 @@
     CleanupStack::Pop(frameBrush);
 
     DrawLineSeparatorsL();
-	ShowItemMenu(EFalse);
+	ShowItemMenuL(EFalse);
     }
 // --------------------------------------------------------------------------- 
 // ~CGlxTagsContextMenuControl()
@@ -296,12 +300,12 @@
     }
 
 // --------------------------------------------------------------------------- 
-// ShowItemMenu()
+// ShowItemMenuL()
 // --------------------------------------------------------------------------- 
 //
-void CGlxTagsContextMenuControl::ShowItemMenu (TBool aShow)
+void CGlxTagsContextMenuControl::ShowItemMenuL(TBool aShow)
     {
-    TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::ShowItemMenu");
+    TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::ShowItemMenuL");
     if(aShow)
         {
         iMainVisual->SetOpacity(KOpacityOpaque);    
@@ -310,6 +314,9 @@
     else
         {
         iMainVisual->SetOpacity(KOpacityTransparent);
+        iRenameTextVisual->EnableBrushesL(EFalse);
+        iDeleteTextVisual->EnableBrushesL(EFalse);
+        iSlideshowTextVisual->EnableBrushesL(EFalse);
         iItemMenuVisibility = EFalse;
         iMainVisual->SetPos(TAlfRealPoint(KDummyPoint));
         }
@@ -333,42 +340,99 @@
     TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::OfferEventL");
     TBool consumed = EFalse;
 
-    if(iItemMenuVisibility && aEvent.IsPointerEvent() && aEvent.PointerDown() )
+    if (aEvent.IsPointerEvent() && iItemMenuVisibility )
         {
-        CAlfVisual* onVisual = aEvent.Visual();
-        TInt cmdId = KErrNotFound;
-        if(AlfUtil::TagMatches(onVisual->Tag(), KTagSlideshow))
-            {
-            cmdId = EGlxCmdSlideshowPlay;
-            }
-        else if(AlfUtil::TagMatches(onVisual->Tag(), KTagDelete))
+        if (aEvent.PointerDown())
             {
-            cmdId = EGlxCmdDelete;
-            }
-        else if(AlfUtil::TagMatches(onVisual->Tag(), KTagRename))
+            iCommandId = KErrNotFound;
+            Display()->Roster().SetPointerEventObservers(
+                    EAlfPointerEventReportDrag
+                            + EAlfPointerEventReportLongTap
+                            + EAlfPointerEventReportUnhandled, *this);
+            if (iItemMenuVisibility)
+                {
+                CAlfVisual* onVisual = aEvent.Visual();
+                CAlfFrameBrush* brush = CAlfFrameBrush::NewLC(*iAlfEnv,
+                        KAknsIIDQsnFrList);
+                TRect textVisualRect = TRect(TPoint(
+                        iSlideshowTextVisual->Pos().IntValueNow()), TSize(
+                        iSlideshowTextVisual->Size().ValueNow().AsSize()));
+                TRect innerRect(textVisualRect);
+                innerRect.Shrink(KShrinkXCoord, KShrinkYCoord);
+                brush->SetFrameRectsL(innerRect, textVisualRect);
+                iTimer->Cancel(); //cancels any outstanding requests
+                if (AlfUtil::TagMatches(onVisual->Tag(), KTagSlideshow))
+                    {
+                    iSlideshowTextVisual->EnableBrushesL(ETrue);
+                    iSlideshowTextVisual->Brushes()->AppendL(brush,
+                            EAlfHasOwnership);
+
+                    iCommandId = EGlxCmdSlideshowPlay;
+                    }
+                else if (AlfUtil::TagMatches(onVisual->Tag(), KTagDelete))
+                    {
+                    iDeleteTextVisual->EnableBrushesL(ETrue);
+                    iDeleteTextVisual->Brushes()->AppendL(brush,
+                            EAlfHasOwnership);
+
+                    iCommandId = EGlxCmdDelete;
+                    }
+                else if (AlfUtil::TagMatches(onVisual->Tag(), KTagRename))
+                    {
+                    iRenameTextVisual->EnableBrushesL(ETrue);
+                    iRenameTextVisual->Brushes()->AppendL(brush,
+                            EAlfHasOwnership);
+
+                    iCommandId = EGlxCmdRename;
+                    }
+                consumed = ETrue;
+                CleanupStack::Pop(brush);
+                }//End of iItemMenuVisibility check
+            }//End of Pointer down event 
+        else if (aEvent.PointerUp())
             {
-            cmdId = EGlxCmdRename;
-            }
-        
-        if(cmdId >= 0)
-            {
-            ShowItemMenu(EFalse);
-            iItemMenuObserver.HandleGridMenuListL(cmdId);
+            if (iCommandId >= 0)
+                {
+                TBool eventInsideControl = HitTest(
+                        aEvent.PointerEvent().iParentPosition);
+                //If Up event is received only within Menu control, handle the command
+                if (eventInsideControl)
+                    {
+                    ShowItemMenuL(EFalse);
+
+                    iItemMenuObserver.HandleGridMenuListL(iCommandId);
+                    iCommandId = KErrNotFound;
+                    }
+                else
+                    {
+                    HandleUpEventL();
+                    }
+                }
             consumed = ETrue;
             }
+        else if (aEvent.PointerEvent().EDrag)
+            {
+            TBool eventInsideControl = HitTest(
+                    aEvent.PointerEvent().iParentPosition);
+            if (!eventInsideControl)
+                {
+                HandleUpEventL();
+                }
+            consumed = ETrue;
+            }
+        consumed = ETrue;
         }
-    
     return consumed;
     }
 
 // ---------------------------------------------------------------------------
-// TimerComplete()
+// TimerCompleteL()
 // ---------------------------------------------------------------------------
 //
-void CGlxTagsContextMenuControl::TimerComplete()
+void CGlxTagsContextMenuControl::TimerCompleteL()
     {
-    TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::TimerComplete");
-    ShowItemMenu(EFalse);
+    TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::TimerCompleteL");
+    ShowItemMenuL(EFalse);
     }
 
 // --------------------------------------------------------------------------- 
@@ -402,6 +466,23 @@
 
     }
 // --------------------------------------------------------------------------- 
+// HandleUpEventL()
+// --------------------------------------------------------------------------- 
+//
+void CGlxTagsContextMenuControl::HandleUpEventL()
+    {
+    TRACER("GLX_CLOUD::CGlxTagsContextMenuControl::HandleUpEventL");
+    if(iCommandId >=0 && iItemMenuVisibility)
+        {
+        iCommandId = KErrNotFound;
+        
+        iRenameTextVisual->EnableBrushesL(EFalse);
+        iDeleteTextVisual->EnableBrushesL(EFalse);
+        iSlideshowTextVisual->EnableBrushesL(EFalse);
+
+        iTimer->SetDelay(KTimerDelay);
+        }
+    }
 // --------------------------------------------------------------------------- 
 // DrawLineSeparatorsL()
 // --------------------------------------------------------------------------- 
@@ -417,13 +498,12 @@
     for (TInt i = 1; i < KNumofMenuItems; i++)
         {
         CAlfCurvePath* curvePath = CAlfCurvePath::NewLC(*iAlfEnv);
-        curvePath->AppendArcL(
-                TPoint(KLinePadding, KReqHeightPerMenuItem * i), TSize(), 0,
-                0, 0);
-        curvePath->AppendLineL(
-                TPoint(KLinePadding, KReqHeightPerMenuItem * i), TPoint(
-                        iMainVisual->DisplayRect().Width() - KLinePadding,
-                        KReqHeightPerMenuItem * i), 0);
+        curvePath->AppendArcL(TPoint(KLinePadding, ((KReqHeightPerMenuItem
+                * i) + (KLinePadding * i + 2))), TSize(), 0, 0, 0);
+        curvePath->AppendLineL(TPoint(KLinePadding, ((KReqHeightPerMenuItem
+                * i) + (KLinePadding * i + 2))), TPoint(
+                iMainVisual->DisplayRect().Width() - KLinePadding,
+                ((KReqHeightPerMenuItem * i) + (KLinePadding * i + 2))), 0);
 
         CAlfLineVisual* line = CAlfLineVisual::AddNewL(*this, iMainVisual);
         line->SetPath(curvePath, EAlfHasOwnership);
--- a/photosgallery/viewframework/views/fullscreenview/group/glxfullscreenview.mmp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/fullscreenview/group/glxfullscreenview.mmp	Tue May 25 12:42:31 2010 +0300
@@ -104,5 +104,6 @@
 LIBRARY         ws32.lib                        // for RWsSession
 LIBRARY         aknicon.lib
 LIBRARY		alfdecoderserverclient.lib
+LIBRARY         glximageviewermanager.lib
 // EOF 
 
--- a/photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/fullscreenview/inc/glxfullscreenviewimp.h	Tue May 25 12:42:31 2010 +0300
@@ -22,11 +22,14 @@
 #include <mglxuicommandhandler.h>
 #include <gesturehelper.h>
 #include <gestureobserver.h>
+#include <glximageviewermanager.h>
 #include <alf/alfcompositionutility.h>
+
 #include "glxfullscreenview.h"
 #include "glxfullscreenbindingsetfactory.h"
 #include "glxfullscreenview.hrh"
 #include "glxmmcnotifier.h"
+#include "glxtv.h"
 
 //Gesture Helper namespace 
 namespace GestureHelper
@@ -68,7 +71,8 @@
                                             public IAlfWidgetEventHandler,
  											public MGlxUiCommandHandler,
 			                                public MStorageNotifierObserver,
-			                                public CAlfEffectObserver::MAlfEffectObserver
+			                                public CAlfEffectObserver::MAlfEffectObserver,
+											public MGlxTvObserver
     {
 public:    
     /**
@@ -274,6 +278,27 @@
      * Disable/enable the fullscreen toolbar
      */
     void EnableFSToolbar(TBool aEnable);
+    
+	/**
+     * Create Image Viewer manager Instance
+     */
+    void CreateImageViewerInstanceL();
+    
+    /**
+     * Delete Image Viewer manager Instance
+     */
+    void DeleteImageViewerInstance();
+	
+	/*
+	 * Get the HDMI cable insert/removal notification.
+     */
+	void HandleTvStatusChangedL( TTvChangeType aChangeType );
+
+    /**
+     * Checks if the slider to be show for the focus index
+     */
+    TBool CheckIfSliderToBeShownL();
+
 
 private:
     /** Softkey resource id's */
@@ -334,6 +359,11 @@
     TBool iIsMMCRemoved;
 	CAlfEffectObserver* iAlfEffectObs;
 	TInt iEffectHandle;
+    // For image viewer, not own
+    CGlxImageViewerManager* iImageViewerInstance;
+	CGlxTv*  iGlxTvOut;
+	TInt iHdmiWidth;
+	TInt iHdmiHeight;
     };
 
 #endif
--- a/photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/fullscreenview/src/glxfullscreenviewimp.cpp	Tue May 25 12:42:31 2010 +0300
@@ -86,6 +86,7 @@
 const TInt KGlxMinSmallImageZoomLevel =100;
 const TInt KGlxNeutralPinchPosition   =100;
 const TInt KGlxSliderTickValue        =5;
+
 /**
  * Start Delay for the periodic timer, in microseconds
  */
@@ -199,6 +200,7 @@
 		{
 		iPeriodic = CPeriodic::NewL(CActive::EPriorityStandard);
 		}
+	iGlxTvOut = CGlxTv::NewL(*this);
     }
 
 // ---------------------------------------------------------------------------
@@ -212,20 +214,32 @@
         {
         delete iAlfEffectObs;
         }
-    delete iMMCNotifier;
-    iMMCNotifier = NULL;
-    
-	delete iMediaListMulModelProvider;   
-    if(iTimer->IsActive())
-	    {
-	    iTimer->Cancel();
-	    }
-	delete iTimer;   
+    if(iMMCNotifier)
+        {
+        delete iMMCNotifier;
+        iMMCNotifier = NULL;
+        }
+    if(iMediaListMulModelProvider)
+        {
+        delete iMediaListMulModelProvider;
+        }
+    if(iTimer)
+        {
+        if(iTimer->IsActive())
+            {
+            iTimer->Cancel();
+            }
+        delete iTimer;
+        }
 	if(iZoomButtonGroup)
         {
         AppUi()->RemoveFromStack( iZoomButtonGroup );
         delete iZoomButtonGroup;
         }
+	if(iGlxTvOut)
+        {
+        delete iGlxTvOut;
+        }
     if(iActiveMediaListRegistry)
         {
         iActiveMediaListRegistry->Close();
@@ -326,6 +340,7 @@
     if(naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid))
         {
         iImgViewerMode = ETrue;
+        CreateImageViewerInstanceL();
         }
     //destroy and close navistate and navipath
     CleanupStack::PopAndDestroy( naviState );
@@ -334,6 +349,9 @@
     iScrnSize = iUiUtility->DisplaySize();
     iGridIconSize = iUiUtility->GetGridIconSize();
 
+    iHdmiWidth = (iScrnSize.iWidth > iScrnSize.iHeight ?iScrnSize.iWidth :iScrnSize.iHeight);
+    iHdmiHeight = (iScrnSize.iWidth < iScrnSize.iHeight ?iScrnSize.iWidth :iScrnSize.iHeight);
+
     //Create hdmicontroller when it is only launched from fullscreen.  
     //From filemanager show only clone mode.
     if( !iImgViewerMode )    
@@ -488,27 +506,18 @@
 void  CGlxFullScreenViewImp::ShowUiL(TBool aStartTimer)
     {
     TRACER("CGlxFullScreenViewImp::ShowUiL");
-
-    TInt index = iMediaList->FocusIndex();
-    const TGlxMedia& item = iMediaList->Item(index);
-    TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), KGlxMediaIdThumbnail);
-       
-    TBool isDrmRightsValid = ETrue;
-	if(item.IsDrmProtected())
-		{
-		//Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL
-		isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(item.Uri(),
-				(item.Category() == EMPXImage));
-		}
-	
-    // Display slider only for non corrupted images and items with valid DRM license
-    if (error == KErrNone && item.Category() == EMPXImage && isDrmRightsValid)
+	if(CheckIfSliderToBeShownL())
         {
         //To set the Slider values.
         SetSliderLevel();
         //show the slider
         iSliderWidget->ShowWidget(ETrue);
         }
+    else
+        {
+        //hide slider if UI is needed to be on and HDMI is Connected
+        iSliderWidget->ShowWidget(EFalse);
+        }
     
     if (iCoverFlowWidget)
         {
@@ -686,6 +695,18 @@
 void CGlxFullScreenViewImp::ActivateZoomControlL(TZoomStartMode aStartMode, TPoint* apZoomFocus)
     {
     TRACER("CGlxFullScreenViewImp::ActivateZoomControlL");
+    /*
+     * We will not do any zoom while HDMI is connected.
+     * This is as part of HDMI improvements.
+     */
+    if (!iImgViewerMode && iHdmiController 
+				&& iHdmiController->IsHDMIConnected())
+        {
+        // Hide zoom slider in HDMI mode as Zoom is disable.
+        // Let the other screen furnitures intact.
+        iSliderWidget->ShowWidget( EFalse);
+        return;
+        }
     TInt focus = iMediaList->FocusIndex();
     TGlxMedia item = iMediaList->Item( focus );
     TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties() , KGlxMediaIdThumbnail);
@@ -694,10 +715,20 @@
     TBool isDrmRightsValid = ETrue;
     if(item.IsDrmProtected())
     	{
-    	 //DRM Rights validity check for displayed item
-    	isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(item.Uri(),
-				(item.Category() == EMPXImage));
-    	}
+        if (iImgViewerMode && iImageViewerInstance->IsPrivate())
+            {
+            isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(
+                    iImageViewerInstance->ImageFileHandle(), (item.Category()
+                            == EMPXImage));
+            }
+        else
+            {
+            //Since it is always for the focused item - use DisplayItemRightsCheckL 
+            //instead of ItemRightsValidityCheckL
+            isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(
+                    item.Uri(), (item.Category() == EMPXImage));
+            }
+        }
     // Activate Zoom if the item is an image and its DRM rights is not expired
     if(KErrNone == error && (EMPXImage == item.Category()) && isDrmRightsValid)
         {
@@ -799,12 +830,22 @@
         EnableFSToolbar(EFalse);
         
         //Setting Soft key to EmptySoftKeys would cause crash
-		//When Fullscreen is opened from ImageViewer. 
-        //So Set Soft Keys to empty only when not in Image Viewer mode.
-		CEikButtonGroupContainer* cba = Cba();
-		TRAP_IGNORE( cba->SetCommandSetL( R_GLX_FULLSCREEN_EMPTYSOFTKEYS ) );
-		cba->DrawNow();
+		//When Fullscreen is opened from ImageViewer.
+        //And also, when Photos exits from FullScreen View.
+        //So Set Soft Keys to empty only when not in Image Viewer mode 
+        //& Photos is not exiting.
+		if( !iUiUtility->IsExitingState() )
+			{
+			CEikButtonGroupContainer* cba = Cba();
+			TRAP_IGNORE( cba->SetCommandSetL( R_GLX_FULLSCREEN_EMPTYSOFTKEYS ) );
+			cba->DrawNow();
+			}
+        
         }
+	else
+		{
+		DeleteImageViewerInstance();
+		}
     
     HideUi(ETrue); 
 	// In Order to hide the softkeys immediately. The above statement does not do that as soon as we need. 
@@ -1063,15 +1104,12 @@
                 {
                 SetItemToHDMIL();
                 TInt focusIndex = iMediaList->FocusIndex();
-                if (focusIndex != KErrNotFound
-                        && EUiOn == GetUiState()
-                        && iMediaList->Item(focusIndex).Category()
-                                == EMPXVideo)
+                if (focusIndex != KErrNotFound && EUiOn == GetUiState())
                     {
-                    // hide the slider
+                    // show/hide the slider
                     if (iSliderWidget)
                         {
-                        iSliderWidget->ShowWidget(EFalse);
+                        iSliderWidget->ShowWidget(CheckIfSliderToBeShownL());
                         }
                     }
                 return EEventConsumed;
@@ -1169,6 +1207,8 @@
 		case EGlxCmdFullScreenBack:
 		    SetSliderLevel();
 		    DeactivateZoomControlL();
+			//Show the screen furniture when we press back from zoom
+		    ShowUiL(ETrue);
 		    consumed = ETrue;
 		    break;
 		case EGlxCmdRenameCompleted:
@@ -1396,9 +1436,22 @@
         
         //check if any Error message is to be displayed
         TMPXGeneralCategory cat = media.Category();
-        TBool checkViewRights = (cat == EMPXImage);
-        if (iDrmUtility->ItemRightsValidityCheckL(media.Uri(),
-                checkViewRights) && tnError != KErrNone)
+        TBool checkViewRights = ETrue;
+        
+        if(iImgViewerMode && iImageViewerInstance->IsPrivate())
+            {
+            checkViewRights = iDrmUtility->ItemRightsValidityCheckL(
+                    iImageViewerInstance->ImageFileHandle(),
+                    (media.Category() == EMPXImage));
+            }
+        else
+            {
+            //Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL
+            checkViewRights = iDrmUtility->ItemRightsValidityCheckL(
+                    media.Uri(), (media.Category() == EMPXImage));
+            }
+        
+        if (checkViewRights && tnError != KErrNone)
             {
             if (iPeriodic->IsActive())
                 {
@@ -1434,7 +1487,18 @@
     if (uri.Length() > 0)
         {
         // check if rights have expired
-        TBool expired = !iDrmUtility->ItemRightsValidityCheckL(uri, ETrue);
+        TBool expired = EFalse;
+        if (iImgViewerMode && iImageViewerInstance->IsPrivate())
+            {
+            expired = !iDrmUtility->ItemRightsValidityCheckL(
+                    iImageViewerInstance->ImageFileHandle(),
+                    ETrue);
+            }
+        else
+            {
+            expired = !iDrmUtility->ItemRightsValidityCheckL(uri, ETrue);
+            }
+
         if (expired)
             {
             if (iPeriodic->IsActive())
@@ -1442,7 +1506,14 @@
                 iPeriodic->Cancel();
                 }
             iBusyIcon->ShowBusyIconL(EFalse);
-            iDrmUtility->ShowRightsInfoL(uri);
+            if(iImgViewerMode && iImageViewerInstance->IsPrivate())
+                {
+                iDrmUtility->ShowRightsInfoL(iImageViewerInstance->ImageFileHandle());
+                }
+            else
+                {
+                iDrmUtility->ShowRightsInfoL(uri);
+                }
             return;
             }
 
@@ -1465,7 +1536,14 @@
                 }
             GLX_LOG_INFO("CGlxFullScreenViewImp::ConsumeDRMRightsL()"
                     "- ConsumeRights");
-            iDrmUtility->ConsumeRightsL(uri);
+            if(iImgViewerMode && iImageViewerInstance->IsPrivate())
+                {
+                iDrmUtility->ConsumeRightsL(iImageViewerInstance->ImageFileHandle());
+                }
+            else
+                {
+                iDrmUtility->ConsumeRightsL(uri);
+                }
             }
         }
     }
@@ -1557,7 +1635,7 @@
     TRACER("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi");
 
     TInt focusIndex = iMediaList->FocusIndex();
-
+    
     // If we dont know what item we are focussing on 
     // or if out medialist is empty
     // or if HDMI is not connected 
@@ -1567,7 +1645,7 @@
             || (0 == iMediaList->Count())
             || (NULL == iHdmiController)) 
         {
-        GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - Cant Set Image To HDMI");
+        GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi- Cant Set Image To HDMI");
         return;
         }
     
@@ -1627,10 +1705,13 @@
                 GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Setting Default Bitmap");
                 TFileName resFile(KDC_APP_BITMAP_DIR);
                 resFile.Append(KGlxIconsFilename);
-                CFbsBitmap* defaultBitmap = new (ELeave) CFbsBitmap;
+                CFbsBitmap* defaultBitmap = AknIconUtils::CreateIconL(resFile,
+                        EMbmGlxiconsQgn_prop_image_notcreated);
                 CleanupStack::PushL(defaultBitmap);
-                defaultBitmap = AknIconUtils::CreateIconL(resFile,
-                        EMbmGlxiconsQgn_prop_image_notcreated);
+                
+                // always need to setsize on the raw bitmap for it to be visible
+                AknIconUtils::SetSize(defaultBitmap, TSize(iHdmiWidth,iHdmiHeight),EAspectRatioPreserved);
+
                 GLX_LOG_INFO2("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Default Size width=%d, height=%d", 
                         defaultBitmap->SizeInPixels().iWidth, defaultBitmap->SizeInPixels().iHeight);
                 iHdmiController->SetImageL(item.Uri(),defaultBitmap);
@@ -1640,7 +1721,7 @@
         }
     else
         {
-        GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - Unsupported Item");
+        GLX_LOG_INFO("CGlxFullScreenViewImp::SetImageToHDMIL - CGlxHdmi - Unsupported Item");
         //Set the external display to cloning mode if
         //the current item is something we dont support 
         //(e.g. video, corrupted item, item with invalid DRM)
@@ -1733,3 +1814,84 @@
                                                      KTfxResourceNoEffect));
         }
     }
+
+// -----------------------------------------------------------------------------
+// CreateImageViewerInstanceL
+// -----------------------------------------------------------------------------
+//
+void CGlxFullScreenViewImp::CreateImageViewerInstanceL()
+    {
+    TRACER("CGlxFullScreenViewImp::CreateImageViewerInstanceL");
+    iImageViewerInstance = CGlxImageViewerManager::InstanceL();    
+    __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer));
+    }
+
+// -----------------------------------------------------------------------------
+// DeleteImageViewerInstance
+// -----------------------------------------------------------------------------
+//
+void CGlxFullScreenViewImp::DeleteImageViewerInstance()
+    {
+    TRACER("CGlxFullScreenViewImp::DeleteImageViewerInstance");
+    if ( iImageViewerInstance )
+        {
+        iImageViewerInstance->DeleteInstance();
+        }
+    }
+	
+// -----------------------------------------------------------------------------
+// HandleTvStatusChangedL 
+// -----------------------------------------------------------------------------
+void CGlxFullScreenViewImp::HandleTvStatusChangedL( TTvChangeType aChangeType )
+    {
+    TRACER("CGlxFullScreenViewImp::HandleTvStatusChangedL()");
+    // Hide UI furnitures when HDMI cable is connected/Disconnected
+    // irrespective of UI state on/off.
+    if (aChangeType == ETvConnectionChanged)
+        {
+        HideUi(ETrue);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// CheckIfSliderToBeShownL
+// ---------------------------------------------------------------------------
+TBool CGlxFullScreenViewImp::CheckIfSliderToBeShownL()
+    {
+    TRACER("CGlxFullScreenViewImp::CheckIfSliderToBeShownL()");
+
+    TInt index = iMediaList->FocusIndex();
+    const TGlxMedia& item = iMediaList->Item(index);
+    TInt error = GlxErrorManager::HasAttributeErrorL(item.Properties(), KGlxMediaIdThumbnail);
+       
+    TBool isDrmRightsValid = ETrue;
+	if(item.IsDrmProtected())
+		{
+        if (iImgViewerMode && iImageViewerInstance->IsPrivate())
+            {
+            isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(
+                    iImageViewerInstance->ImageFileHandle(), (item.Category()
+                            == EMPXImage));
+            }
+        else
+            {
+            //Since it is always for the focused item - use DisplayItemRightsCheckL instead of ItemRightsValidityCheckL
+            isDrmRightsValid = iDrmUtility->DisplayItemRightsCheckL(
+                    item.Uri(), (item.Category() == EMPXImage));
+            }
+        }
+	
+    // Display slider only for non corrupted images and items with valid DRM license
+	if (iHdmiController
+                && iHdmiController->IsHDMIConnected())
+        {
+        //hide slider if UI is needed to be on and HDMI is Connected
+		return EFalse;
+        }
+    else if(error == KErrNone && item.Category() == EMPXImage
+            && isDrmRightsValid )
+        {
+        return ETrue;
+        }
+    return EFalse;
+    }
--- a/photosgallery/viewframework/views/gridview/inc/glxgridviewcontainer.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/gridview/inc/glxgridviewcontainer.h	Tue May 25 12:42:31 2010 +0300
@@ -177,20 +177,21 @@
 	// Medialist observer for Grid view
 	CGlxGridViewMLObserver* iGlxGridMLObserver;
 
-	/// Active media list registry stores the pointer to the active media list
-	/// Allows UPnP to know when list has changed
-	CGlxActiveMediaListRegistry* iActiveMediaListRegistry;
-
 	// Thumbnail context
 	CGlxThumbnailContext* iThumbnailContext;
 
-
 	// Iterators for Grid and FS
 	TGlxFromManualIndexBlockyIterator iBlockyIterator;
 
 	// Grid Icon size from FS view
 	TSize iGridIconSize;
 
+    // Hg Grid preferred image size
+	TSize iHgGridImageSize;
+
+    // The Resource file name from which icons to be read
+    TFileName iIconsFileName;  
+	   
 	// Bool to check backward navigation
 	TBool iBackwardActivation;
 
--- a/photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/gridview/inc/glxgridviewmlobserver.h	Tue May 25 12:42:31 2010 +0300
@@ -110,6 +110,12 @@
      * @param aError The error based on which the error note is to be shown. 
      */
 	void DisplayErrorNoteL(TInt aError);
+
+    /**
+     * SetDefaultIconL - Sets the default icon for grid.
+     * @param aTransparent - ETrue to set transparent icon; EFalse to set default icon. 
+     */
+    void SetDefaultIconL(TBool aTransparent);
     
 private:
 
@@ -123,9 +129,15 @@
 	
     TSize iGridIconSize;
     
+    // The Resource file name from which icons to be read
+    TFileName iIconsFileName;  
+    
     //No of visible items in a page/view
     TInt  iItemsPerPage;
 
+    //Flag to indicate the grid default icon set status
+    TBool iIsDefaultIconSet;
+    
     // Variable to check if the error in disk (e.g disk error) has been shown to the user.  
     // If a disk is full the user should not be intimated everytime over and over again.
     TInt  iDiskErrorIntimated;
--- a/photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/gridview/src/glxgridviewcontainer.cpp	Tue May 25 12:42:31 2010 +0300
@@ -384,32 +384,47 @@
 	TRACER("CGlxGridViewContainer::CreateHgGridWidgetL()");
 
 	TInt mediaCount = iMediaList->Count();
+    GLX_DEBUG2("GlxGrid: CHgGrid::CreateHgGridWidgetL() "
+            "mediaCount(%d)", mediaCount);
 	if (!iHgGrid)
 		{
-        TSize tnSize = CHgGrid::PreferredImageSize();
-        GLX_DEBUG3("GlxGrid: CHgGrid::PreferredImageSize() w(%d) h(%d)", 
-                tnSize.iWidth, tnSize.iHeight);
-		TFileName resFile(KDC_APP_BITMAP_DIR);
-		resFile.Append(KGlxIconsFilename);
+        iHgGridImageSize = CHgGrid::PreferredImageSize();
+        GLX_DEBUG3("GlxGrid: CHgGrid::PreferredImageSize() w(%d) h(%d)",
+                iHgGridImageSize.iWidth, iHgGridImageSize.iHeight);
+        iIconsFileName.Append(KDC_APP_BITMAP_DIR);
+        iIconsFileName.Append(KGlxIconsFilename);
+		
+        // Create Hg grid object
+        if (mediaCount)
+            {
+            CFbsBitmap* bitmap = NULL;
+            CFbsBitmap* mask = NULL;
+            AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone,
+                    bitmap, mask, iIconsFileName,
+                    EMbmGlxiconsQgn_prop_image_notcreated,
+                    EMbmGlxiconsQgn_prop_image_notcreated_mask);
+            __ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer));
+            __ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer));
 
-        CFbsBitmap* bitmap = NULL;
-        CFbsBitmap* mask = NULL;
-        AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone,
-                bitmap, mask, resFile, EMbmGlxiconsQgn_prop_image_notcreated,
-                EMbmGlxiconsQgn_prop_image_notcreated_mask);
-        __ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer));
-        __ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer));
+            AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize(),
+                    EAspectRatioPreservedAndUnusedSpaceRemoved);
+            AknIconUtils::SetSize(mask, CHgGrid::PreferredImageSize(),
+                    EAspectRatioPreservedAndUnusedSpaceRemoved);
 
-        AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize(),
-                EAspectRatioPreservedAndUnusedSpaceRemoved);
-        AknIconUtils::SetSize(mask, CHgGrid::PreferredImageSize(),
-                EAspectRatioPreservedAndUnusedSpaceRemoved);
-
-        // Create Hg grid object
-        iHgGrid = CHgGrid::NewL(GetHgGridRect(), mediaCount, CGulIcon::NewL(
-                bitmap, mask));
-        CleanupStack::Pop(mask); 
-        CleanupStack::Pop(bitmap); 
+            iHgGrid = CHgGrid::NewL(GetHgGridRect(), mediaCount,
+                    CGulIcon::NewL(bitmap, mask));
+            CleanupStack::Pop(mask);
+            CleanupStack::Pop(bitmap);
+            
+            for (TInt index=0; index<mediaCount; index++)
+                {
+                SetIconsL(index);
+                }
+            }
+        else
+            {
+            iHgGrid = CHgGrid::NewL(GetHgGridRect(), mediaCount);
+            }
 		}
 
 	// Setting to MopParent to update background skin
@@ -465,6 +480,11 @@
 void CGlxGridViewContainer::CreateGridL()
 	{
 	TRACER("CGlxGridViewContainer::CreateGridL()");
+#ifdef _DEBUG
+    TTime startTime;
+    GLX_LOG_INFO("CGlxGridViewContainer::CreateGridL(+)");  
+    startTime.HomeTime();
+#endif
 	// Set the Grid thumbnail context and iterator
 	SetGridThumbnailContextL();
 	// Create HG Grid widget
@@ -473,6 +493,12 @@
 	CreateGridMediaListObserverL();
 	// Create Grid once again after returning from FS as No calls for handleItem added.
 	CreateGridAfterFSDeactivatedL();
+#ifdef _DEBUG
+    TTime stopTime;
+    stopTime.HomeTime();
+    GLX_DEBUG2("CGlxGridViewContainer::CreateGridL(-) took <%d> us", 
+                    (TInt)stopTime.MicroSecondsFrom(startTime).Int64());
+#endif   	
 	}
 	
 // ---------------------------------------------------------------------------
@@ -529,15 +555,6 @@
 			GLX_LOG_INFO("CreateGridAfterFSDeactivatedL() - SetEmptyTextL()");
 			iHgGrid->DrawNow();
 			}
-
-		TSize setSize = CHgGrid::PreferredImageSize();
-		TFileName resFile(KDC_APP_BITMAP_DIR);
-		resFile.Append(KGlxIconsFilename);
-
-		for (TInt index=0; index<mlCount; index++)
-			{
-			SetIconsL(index);
-			}
 		}
 	
     if (focusIndex != KErrNotFound)
@@ -556,10 +573,6 @@
 	{
 	TRACER("CGlxGridViewContainer::SetIconsL()");
 	const TGlxMedia& item = iMediaList->Item(index);
-	TSize setSize = CHgGrid::PreferredImageSize();
-	TFileName resFile(KDC_APP_BITMAP_DIR);
-	resFile.Append(KGlxIconsFilename);
-	TIconInfo icon;
 	TInt tnError = GlxErrorManager::HasAttributeErrorL(
 			item.Properties(), KGlxMediaIdThumbnail );
 
@@ -600,14 +613,14 @@
         CFbsBitmap* bitmap = NULL;
         CFbsBitmap* mask = NULL;
         AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone,
-                bitmap, mask, resFile, EMbmGlxiconsQgn_prop_image_notcreated,
+                bitmap, mask, iIconsFileName, EMbmGlxiconsQgn_prop_image_notcreated,
                 EMbmGlxiconsQgn_prop_image_notcreated_mask);
         __ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer));
         __ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer));
 
-        AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize(),
+        AknIconUtils::SetSize(bitmap, iHgGridImageSize,
                 EAspectRatioPreservedAndUnusedSpaceRemoved);
-        AknIconUtils::SetSize(mask, CHgGrid::PreferredImageSize(),
+        AknIconUtils::SetSize(mask, iHgGridImageSize,
                 EAspectRatioPreservedAndUnusedSpaceRemoved);
 
         iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap, mask));
@@ -621,14 +634,14 @@
         CFbsBitmap* bitmap = NULL;
         CFbsBitmap* mask = NULL;
         AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone,
-                bitmap, mask, resFile, EMbmGlxiconsQgn_prop_image_corrupted,
+                bitmap, mask, iIconsFileName, EMbmGlxiconsQgn_prop_image_corrupted,
                 EMbmGlxiconsQgn_prop_image_corrupted_mask);
         __ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer));
         __ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer));
 
-        AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize(),
+        AknIconUtils::SetSize(bitmap, iHgGridImageSize,
                 EAspectRatioPreservedAndUnusedSpaceRemoved);
-        AknIconUtils::SetSize(mask, CHgGrid::PreferredImageSize(),
+        AknIconUtils::SetSize(mask, iHgGridImageSize,
                 EAspectRatioPreservedAndUnusedSpaceRemoved);
 
         iHgGrid->ItemL(index).SetIcon(CGulIcon::NewL(bitmap, mask));
--- a/photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/gridview/src/glxgridviewimp.cpp	Tue May 25 12:42:31 2010 +0300
@@ -46,10 +46,6 @@
 
 const TInt KGlxToolbarButtonUnLatched = 0;              // Toolbar mark button's unlatched state defined in the rss file
 
-//Video playback view uid
-#define KMPXVIDEOPLAYBACKVIEWUID 0x200159B4
-const TUid KVideoPlayBackUid = TUid::Uid(KMPXVIDEOPLAYBACKVIEWUID);
-
 // ======== MEMBER FUNCTIONS ========
 
 // ---------------------------------------------------------------------------
@@ -179,18 +175,12 @@
         iToolbar = CAknToolbar::NewL(R_GLX_GRID_VIEW_TOOLBAR);
         SetGridToolBar(iToolbar);
         SetToolbarObserver(this);
-        TBool visibility = iUiUtility->ViewNavigationDirection()
-                == EGlxNavigationBackwards ? ETrue : EFalse;
-        if (aPrevViewId.iViewUid == KVideoPlayBackUid)
-            {
-            GLX_DEBUG1( "CGlxGridViewImp::DoMLViewActivateL() "
-                    "- Coming from video playback!");        
-            visibility = ETrue;
-            }
-        iToolbar->SetToolbarVisibility(visibility);
+        //Make the toolbar visible only when the medialist is populated
+        iToolbar->SetToolbarVisibility(iMediaList->IsPopulated());
         }
-	//Create HG Grid, medialist observer, FS thumbnailcontext
-	iGlxGridViewContainer = CGlxGridViewContainer::NewL(iMediaList,iUiUtility,*this,iToolbar);
+	//Create gridview container
+	iGlxGridViewContainer = CGlxGridViewContainer::NewL(iMediaList,
+            iUiUtility, *this, iToolbar);
 	iEikonEnv->AppUi()->AddToStackL(*this,iGlxGridViewContainer);
 	iUiUtility->DestroyScreenClearer();
 	}
--- a/photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/gridview/src/glxgridviewmlobserver.cpp	Tue May 25 12:42:31 2010 +0300
@@ -91,9 +91,10 @@
     iDRMUtility = CGlxDRMUtility::InstanceL();
 
     CGlxUiUtility* uiUtility = CGlxUiUtility::UtilityL();
+    CleanupClosePushL(*uiUtility);
     iGridIconSize = uiUtility->GetGridIconSize();
     iItemsPerPage = uiUtility->VisibleItemsInPageGranularityL();
-    uiUtility->Close() ;
+    CleanupStack::PopAndDestroy(uiUtility);
     
     iQualityTnAttrib = TMPXAttribute (KGlxMediaIdThumbnail, 
         GlxFullThumbnailAttributeId( ETrue,  iGridIconSize.iWidth, 
@@ -103,7 +104,11 @@
         GlxFullThumbnailAttributeId( EFalse,  iGridIconSize.iWidth, 
                 iGridIconSize.iHeight ) );
     
-    iDiskErrorIntimated = EFalse ;
+    iIconsFileName.Append(KDC_APP_BITMAP_DIR);
+    iIconsFileName.Append(KGlxIconsFilename);
+    iIsDefaultIconSet = EFalse;
+    
+    iDiskErrorIntimated = EFalse;
     }
 
 // ---------------------------------------------------------------------------
@@ -139,7 +144,18 @@
 
     if ((aEndIndex - aStartIndex) > KRecreateGridSize)
         {
+#ifdef _DEBUG
+        TTime startTime;
+        GLX_LOG_INFO("CGlxGridViewMLObserver::HandleItemAddedL - ResizeL(+)");
+        startTime.HomeTime();
+#endif    
         iHgGrid->ResizeL(aList->Count());
+#ifdef _DEBUG
+        TTime stopTime;
+        stopTime.HomeTime();
+        GLX_DEBUG2("CGlxGridViewMLObserver::HandleItemAddedL - ResizeL(-) took <%d> us",
+                (TInt)stopTime.MicroSecondsFrom(startTime).Int64());
+#endif         
         }
     else
         {
@@ -213,8 +229,6 @@
         KErrNotFound != aAttributes.Find( iSpeedTnAttrib, match ))
         {
         const TGlxMedia& item = iMediaList.Item( aItemIndex );
-        TFileName resFile(KDC_APP_BITMAP_DIR);
-        resFile.Append(KGlxIconsFilename);
         TSize setSize = CHgGrid::PreferredImageSize();
 
         const CGlxThumbnailAttribute* qualityTn = item.ThumbnailAttribute(
@@ -250,15 +264,15 @@
             CFbsBitmap* bitmap = NULL;
             CFbsBitmap* mask = NULL;
             AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone,
-                    bitmap, mask, resFile,
+                    bitmap, mask, iIconsFileName,
                     EMbmGlxiconsQgn_prop_image_corrupted,
                     EMbmGlxiconsQgn_prop_image_corrupted_mask);
             __ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer));
             __ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer));
             
-            AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize(),
+            AknIconUtils::SetSize(bitmap, setSize,
                     EAspectRatioPreservedAndUnusedSpaceRemoved);
-            AknIconUtils::SetSize(mask, CHgGrid::PreferredImageSize(),
+            AknIconUtils::SetSize(mask, setSize,
                     EAspectRatioPreservedAndUnusedSpaceRemoved);
 
             iHgGrid->ItemL(aItemIndex).SetIcon(CGulIcon::NewL(bitmap, mask));
@@ -334,6 +348,7 @@
     TInt bitmapId  = EMbmGlxiconsQgn_prop_image_corrupted;
     TInt maskId = EMbmGlxiconsQgn_prop_image_corrupted_mask;	
     TInt flags     = CHgItem::EHgItemFlagsNone ;
+    TSize setSize = CHgGrid::PreferredImageSize();
     
     for ( TInt i = 0; i < iMediaList.Count(); i++ )
         {
@@ -366,19 +381,16 @@
                     break;  
                 }
             
-            TFileName resFile(KDC_APP_BITMAP_DIR);
-            resFile.Append(KGlxIconsFilename);
-
             CFbsBitmap* bitmap = NULL;
             CFbsBitmap* mask = NULL;
             AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone,
-                    bitmap, mask, resFile, bitmapId, maskId);
+                    bitmap, mask, iIconsFileName, bitmapId, maskId);
             __ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer));
             __ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer));
 
-            AknIconUtils::SetSize(bitmap, CHgGrid::PreferredImageSize(),
+            AknIconUtils::SetSize(bitmap, setSize,
                     EAspectRatioPreservedAndUnusedSpaceRemoved);
-            AknIconUtils::SetSize(mask, CHgGrid::PreferredImageSize(),
+            AknIconUtils::SetSize(mask, setSize,
                     EAspectRatioPreservedAndUnusedSpaceRemoved);
 
             iHgGrid->ItemL(i).SetIcon(CGulIcon::NewL(bitmap, mask), flags);
@@ -447,6 +459,9 @@
             GLX_DEBUG1("GridMLObserver::HandlePopulatedL() - SetEmptyTextL()");
             iHgGrid->DrawNow();
             }
+        
+        GLX_DEBUG1("GridMLObserver::HandlePopulatedL() - SetDefaultIconL()");
+        SetDefaultIconL(ETrue);
         }
     }
   
@@ -519,6 +534,13 @@
                 iHgGrid->RefreshScreen(aItemIndex);
                 }
             }
+        
+        if (!iIsDefaultIconSet)
+            {
+            GLX_DEBUG1("GridMLObserver::HandleAttributesAvailableL()"
+                     " SetDefaultIconL() - 1");
+            SetDefaultIconL(EFalse);
+            }
         }
     else if (aItemIndex > firstIndex && aItemIndex <= lastOnScreen)
         {
@@ -541,6 +563,13 @@
                     iHgGrid->RefreshScreen(lastOnScreen);
                     }
                 }
+            
+            if (!iIsDefaultIconSet)
+                {
+                GLX_DEBUG1("GridMLObserver::HandleAttributesAvailableL()"
+                         " SetDefaultIconL() - 2");
+                SetDefaultIconL(EFalse);
+                }
             }
         }
     
@@ -561,7 +590,6 @@
         }
     }
     
-    
 // ----------------------------------------------------------------------------
 // UpdateItemsL
 // ----------------------------------------------------------------------------
@@ -652,3 +680,63 @@
     iDiskErrorIntimated = ETrue;
     return;
     }
+
+// ----------------------------------------------------------------------------
+// SetDefaultIconL
+// ----------------------------------------------------------------------------
+// 
+void CGlxGridViewMLObserver::SetDefaultIconL(TBool aTransparent)
+    {
+    TRACER("CGlxGridViewMLObserver::SetDefaultIconL()");
+    GLX_LOG_INFO1("CGlxGridViewMLObserver::SetDefaultIconL() "
+            " aTransparent(%d)", aTransparent);
+    if (aTransparent)
+        {
+        CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
+		CleanupStack::PushL(bitmap);
+        CFbsBitmap* mask = new (ELeave) CFbsBitmap();
+		CleanupStack::PushL(mask);
+        TSize bmpSize = CHgGrid::PreferredImageSize();
+        bitmap->Create(bmpSize, EColor16M);
+        mask->Create(bmpSize, EGray256); // Gray mask
+        const TInt scanlineLength = bmpSize.iWidth; // 1 byte per pixel 
+        RBuf8 maskData;
+        maskData.Create(scanlineLength);
+        maskData.FillZ(scanlineLength); // Init with zero
+
+        mask->BeginDataAccess();
+        for (TInt y = 0; y < bmpSize.iHeight; y++)
+            {
+            mask->SetScanLine(maskData, y);
+            }
+
+        maskData.Close();
+        mask->EndDataAccess();
+        iHgGrid->SetDefaultIconL(CGulIcon::NewL(bitmap, mask));
+        CleanupStack::Pop(mask);
+        CleanupStack::Pop(bitmap);		
+        }
+    else if (!iIsDefaultIconSet)
+        {
+        CFbsBitmap* bitmap = NULL;
+        CFbsBitmap* mask = NULL;
+        TSize setSize = CHgGrid::PreferredImageSize();
+
+        AknsUtils::CreateIconLC(AknsUtils::SkinInstance(), KAknsIIDNone,
+                bitmap, mask, iIconsFileName,
+                EMbmGlxiconsQgn_prop_image_notcreated,
+                EMbmGlxiconsQgn_prop_image_notcreated_mask);
+        __ASSERT_DEBUG(bitmap, Panic(EGlxPanicNullPointer));
+        __ASSERT_DEBUG(mask, Panic(EGlxPanicNullPointer));
+
+        AknIconUtils::SetSize(bitmap, setSize,
+                EAspectRatioPreservedAndUnusedSpaceRemoved);
+        AknIconUtils::SetSize(mask, setSize,
+                EAspectRatioPreservedAndUnusedSpaceRemoved);
+
+        iHgGrid->SetDefaultIconL(CGulIcon::NewL(bitmap, mask));
+        CleanupStack::Pop(mask);
+        CleanupStack::Pop(bitmap);
+        iIsDefaultIconSet = ETrue;
+        }
+    }
--- a/photosgallery/viewframework/views/listview/inc/glxlistviewimp.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/listview/inc/glxlistviewimp.h	Tue May 25 12:42:31 2010 +0300
@@ -194,7 +194,18 @@
     * @param aError the error code to handle.
     */
    void DoHandleErrorL( TInt /*aError*/ );    
- 
+
+   /**
+   * Refresh the list
+   * @param aIndex index to be refreshed
+   */
+   void RefreshList(TInt aIndex);
+
+   /**
+   * Remove the medialist attribute context(s)
+   */
+   void RemoveContext();
+   
 public: // from MGlxMediaListObserver
     void HandleItemAddedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
     void HandleItemRemovedL( TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList );
@@ -222,21 +233,37 @@
 	
 	CGlxPreviewThumbnailBinding* iPreviewTNBinding; //Own
 	
-	// Fetch context for retrieving title attribute
-	CGlxAttributeContext* iTitleAttributeContext;
+	/// Fetch context for retrieving title attribute
+	CGlxDefaultAttributeContext* iTitleAttributeContext;
+
+    /// Fetch context for retrieving subtitle for visible items
+    CGlxAttributeContext* iSubtitleAttributeContext;
 
-    // Fetch context for retrieving subtitle
-    CGlxAttributeContext* iSubtitleAttributeContext;
-	
+    /// Fetch context for retrieving other attribs for visible items
+    CGlxAttributeContext* iOtherAttribsContext;
+    
+    /// Thumbnail Attrib context for visible items
+    CGlxAttributeContext* iThumbnailContext;    
+
+    /// Thumbnail iterator for fetch context(s) for visible items
     TGlxFromFocusOutwardIterator iThumbnailIterator;
     
-	// Thumbnail Attrib context
-    CGlxAttributeContext* iThumbnailContext;	
+    /// Fetch context for retrieving subtitle for non-visible items
+    CGlxAttributeContext* iNonVisibleSubtitleAttributeContext;
 
-    /** Unique ID of this Avkon view */
+    /// Fetch context for retrieving other attribs for non-visible items
+    CGlxAttributeContext* iNonVisibleOtherAttribsContext;
+    
+    /// Thumbnail Attrib context for non-visible items
+    CGlxAttributeContext* iNonVisibleThumbnailContext;    
+
+    /// Thumbnail iterator for fetch context(s) for non-visible items
+    TGlxFromFocusOutwardIterator iNonVisibleThumbnailIterator;
+    
+    /// Unique ID of this Avkon view
     TInt iViewUid;
 
-    /** View specific resource ids */
+    /// View specific resource ids
     TListViewResourceIds iResourceIds;
 
     /// The animation being applied to the view
@@ -254,7 +281,8 @@
     TInt iLastFocusedIndex;
     
     TBool iNextViewActivationEnabled;
-    // save title text 
+    
+    /// Title text 
     HBufC* iTitletext;
 
     CGlxProgressIndicator* iProgressIndicator;
--- a/photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/listview/src/glxlistviewimp.cpp	Tue May 25 12:42:31 2010 +0300
@@ -55,7 +55,8 @@
 #include <gfxtranseffect/gfxtranseffect.h>  // For transition effects
 #include "glxgfxtranseffect.h"  // For transition effects
 
-const TInt KListDataWindowSize(16);
+const TInt KListDataWindowSize(8); // Visible page
+const TInt KListNonVisibleDataWindowSize(32); // Visible page + 3 pages
 const TInt KNoOfPages(4);
 const TInt KGlxCollectionRootLevel = 1;
 
@@ -226,10 +227,11 @@
 	GlxSetAppState::SetState(EGlxInListView);
 
     // Separate contexts so that some attributes are loaded before others
-    iThumbnailIterator.SetRangeOffsets(KListDataWindowSize,
-            KListDataWindowSize);
-    iTitleAttributeContext = new (ELeave) CGlxAttributeContext(
-            &iThumbnailIterator);
+    // No need to fetch the rear pages as we do not support looping	
+    iThumbnailIterator.SetRangeOffsets(0, KListDataWindowSize);
+
+    iTitleAttributeContext = CGlxDefaultAttributeContext::NewL();
+    iTitleAttributeContext->SetRangeOffsets(0, KMaxTInt);
     iTitleAttributeContext->AddAttributeL(KMPXMediaGeneralTitle);
 
     iSubtitleAttributeContext = new (ELeave) CGlxAttributeContext(
@@ -238,9 +240,42 @@
             KGlxMediaCollectionPluginSpecificSubTitle);
 
     iMediaList->AddContextL(iTitleAttributeContext, KMaxTInt);
-    iMediaList->AddContextL(iSubtitleAttributeContext, KMaxTInt);
+    iMediaList->AddContextL(iSubtitleAttributeContext, KGlxFetchContextPriorityNormal);
     if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot)
         {
+        iOtherAttribsContext = new (ELeave) CGlxAttributeContext(
+                &iThumbnailIterator);
+        iOtherAttribsContext->AddAttributeL(KMPXMediaGeneralCount);
+
+        iNonVisibleThumbnailIterator.SetRangeOffsets(0, KListNonVisibleDataWindowSize);
+        iNonVisibleSubtitleAttributeContext
+                = new (ELeave) CGlxAttributeContext(
+                        &iNonVisibleThumbnailIterator);
+        iNonVisibleSubtitleAttributeContext->AddAttributeL(
+                KGlxMediaCollectionPluginSpecificSubTitle);
+        iMediaList->AddContextL(iNonVisibleSubtitleAttributeContext,
+                KGlxFetchContextPriorityLow);
+        iNonVisibleOtherAttribsContext = new (ELeave) CGlxAttributeContext(
+                &iNonVisibleThumbnailIterator);
+        iNonVisibleOtherAttribsContext->AddAttributeL(KMPXMediaGeneralCount);
+
+        CMPXCollectionPath* path = iMediaList->PathLC(
+                NGlxListDefs::EPathParent);
+        if (path->Id(0) == KGlxCollectionPluginAlbumsImplementationUid)
+            {
+            iOtherAttribsContext->AddAttributeL(KGlxMediaGeneralSystemItem);
+            iOtherAttribsContext->AddAttributeL(
+                    KGlxMediaGeneralSlideshowableContent);
+
+            iNonVisibleOtherAttribsContext->AddAttributeL(
+                    KGlxMediaGeneralSystemItem);
+            iNonVisibleOtherAttribsContext->AddAttributeL(
+                    KGlxMediaGeneralSlideshowableContent);
+            }
+        CleanupStack::PopAndDestroy(path);
+
+        iMediaList->AddContextL(iOtherAttribsContext,
+                KGlxFetchContextPriorityNormal);
         iThumbnailContext = new (ELeave) CGlxAttributeContext(
                 &iThumbnailIterator);
         TMPXAttribute tnAttr(KGlxMediaIdThumbnail,
@@ -251,6 +286,16 @@
         iThumbnailContext->AddAttributeL(tnAttr);
         iMediaList->AddContextL(iThumbnailContext,
                 KGlxFetchContextPriorityNormal);
+
+        iMediaList->AddContextL(iNonVisibleOtherAttribsContext,
+                KGlxFetchContextPriorityLow);
+        iNonVisibleThumbnailContext = new (ELeave) CGlxAttributeContext(
+                &iNonVisibleThumbnailIterator);
+        iNonVisibleThumbnailContext->SetDefaultSpec(iGridIconSize.iWidth,
+                iGridIconSize.iHeight);
+        iNonVisibleThumbnailContext->AddAttributeL(tnAttr);
+        iMediaList->AddContextL(iNonVisibleThumbnailContext,
+                KGlxFetchContextPriorityLow);
         }
 
     iMediaList->AddMediaListObserverL(this);
@@ -258,10 +303,10 @@
     iBgContext = CAknsBasicBackgroundControlContext::NewL( 
             KAknsIIDQsnBgScreen,apRect,ETrue);
     
-    if(iUiUtility->ViewNavigationDirection() == EGlxNavigationBackwards )
-        {
-        iBackwardNavigation = ETrue;
-        }
+    iBackwardNavigation = (iUiUtility->ViewNavigationDirection()
+            == EGlxNavigationBackwards);
+    GLX_LOG_INFO1("CGlxListViewImp::DoMLViewActivateL() - "
+            "iBackwardNavigation(%d)", iBackwardNavigation);
 
     iPreviewTNBinding = CGlxPreviewThumbnailBinding::NewL(*this);
     CreateListL();
@@ -302,19 +347,7 @@
        iTitletext = titlePane->Text()->AllocL());
        }
 
-    iMediaList->RemoveContext( iTitleAttributeContext );
-   	delete iTitleAttributeContext;
-   	iTitleAttributeContext = NULL;
-
-    iMediaList->RemoveContext( iSubtitleAttributeContext );
-   	delete iSubtitleAttributeContext;
-   	iSubtitleAttributeContext = NULL;
-    if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot)
-        {
-        iMediaList->RemoveContext(iThumbnailContext);
-        delete iThumbnailContext;
-        iThumbnailContext = NULL;
-        }   
+    RemoveContext();
 	iMediaList->RemoveMediaListObserver( this );
 	delete iPreviewTNBinding;
 	iPreviewTNBinding = NULL;
@@ -330,6 +363,67 @@
 	}
 
 // ---------------------------------------------------------------------------
+// RemoveContext
+// ---------------------------------------------------------------------------
+//
+void CGlxListViewImp::RemoveContext()
+    {
+    TRACER("CGlxListViewImp::DoMLViewDeactivate");
+
+    if (iTitleAttributeContext)
+        {
+        iMediaList->RemoveContext(iTitleAttributeContext);
+        delete iTitleAttributeContext;
+        iTitleAttributeContext = NULL;
+        }
+
+    if (iSubtitleAttributeContext)
+        {
+        iMediaList->RemoveContext(iSubtitleAttributeContext);
+        delete iSubtitleAttributeContext;
+        iSubtitleAttributeContext = NULL;
+        }
+
+    if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot)
+        {
+        if (iOtherAttribsContext)
+            {
+            iMediaList->RemoveContext(iOtherAttribsContext);
+            delete iOtherAttribsContext;
+            iOtherAttribsContext = NULL;
+            }
+
+        if (iThumbnailContext)
+            {
+            iMediaList->RemoveContext(iThumbnailContext);
+            delete iThumbnailContext;
+            iThumbnailContext = NULL;
+            }
+
+        if (iNonVisibleSubtitleAttributeContext)
+            {
+            iMediaList->RemoveContext(iNonVisibleSubtitleAttributeContext);
+            delete iNonVisibleSubtitleAttributeContext;
+            iNonVisibleSubtitleAttributeContext = NULL;
+            }
+
+        if (iNonVisibleOtherAttribsContext)
+            {
+            iMediaList->RemoveContext(iNonVisibleOtherAttribsContext);
+            delete iNonVisibleOtherAttribsContext;
+            iNonVisibleOtherAttribsContext = NULL;
+            }
+
+        if (iNonVisibleThumbnailContext)
+            {
+            iMediaList->RemoveContext(iNonVisibleThumbnailContext);
+            delete iNonVisibleThumbnailContext;
+            iNonVisibleThumbnailContext = NULL;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // Destroys the Widget
 // ---------------------------------------------------------------------------
 //
@@ -456,7 +550,6 @@
         UpdatePreviewL(i);
         }
     
-    iList->RefreshScreen(visIndex);
     if(iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot)
         {
         if ( visIndex != iLastFocusedIndex && !iPopulateListTNs)
@@ -518,6 +611,7 @@
     if (iNextViewActivationEnabled && (aIndex >= 0 && aIndex
             < iMediaList->Count()) && (iUiUtility->GetItemsLeftCount() == 0))
         {
+        iMediaList->CancelPreviousRequests();
         //Delete the PreviewTNMBinding as in forward navigation
         //we do not get the medialist callback.
         delete iPreviewTNBinding;
@@ -530,38 +624,19 @@
 		//Navigate to the next view
         iUiUtility->SetViewNavigationDirection(EGlxNavigationForwards);
         GLX_LOG_INFO("CGlxListViewImp::HandleOpenL()- EGlxNavigationForwards!");
-
         CMPXCollectionPath* path = iMediaList->PathLC(
                 NGlxListDefs::EPathFocusOrSelection);
 
         // 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.
-        CMPXCollectionPath* pathParent = iMediaList->PathLC(
-                NGlxListDefs::EPathParent);
-
-        if ((iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot && path->Id(0)
-                == KGlxCollectionPluginAllImplementationUid)
-                || (pathParent->Id()
-                        == KGlxCollectionPluginMonthsImplementationUid)
-                || (pathParent->Id()
-                        == KGlxCollectionPluginAlbumsImplementationUid))
-            {
-            RArray<TMPXAttribute> attributeArray;
-            CleanupClosePushL(attributeArray);
-            attributeArray.AppendL(KGlxFilterGeneralNavigationalStateOnly);
-            iCollectionUtility->Collection().OpenL(*path,
-                    attributeArray.Array());
-            CleanupStack::PopAndDestroy(&attributeArray);
-            }
-        else
-            {
-            iCollectionUtility->Collection().OpenL(*path);
-            }
-
-        CleanupStack::PopAndDestroy(pathParent);
+        // Second one from grid/list view construction. To improve the grid/list 
+        // opening performance, the first query will be completed with empty Id list.
+        RArray<TMPXAttribute> attributeArray;
+        CleanupClosePushL(attributeArray);
+        attributeArray.AppendL(KGlxFilterGeneralNavigationalStateOnly);
+        iCollectionUtility->Collection().OpenL(*path, attributeArray.Array());
+        CleanupStack::PopAndDestroy(&attributeArray);
         CleanupStack::PopAndDestroy(path);
 	    }
     }
@@ -613,17 +688,9 @@
             }
     	}
     
-    TInt firstIndex = iList->FirstIndexOnScreen();
-    TInt itemsOnScreen = iList->ItemsOnScreen();
-    TInt lastOnScreen = firstIndex + itemsOnScreen - 1;
-    if (lastOnScreen > (mediaCount - 1))
-	    {
-		lastOnScreen = mediaCount - 1;	    	
-	    }
-    
     GLX_DEBUG2("CGlxListViewImp::PreviewTNReadyL()"
-            " RefreshScreen - focusIndex(%d)", focusIndex);
-    iList->RefreshScreen(focusIndex);
+            " RefreshList(%d)", focusIndex);
+    RefreshList(focusIndex);
 	
 	if (iPopulateListTNs)
 		{
@@ -756,20 +823,21 @@
             HBufC* emptyText = StringLoader::LoadLC(R_LIST_EMPTY_VIEW_TEXT); 
             iList->SetEmptyTextL(*emptyText);
             CleanupStack::PopAndDestroy(emptyText);
+            
+            //While coming back to main listview
+            TGlxIdSpaceId id = iMediaList->IdSpaceId(0);
+            if((id == KGlxIdSpaceIdRoot) && (mediaCount > 0))
+                {            
+                for (TInt i = 0; i < mediaCount; i++)
+                    {
+                    SetDefaultThumbnailL(i);
+                    }
+                }            
             }		
         
 		//Fix for ESLM-7SAHPT::Clear Flag to Disable QWERTY search input in list view
 		iList->ClearFlags(CHgScroller::EHgScrollerSearchWithQWERTY ); 
 		
-		//While coming back to main listview
-		TGlxIdSpaceId id = iMediaList->IdSpaceId(0);
-		if((id == KGlxIdSpaceIdRoot) && (mediaCount > 0))
-		    {            
-            for (TInt i = 0; i < mediaCount; i++)
-                {
-                SetDefaultThumbnailL(i);
-                }
-		    }
         // Set the scrollbar type for albums list
         if (path->Id() == KGlxCollectionPluginAlbumsImplementationUid)
             {
@@ -796,7 +864,6 @@
             }
 		iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iLastFocusedIndex);
 		iList->SetSelectedIndex(iLastFocusedIndex);
-		iList->RefreshScreen(iLastFocusedIndex);
 		}
     }
 
@@ -817,7 +884,10 @@
             const TGlxMedia& item = iMediaList->Item(i);                
             iList->ItemL(i).SetTitleL(item.Title());
             iList->ItemL(i).SetTextL(item.SubTitle());
-            SetDefaultThumbnailL(i);
+            if (iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot)
+                {
+                SetDefaultThumbnailL(i);
+                }
             }            
         
         if(aStartIndex == aEndIndex )
@@ -825,10 +895,9 @@
             iLastFocusedIndex = aStartIndex;
             iPopulateListTNs = EFalse;
             iMediaList->SetFocusL(NGlxListDefs::EAbsolute, iLastFocusedIndex);			
+            iList->SetSelectedIndex(iLastFocusedIndex); 
+            iList->RefreshScreen(iLastFocusedIndex);
             }
-        
-        iList->SetSelectedIndex(iLastFocusedIndex);	
-        iList->RefreshScreen(iLastFocusedIndex);
         }
     }
 
@@ -874,14 +943,25 @@
 	if (KErrNotFound != aAttributes.Find(titleAttrib, match))
 		{
 		iList->ItemL(aItemIndex).SetTitleL(item.Title());
-		iList->RefreshScreen(aItemIndex);
+        if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot)
+            {
+            iList->RefreshScreen(aItemIndex);
+            }		
 		}
 
 	if (KErrNotFound != aAttributes.Find(subTitleAttrib, match))
 		{
 		iList->ItemL(aItemIndex).SetTextL(item.SubTitle());
-		iList->RefreshScreen(aItemIndex);
-
+		
+	    if (iMediaList->IdSpaceId(0) == KGlxIdSpaceIdRoot)
+            {
+            RefreshList(aItemIndex);
+            }
+        else
+            {
+            iList->RefreshScreen(aItemIndex);
+            }
+		
 		// If there is some modified in grid/fullscreen view,
 		// HandleAttributesAvailableL will get called. Here we are setting
 		// iIsRefreshNeeded flag to ETrue		
@@ -893,10 +973,6 @@
 				CleanUpL();
 				}
 			}
-		if(iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot)
-			{
-			UpdatePreviewL(aItemIndex);
-			}
 		// Set iPopulateListTNs to ETrue and refresh all the items in
 		// list view if subtitle is updated
 		else if (iPreviewTNBinding && ((!iPopulateListTNs && aItemIndex
@@ -912,17 +988,20 @@
 			CleanupStack::PopAndDestroy(path);		            	
 			}
 		}
-    TMPXAttribute thumbnailAttribute(KGlxMediaIdThumbnail,
-            GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth,
-                    iGridIconSize.iHeight));
-    if (KErrNotFound != aAttributes.Find(thumbnailAttribute, match))
-        {
-        if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot)
-            {
-            UpdatePreviewL(aItemIndex);
-            iIsRefreshNeeded = EFalse;
-            }
-        }
+
+	if (iMediaList->IdSpaceId(0) != KGlxIdSpaceIdRoot)
+		{
+		TMPXAttribute countAttrib(KMPXMediaGeneralCount);
+		TMPXAttribute thumbnailAttribute(KGlxMediaIdThumbnail,
+				GlxFullThumbnailAttributeId(ETrue, iGridIconSize.iWidth,
+						iGridIconSize.iHeight));
+		if ((KErrNotFound != aAttributes.Find(thumbnailAttribute, match))
+				|| (KErrNotFound != aAttributes.Find(countAttrib, match)))
+			{
+			iIsRefreshNeeded = EFalse;
+			UpdatePreviewL(aItemIndex);
+			}
+		}
 	}
 	
 // ----------------------------------------------------------------------------
@@ -1244,18 +1323,55 @@
                         iGridIconSize.iHeight));
         GLX_LOG_INFO1("CGlxListViewImp::UpdatePreviewL(aIndex = %d)", aIndex);
         const TGlxMedia& item = iMediaList->Item(aIndex);
+
+        TMPXAttribute attrCount(KMPXMediaGeneralCount);
+        TInt usageCount = 0;
+        const CGlxMedia* media = item.Properties();
+        if (media)
+            {
+            if (media->IsSupported(attrCount))
+                {
+                usageCount = media->ValueTObject<TInt> (attrCount);
+                GLX_LOG_INFO1("CGlxListViewImp::UpdatePreviewL() - UsageCount(%d)", usageCount);
+                }
+            }
+
         const CGlxThumbnailAttribute* value = item.ThumbnailAttribute(
                 thumbnailAttribute);
-        if (value)
+        if (usageCount && value)
             {
             CFbsBitmap* bitmap = new (ELeave) CFbsBitmap;
             CleanupStack::PushL(bitmap);
             iPreviewTNBinding->ScaleBitmapToListSizeL(value->iBitmap, bitmap);
             iList->ItemL(aIndex).SetIcon(CGulIcon::NewL(bitmap));
+            CleanupStack::Pop(bitmap);
             iList->RefreshScreen(aIndex);
-            CleanupStack::Pop(bitmap);
             }
         }
     }
 
+// ----------------------------------------------------------------------------
+// RefreshList
+// ----------------------------------------------------------------------------
+//  
+void CGlxListViewImp::RefreshList(TInt aIndex)
+    {
+    TRACER("CGlxListViewImp::RefreshList()");
+    GLX_DEBUG2("CGlxListViewImp::RefreshList(%d)", aIndex);	
+    __ASSERT_ALWAYS(iList, Panic(EGlxPanicNullPointer));
+    TInt firstIndex = iList->FirstIndexOnScreen();
+    TInt itemsOnScreen = iList->ItemsOnScreen();
+    TInt lastOnScreen = firstIndex + itemsOnScreen - 1;
+    TInt mediaCount = iMediaList->Count();
+    if (lastOnScreen > (mediaCount - 1))
+        {
+        lastOnScreen = mediaCount - 1;
+        }
+
+    if (aIndex == lastOnScreen)
+        {
+        GLX_DEBUG2("CGlxListViewImp::RefreshList() RefreshScreen(%d)", aIndex);
+        iList->RefreshScreen(aIndex);
+        }
+    }
 //  End of File
--- a/photosgallery/viewframework/views/metadatadialog/group/glxmetadatadialog.mmp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/metadatadialog/group/glxmetadatadialog.mmp	Tue May 25 12:42:31 2010 +0300
@@ -103,4 +103,5 @@
 LIBRARY			lbs.lib
 LIBRARY			exiflib.lib                     //For CExifModify
 LIBRARY         	caf.lib							//For ContentAccess
+LIBRARY			glximageviewermanager.lib
 // End of File
--- a/photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatacontainer.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/metadatadialog/inc/glximgvwrmetadatacontainer.h	Tue May 25 12:42:31 2010 +0300
@@ -30,7 +30,7 @@
 #include <aknsettingitemlist.h>     // for CAknSettingItem
 #include "mglxmedialistobserver.h"
 #include <glxattributecontext.h>  
-
+#include <glximageviewermanager.h>
 
 //FORWARD DECLARATION
 class MGlxMediaList;
@@ -134,6 +134,17 @@
         void SetNameDescriptionL(TInt aItem);
         void SetDurationLIicenseItemVisibilityL();
         TBool IsLicenseItem();
+
+        /**
+         * Create Image Viewer manager Instance
+         */
+        void CreateImageViewerInstanceL();
+        
+        /**
+         * Delete Image Viewer manager Instance
+         */
+        void DeleteImageViewerInstance();
+
    
 private:    //data
     
@@ -148,7 +159,8 @@
         MGlxMediaList* iItemMediaList;
         CGlxAttributeContext* iMainListAttributecontext;
         TGlxSelectionIterator iSelectionIterator;
-        
+        // For image viewer, not own
+        CGlxImageViewerManager* iImageViewerInstance;
     };
 
 
--- a/photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatacontainer.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/metadatadialog/src/glximgvwrmetadatacontainer.cpp	Tue May 25 12:42:31 2010 +0300
@@ -237,8 +237,17 @@
             GLX_LOG_INFO("CGlxImgVwrMetadataContainer::Licence item");         
             CGlxDRMUtility* drmUtility = CGlxDRMUtility::InstanceL();
             CleanupClosePushL(*drmUtility);
-            drmUtility->ShowDRMDetailsPaneL(iItemMediaList->Item(0).Uri());
+            CreateImageViewerInstanceL();
+            if(iImageViewerInstance->IsPrivate())
+                {
+                drmUtility->ShowDRMDetailsPaneL(iImageViewerInstance->ImageFileHandle());
+                }
+            else
+                {
+                drmUtility->ShowDRMDetailsPaneL(iItemMediaList->Item(0).Uri());
+                }
             CleanupStack::PopAndDestroy(drmUtility);
+            DeleteImageViewerInstance();
             }
         }
     }
@@ -735,6 +744,30 @@
         }
     return ETrue;
     }
- 
+
+// -----------------------------------------------------------------------------
+// CreateImageViewerInstanceL
+// -----------------------------------------------------------------------------
+//
+void CGlxImgVwrMetadataContainer::CreateImageViewerInstanceL()
+    {
+    TRACER("CGlxImgVwrMetadataContainer::CreateImageViewerInstanceL");
+    iImageViewerInstance = CGlxImageViewerManager::InstanceL();    
+    __ASSERT_ALWAYS(iImageViewerInstance, Panic(EGlxPanicNullPointer));
+    }
+
+// -----------------------------------------------------------------------------
+// DeleteImageViewerInstance
+// -----------------------------------------------------------------------------
+//
+void CGlxImgVwrMetadataContainer::DeleteImageViewerInstance()
+    {
+    TRACER("CGlxImgVwrMetadataContainer::DeleteImageViewerInstance");
+    if ( iImageViewerInstance )
+        {
+        iImageViewerInstance->DeleteInstance();
+        }
+    }
+
 
 //End of file
--- a/photosgallery/viewframework/views/zoomview/inc/glxzoommathsengine.h	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/zoomview/inc/glxzoommathsengine.h	Tue May 25 12:42:31 2010 +0300
@@ -38,8 +38,20 @@
             TBool* aThresholdReached = NULL);
 
     /**
-     * Starts zooming In/out with slider/Keys
-     * @ param aMfactor:The Zooming factor with which image has to be zoomed
+     * Recalculates the new TL and Dimension values for the viewport to be drawn after a new Zoom Operation
+     * @ param aZoomMode :          Are we Zooming In our out. Ignored when aExpectedZoomRatio 
+     *                                      has a non zero value
+     * @ param aExpectedZoomRatio : When we need zooming to a particular finite value. 
+     *                                      Generally for Slider based zoom.
+     * @ param aViewPortTopLeft:    The new TL location of the viewport after zooming
+     * @ param aViewPortDimension:  The new dimensions of the viewport after zooming
+     * @ param apThresholdReached : Optional parameter. If present, indicates whether we 
+     *                                      have reached a limit while zooming. 
+     * @ param apZoomFocus:         Optional parameter. If present, indicates the point 
+     *                                      around wich zooming happens, (offcenter zoom)
+     * @ param aRelativeZoomFactor: Percentage of zoom in relation to the previous value. 
+     *                                      useful in pinch zoom. If this is greater than 0, 
+     *                                      the first 2 parameters are ignored 
      */              
     TInt Zoom( TZoomMode aZoomMode,         // Ignored when aExpectedZoomRatio has a value 
                 TInt aExpectedZoomRatio,    // only for slider based zoom. = 0 for key based zoom. 
@@ -49,33 +61,74 @@
                 TPoint* apZoomFocus = NULL, 
                 TInt aRelativeZoomFactor = 0);
     
-    // Initialize 
+    /**
+     * Initialize the Maths engine
+     * @ param aCenter:         The center of the VP(View Port)
+     * @ param aScreenSize:     Screensize of the device. 
+     * @ param aImageSize:      Size of the image.
+     * @ param aOriginalZoomedDimensions:The Original zoomed dimension.
+     * @ param aInitialZoomRatio:Initial zoom ratio.
+     */              
     void Initialize(TPoint& aCenter, 
             TSize& aScreenSize, 
             TSize& aImageSize,
             TSize& aOriginalZoomedDimensions, 
             TUint8 aInitialZoomRatio);
     
-    void UpdatePanFactor(TTime& aPanTime);
+    /**
+     * UpdatePanFactor [Useful only in Key-based Panning]
+     */              
+    void UpdatePanFactor();
     
+    /**
+     * Indicates change of orientation. 
+     * @ param aNewScreenRect: New Screen size
+     */              
     // this can have a more generic name. but now it informs only abt screen orientation changes. and hence the name 
     void OrientationChanged(const TRect& aNewScreenRect);
     
+    /**
+     * Retrieves the Image Virtual Size
+     */              
     TSize ImageVirtualSize();
     
+    /**
+     * Retrieves the Image Virtual Size
+     */              
     TSize ScreenSize();
     
-    TInt NewCenterCoordinate(TInt Center, 
-            TInt Offset, 
-            TUint16 HalfScreenDimension, 
-            TInt MinimumCoordinate, 
-            TInt MaximumCoordinate, 
+    /**
+     * Retrieves the New Center Coordinate on one axis. 
+     * Needs to be called twice for both axes.
+     * @ param aCenter: The Center of the VP.
+     * @ param aOffset: The offset along one axis if we have paned 
+     * @ param aHalfScreenDimension: Half the screen dimension along this axis.
+     * @ param aMinimumCoordinate: Minimum possible coordinate along this axis. Usually 0.
+     * @ param aMaximumCoordinate: Maximum possible coordinate along this axis. 
+     * @ param aLimitReached:   Indicates if we have reached a limit while zooming/Panning.
+     */              
+    TInt NewCenterCoordinate(TInt aCenter, 
+            TInt aOffset, 
+            TUint16 aHalfScreenDimension, 
+            TInt aMinimumCoordinate, 
+            TInt aMaximumCoordinate, 
             TBool *aLimitReached = NULL) ;
     
+    /**
+     * Begin the pan operation
+     */              
     void SetupPanOperation();
     
+    /**
+     * Retrieves the latest ofset by which we panned
+     */              
     TPoint LastPanOffset();
 
+    /**
+     * Retrieves the minimum zoom ratio with which we stay in zoomode
+     */              
+    TInt MinimumZoomRatio();
+    
 private:
 
     /**
@@ -105,13 +158,12 @@
                                                  
     // These are the thresholds
     TUint8          iMaxZoomRatio;
-    TUint8          iMinZoomRatio   ;
-    TSize           iInitialImageSize   ;
+    TUint8          iMinZoomRatio;
+    TSize           iInitialImageSize;
 
     // This is what our current zoom ratio is in percentage
-    TReal						iZoomRatio;
+    TReal           iZoomRatio;
     
-    TPoint          iPanSpeed;          //  Pixels Panned per pan operation in vector form.  
     TPoint          iLastPanOffset;     //  Pixels Panned during the last pan operation.
     
     // [TODO]:Tsize might not be an exact match for this. using this only since it has exactly all the parameters that are required.   
--- a/photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/zoomview/src/glxzoomcontrol.cpp	Tue May 25 12:42:31 2010 +0300
@@ -978,7 +978,7 @@
 //  
 EXPORT_C TUiState CGlxZoomControl::ZoomUiState()    
     {
-    TRACER("CGlxFullScreenViewImp::GetUiState");
+    TRACER("CGlxZoomControl::ZoomUiState");
     return iEventHandler->ZoomUiState();
     }
 //  End of File
--- a/photosgallery/viewframework/views/zoomview/src/glxzoomeventhandler.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/zoomview/src/glxzoomeventhandler.cpp	Tue May 25 12:42:31 2010 +0300
@@ -253,7 +253,6 @@
 
     //After Panning in one direction for a long time by holding the key and 
     //then if panning is started in another direction,the panning will be done in more pixels.
-    iPanTime.HomeTime();
     
     GLX_LOG_INFO("CGlxZoomPanEventHandler::StartPanTimer: Cancelling timers ");
 
@@ -830,7 +829,7 @@
         CancelZoomPanTimer();
         }
     
-    iMathsEngine.UpdatePanFactor(iPanTime);
+    iMathsEngine.UpdatePanFactor();
     }
 
 
@@ -842,8 +841,8 @@
     {
     TRACER("CGlxZoomPanEventHandler::OrientationChanged ");
     
-    iMathsEngine.OrientationChanged(aNewScreenRect); // Needs to be called before Call to Zoom() inorder to Update the iScreenSize.
-    
+    iMathsEngine.OrientationChanged(aNewScreenRect);
+    iMinZoomRatio = iMathsEngine.MinimumZoomRatio(); 
     Zoom(0, 0, iZoomMode) ;
     }
 
@@ -1123,18 +1122,18 @@
             &atZoomThreshold,
             aZoomFocus, 
             aRelativeZoomFactor);
-    
-    iZoomEventHandler.HandleViewPortParametersChanged(viewPortTopLeft, 0, 
-            &viewPortDimension, iZoomRatio);
-    
+
     if( atZoomThreshold )
         {
         CancelZoomPanTimer();
         if (iZoomRatio <= iMinZoomRatio)
             {
             CallZoomOutL();
+            return;
             }
         }
+    iZoomEventHandler.HandleViewPortParametersChanged(viewPortTopLeft, 0, 
+            &viewPortDimension, iZoomRatio);
     }
 
 // -----------------------------------------------------------------------------
--- a/photosgallery/viewframework/views/zoomview/src/glxzoommathsengine.cpp	Tue May 11 16:13:40 2010 +0300
+++ b/photosgallery/viewframework/views/zoomview/src/glxzoommathsengine.cpp	Tue May 25 12:42:31 2010 +0300
@@ -222,7 +222,6 @@
     // centerTranslationfactor is the vector representation of that amount. 
     if (NULL != apZoomFocus)
         {
-		// Offcenter Zooming will be enabled later on.
         centerTranslationfactor.iX = (((apZoomFocus->iX - halfScreenWidth) * newZoomRatio)/oldZoomRatio) + (halfScreenWidth - apZoomFocus->iX);         
         centerTranslationfactor.iY = (((apZoomFocus->iY - halfScreenHeight) * newZoomRatio)/oldZoomRatio) + (halfScreenHeight - apZoomFocus->iY);
         }
@@ -392,7 +391,7 @@
 // UpdatePanFactor: Calculates the Pan Factor based on time the key was pressed
 //-------------------------------------------------------------------------------------
 //
-void TGlxZoomAndPanMathsEngine::UpdatePanFactor(TTime& /*aPanTime*/)
+void TGlxZoomAndPanMathsEngine::UpdatePanFactor()
     {
     TRACER("void TGlxZoomAndPanMathsEngine::UpdatePanFactor()");
     
@@ -491,7 +490,13 @@
     {
     TRACER("void TGlxZoomAndPanMathsEngine::OrientationChanged()");
     iScreenSize.iWidth          = aNewScreenRect.Width();    
-    iScreenSize.iHeight         = aNewScreenRect.Height();    
+    iScreenSize.iHeight         = aNewScreenRect.Height();
+	
+    //Choose the minimum of the below.
+    TReal32 imageWidthRatio  = ((TReal32)iScreenSize.iWidth  / iActualImageSize.iWidth  )*100.0F;
+    TReal32 imageHeightRatio = ((TReal32)iScreenSize.iHeight / iActualImageSize.iHeight )*100.0F;
+	iMinZoomRatio = Min(imageWidthRatio, imageHeightRatio);
+    GLX_LOG_INFO1("NewZoomRatio: New minimum Zoom Ratio = %d", TInt(iMinZoomRatio));		
     }
 
 //-------------------------------------------------------------------------------------
@@ -516,7 +521,7 @@
     }
 
 //-------------------------------------------------------------------------------------
-// ImageVirtualSize: retrieves the screen size .    
+// SetupPanOperation: Starts the Pan operations from the maths Engine's pont of view.    
 //-------------------------------------------------------------------------------------
 //
 void TGlxZoomAndPanMathsEngine::SetupPanOperation()
@@ -525,8 +530,22 @@
     iContinuousPanOperations = 0 ; 
     }
 
+//-------------------------------------------------------------------------------------
+// LastPanOffset: retrieves the last pan Offset.    
+//-------------------------------------------------------------------------------------
+//
 TPoint TGlxZoomAndPanMathsEngine::LastPanOffset()
     {
     TRACER("TGlxZoomAndPanMathsEngine::LastPanOffset()");
     return iLastPanOffset;
     }
+
+//-------------------------------------------------------------------------------------
+// MinimumZoomRatio: Retrieves the minimum Zoom threshold.    
+//-------------------------------------------------------------------------------------
+//
+TInt TGlxZoomAndPanMathsEngine::MinimumZoomRatio()
+    {
+    TRACER("TGlxZoomAndPanMathsEngine::MinimumZoomRatio");
+	return iMinZoomRatio;
+    }