ui/views/fullscreenview/src/glxfullscreenview.cpp
changeset 55 fb37077c270f
parent 49 f291796e213d
child 61 743eb0b9959e
--- a/ui/views/fullscreenview/src/glxfullscreenview.cpp	Tue Jul 06 14:16:16 2010 +0300
+++ b/ui/views/fullscreenview/src/glxfullscreenview.cpp	Wed Aug 18 09:48:53 2010 +0300
@@ -30,7 +30,7 @@
 #include <hbabstractviewitem.h>
 #include <hbiconitem.h>
 #include <QCoreApplication>
-
+#include <xqserviceutil.h>
 //User Includes
 #include "glxlog.h"
 #include "glxtracer.h"
@@ -44,7 +44,7 @@
 #include "glxfullscreenview.h" 
 #include "glxcommandhandlers.hrh"
 #include "glxzoomwidget.h"
-
+#include "glxlocalisationstrings.h"
 #include "OstTraceDefinitions.h"
 #ifdef OST_TRACE_COMPILER_IN_USE
 #include "glxfullscreenviewTraces.h"
@@ -54,29 +54,34 @@
 const int KUiOffTime = 3000;
 
 GlxFullScreenView::GlxFullScreenView(HbMainWindow *window,HbDocumentLoader *DocLoader) : 
-    GlxView ( GLX_FULLSCREENVIEW_ID), 
-    mModel(NULL), 
-    mWindow( window), 
-    mCoverFlow(NULL) , 
-    mImageStrip (NULL), 
-    mUiOffTimer(NULL),
-    mIconItem(NULL),
-    mTvOutWrapper(NULL),
-    mFullScreenToolBar(NULL),
-	mZoomWidget(NULL)
+    GlxView ( GLX_FULLSCREENVIEW_ID ), 
+    mModel( NULL ), 
+    mWindow( window ), 
+    mCoverFlow( NULL ) , 
+    mImageStrip( NULL ), 
+    mUiOffTimer( NULL ),
+    mTvOutWrapper( NULL ),
+    mFullScreenToolBar( NULL ),
+	mZoomWidget( NULL ),
+	mUiOff ( false)
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_GLXFULLSCREENVIEW_ENTRY );
-    
+    mIconItems[0] = NULL;
+    mIconItems[1] = NULL;
     mDocLoader = DocLoader;
     setContentFullScreen( true );
-    HbEffect::add( QString("HbGridView"), QString(":/data/transitionup.fxml"), QString( "TapShow" ));
-    HbEffect::add( QString("HbGridView"), QString(":/data/transitiondown.fxml"), QString( "TapHide" ));
-    HbEffect::add( QString("HbGridViewItem"), QString(":/data/gridtofullscreenhide.fxml"), QString( "Select" ));
+    
+    HbEffect::add( QString( "HbGridView" ), QString( ":/data/transitionup.fxml" ), QString( "TapShow" ) );
+    HbEffect::add( QString( "HbGridView" ), QString( ":/data/transitiondown.fxml" ), QString( "TapHide" ) );
+    HbEffect::add( QString( "HbGridViewItem" ), QString( ":/data/zoomin.fxml" ), QString( "SelectHide" ) );
+    HbEffect::add( QString( "HbGridViewItem" ), QString( ":/data/zoomout.fxml" ), QString( "SelectShow" ) );
+    HbEffect::add( QString( "HbIconItem" ), QString( ":/data/rotatefslandscape.fxml" ), QString( "RotateFSLS" ) );
+    HbEffect::add( QString( "HbIconItem" ), QString( ":/data/rotatefsprotrait.fxml" ), QString( "RotateFSPT" ) );
     
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_GLXFULLSCREENVIEW_EXIT );
 }
 
-void GlxFullScreenView::initializeView(QAbstractItemModel *model)
+void GlxFullScreenView::initializeView( QAbstractItemModel *model, GlxView *preView )
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_INITIALIZEVIEW_ENTRY );
     
@@ -87,9 +92,23 @@
     setHdmiModel(model);
     loadWidgets();
 
-    // Initialize the coverflow and partially creates the coverflow with one image
-    // to make the widget light weight in order to make transition smooth 
-    mCoverFlow->partiallyCreate( model, screenSize() );
+    /* 
+     * Initialize the coverflow and partially creates the coverflow with one image
+     * to make the widget light weight in order to make transition smooth 
+     */
+    /* 
+     * Grid view is not in full screen mode so this view have some flicker after transtion is finshed 
+     * and some cases in grid view status bar is visible and some cases it is not
+     * so adjust the initial postion of fullscreen base on status bar visiblity.
+     */
+    if ( preView->compare( GLX_GRIDVIEW_ID ) && preView->isItemVisible ( Hb::StatusBarItem ) ) {
+        qreal chromeHeight = 0;
+        style()->parameter( "hb-param-widget-chrome-height", chromeHeight );
+        mCoverFlow->partiallyCreate( model, screenSize(), -chromeHeight );
+    }
+    else {
+        mCoverFlow->partiallyCreate( model, screenSize() );
+    }
     
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_INITIALIZEVIEW_EXIT );
 }
@@ -113,6 +132,7 @@
     mImageStrip->hide();      
 	mImageStrip->setLayoutName( QString( "ImageStrip" ) ); // To distinguish in CSS file
 	mImageStrip->setEnabledAnimations( HbAbstractItemView::None );
+	mImageStrip->setHorizontalScrollBarPolicy( HbScrollArea::ScrollBarAlwaysOff );
 	
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_LOADWIDGETS_EXIT );
 }
@@ -166,23 +186,47 @@
     }
     //Loads the widgets corresponding to the orientation.
     loadViewSection();
-    
-    setStatusBarVisible(FALSE);
-    setTitleBarVisible(FALSE);
+	
+    HbView::HbViewFlags flags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent);
+    setViewFlags(flags);
+	
+	// In case of fetcher don't hide status pane and title bar
+    if(!(XQServiceUtil::isService() && (0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch"))))) {
+        setViewFlags( viewFlags() | HbView::ViewTitleBarHidden | HbView::ViewStatusBarHidden );
+		mUiOff = true;
+	}
+    else
+        {
+        HbAction* selectAction = new HbAction(GLX_BUTTON_SELECT);
+        selectAction->setObjectName( "FS Select" );
+        
+        connect(selectAction, SIGNAL(triggered()), this, SLOT(handleFSSelect()));
+        HbToolBar* toolBar = new HbToolBar();
+        toolBar->setOrientation( Qt::Horizontal );
+        toolBar->setVisible(true);
+        toolBar->addAction(selectAction);
+        setToolBar(toolBar);
+        }
         
     mUiOffTimer = new QTimer();
-    mUiOff = true;
     mUiOffTimer->stop();        
     mCoverFlow->setUiOn(FALSE);    
     addConnection(); 
     setLayout();
      
-    if (!mTvOutWrapper){
+    if (!mTvOutWrapper) {
         mTvOutWrapper = new GlxTvOutWrapper();
     }
+    
+    mWindow->setAutomaticOrientationEffectEnabled( false );
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_ACTIVATE_EXIT );
 }
 
+void GlxFullScreenView::handleFSSelect()
+{
+    emit actionTriggered( EGlxCmdFetcherSelect );
+}
+
 void GlxFullScreenView::loadViewSection()
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_LOADVIEWSECTION_ENTRY );    
@@ -204,6 +248,7 @@
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_RESETVIEW_ENTRY );    
 
+    cancelSelectionAnimation(); //cancel the image selection effect before cleaning the view
     //Clean up the rest of the resources allocated
     cleanUp(); 
         
@@ -217,6 +262,7 @@
 { 
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_DEACTIVATE_ENTRY );    
     
+    cancelSelectionAnimation(); //cancel the image selection effect before cleaning the view
 	//Clean up the rest of the resources allocated
     cleanUp();
     QCoreApplication::instance()->removeEventFilter(this);
@@ -227,7 +273,7 @@
     //the coverflow is initialised to null 
     //to just reset to the initial state
     mCoverFlow = NULL;
-    
+    mWindow->setAutomaticOrientationEffectEnabled( true );
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_DEACTIVATE_EXIT );
 }
 
@@ -246,6 +292,7 @@
 
     if(mFullScreenToolBar) {
        mFullScreenToolBar->clearActions();
+       mFullScreenToolBar->hide();
        mFullScreenToolBar = NULL;
     }
     
@@ -285,11 +332,10 @@
     mCoverFlow->setModel(mModel);
     setImageStripModel();
     if(getSubState() == IMAGEVIEWER_S) {
-        setTitle("Image Viewer");
+        setTitle(GLX_IMAGE_VIEWER);
     }
-	else if(getSubState() == FETCHER_S){
-		setStatusBarVisible(TRUE);
-        setTitleBarVisible(TRUE);
+	else if(getSubState() == FETCHER_S){ //do not zoom in case of fetcher
+		disconnect(mCoverFlow,SIGNAL( doubleTapEventReceived(QPointF) ), mZoomWidget, SLOT( animateZoomIn(QPointF) ) );
 	}
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_SETMODEL_EXIT );
 }
@@ -297,7 +343,7 @@
 void GlxFullScreenView::setHdmiModel(QAbstractItemModel* model)
 {
     if (mTvOutWrapper) {
-        mTvOutWrapper->setModel(model); 
+        mTvOutWrapper->setModel(model, screenSize()); 
         mTvOutWrapper->setImagetoHDMI(); // for the first image on screen
     }    
 }
@@ -332,6 +378,7 @@
     setModelContext();
     loadViewSection();
     setLayout();
+    playOrientChangeAnim();
     
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_ORIENTATIONCHANGED_EXIT );
 }
@@ -340,7 +387,7 @@
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_ACTIVATEUI_ENTRY );
     
-    if ( mUiOff && getSubState() != FETCHER_S){      
+    if ( mUiOff && getSubState() != FETCHER_S ){      
         if( !mFullScreenToolBar ) {
             loadFullScreenToolBar();
         }
@@ -351,18 +398,18 @@
             mImageStrip->setCurrentIndex ( mModel->index( variant.value<int>(), 0) );    
             mImageStrip->scrollTo( mModel->index( variant.value<int>(), 0), HbGridView::PositionAtTop ); 
         }
-        
-        mFullScreenToolBar->show();
-		setStatusBarVisible(TRUE);
-        setTitleBarVisible(TRUE);
+
+        setItemVisible( Hb::AllItems, TRUE );
+        setViewFlags( viewFlags() &~ HbView::ViewTitleBarHidden &~ HbView::ViewStatusBarHidden );
        
         if ( mImageStrip && getSubState() != IMAGEVIEWER_S) {
             mImageStrip->show(); 
             HbEffect::start(mImageStrip, QString("HbGridView"), QString("TapShow"), this, "effectFinished" );
         }
         else if( getSubState() == IMAGEVIEWER_S){
-            setTitle("Image Viewer");
+            setTitle(GLX_IMAGE_VIEWER);
         }
+        mFullScreenToolBar->show();
     }
     else {
         hideUi();
@@ -384,11 +431,10 @@
     
     mUiOff = TRUE;
 	if ( getSubState() != FETCHER_S ) {
-		setStatusBarVisible(FALSE);
-        setTitleBarVisible(FALSE);
+	    setViewFlags( viewFlags() | HbView::ViewTitleBarHidden | HbView::ViewStatusBarHidden );
 	}
-    if ( mImageStrip && ( getSubState() != IMAGEVIEWER_S && getSubState() != FETCHER_S )) {
-        HbEffect::start(mImageStrip, QString("HbGridView"), QString("TapHide"), this, "effectFinished" );
+    if ( mImageStrip && ( getSubState() != IMAGEVIEWER_S && getSubState() != FETCHER_S ) ) {
+        HbEffect::start( mImageStrip, QString("HbGridView"), QString("TapHide"), this, "effectFinished" );
     }
 
     if(mFullScreenToolBar) {
@@ -419,6 +465,7 @@
     mModel->setData( index, index.row(), GlxFocusIndexRole );
     mModel->setData( index, index.row(), GlxVisualWindowIndex );
 	mZoomWidget->indexChanged(index.row());  
+
     if (mTvOutWrapper){
         // for the image changed on swipe
         mTvOutWrapper->setImagetoHDMI();
@@ -435,16 +482,17 @@
        OstTraceFunctionExit0( GLXFULLSCREENVIEW_INDEXCHANGED_EXIT );
        return;
     }         
-    mModel->setData( index, index.row(), GlxFocusIndexRole );
-	mZoomWidget->indexChanged(index.row());
-    mCoverFlow->indexChanged(index.row());
-    mImageStrip->scrollTo(index, HbGridView::EnsureVisible );
+    
     if (mTvOutWrapper){
-    // for the indexchnaged through filmstrip
-    mTvOutWrapper->setImagetoHDMI();
+        // for the indexchnaged through filmstrip
+        mTvOutWrapper->setImagetoHDMI();
     }
     //disable the animation for the time being
-    //imageSelectionAnimation( index );
+    imageSelectionAnimation( index );
+    
+    mModel->setData( index, index.row(), GlxFocusIndexRole );
+    mZoomWidget->indexChanged(index.row());
+    mZoomWidget->setVisible( false );
     
     OstTraceFunctionExit0( DUP1_GLXFULLSCREENVIEW_INDEXCHANGED_EXIT );
 }
@@ -531,6 +579,18 @@
         hideUi();
         break ;
         
+    //hide the ui component without animation  
+    case ZOOM_START_EVENT : {
+        HbEffect::EffectStatus e;
+        mUiOff = TRUE;
+        if( mFullScreenToolBar ) {
+           mFullScreenToolBar->hide();
+        }
+        setViewFlags( viewFlags() | HbView::ViewTitleBarHidden | HbView::ViewStatusBarHidden );
+        effectFinished( e );
+    }
+        break;
+        
     case EMPTY_ROW_EVENT :
         emit actionTriggered( EGlxCmdEmptyData );
         break ;
@@ -554,6 +614,7 @@
         mUiOffTimer->stop();        
         mCoverFlow->setUiOn(FALSE);
         mImageStrip->hide();
+        setItemVisible( Hb::AllItems, FALSE );
     }
     else {
         mUiOffTimer->start(KUiOffTime);
@@ -567,17 +628,30 @@
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_IMAGESELECTIONEFFECTFINISHED_ENTRY );
     
-    mIconItem->resetTransform();
-    mIconItem->setVisible( false );
+    for ( int i = 0; i < NBR_ANIM_ITEM; i++ ) { 
+        mIconItems[ i ]->resetTransform();
+        mIconItems[ i ]->setVisible( false );
+    }
     
     QVariant variant = mModel->data( mModel->index(0,0), GlxFocusIndexRole );    
     if ( variant.isValid() &&  variant.canConvert<int> ()  ) {
         mCoverFlow->indexChanged( variant.value<int>() ) ;         
     }
+    mCoverFlow->setVisible( true );
+    mZoomWidget->setVisible( true );
 
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_IMAGESELECTIONEFFECTFINISHED_EXIT );
 }
 
+void GlxFullScreenView::orientChangeAnimFinished( const HbEffect::EffectStatus status )
+{
+    qDebug( "GlxFullScreenView::LsOrientChangeAnimFinished reason %d ", status.reason );
+    mIconItems[ 0 ]->resetTransform();   
+    mIconItems[ 0 ]->setVisible( false );
+    mCoverFlow->setVisible( true );
+    mZoomWidget->setVisible( true );
+}
+
 void GlxFullScreenView::setLayout()
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_SETLAYOUT_ENTRY );
@@ -596,28 +670,28 @@
     
     if ( mCoverFlow ) {    
         connect( mCoverFlow, SIGNAL( coverFlowEvent( GlxCoverFlowEvent ) ), this, SLOT( coverFlowEventHandle( GlxCoverFlowEvent ) ) );
-        connect( mCoverFlow, SIGNAL(changeSelectedIndex(const QModelIndex &)), this, SLOT( changeSelectedIndex( const QModelIndex & )));
+        connect( mCoverFlow, SIGNAL( changeSelectedIndex( const QModelIndex & ) ), this, SLOT( changeSelectedIndex( const QModelIndex & ) ) );
     }
 
     if ( mImageStrip ) {
-        connect(mImageStrip, SIGNAL( activated(const QModelIndex &) ), this, SLOT( indexChanged(const QModelIndex &) ));
-        connect(mImageStrip, SIGNAL( scrollingStarted()),  this, SLOT( scrollingStarted()));
-        connect(mImageStrip, SIGNAL( scrollingEnded()),    this, SLOT( scrollingEnded()));
-        connect(mImageStrip, SIGNAL( pressed(const QModelIndex &) ),      this, SLOT( pressed(const QModelIndex &) ));
-        connect(mImageStrip, SIGNAL( released(const QModelIndex &) ),     this, SLOT( released(const QModelIndex &) ));
+        connect( mImageStrip, SIGNAL( activated(const QModelIndex &) ), this, SLOT( indexChanged(const QModelIndex &) ) );
+        connect( mImageStrip, SIGNAL( scrollingStarted()), this, SLOT( scrollingStarted() ) );
+        connect( mImageStrip, SIGNAL( scrollingEnded()), this, SLOT( scrollingEnded() ) );
+        connect( mImageStrip, SIGNAL( pressed( const QModelIndex & ) ), this, SLOT( pressed( const QModelIndex & ) ) );
+        connect( mImageStrip, SIGNAL( released( const QModelIndex & ) ),     this, SLOT( released( const QModelIndex & ) ) );
     }
 
     if ( mUiOffTimer ) {
-        connect(mUiOffTimer, SIGNAL(timeout()), this, SLOT(hideUi()));
+        connect( mUiOffTimer, SIGNAL( timeout() ), this, SLOT( hideUi() ) );
     }
     
-    if(mCoverFlow && mZoomWidget) {
-		connect(mZoomWidget,SIGNAL( pinchGestureReceived(int) ), mCoverFlow, SLOT( zoomStarted(int) ) );
-		connect(mZoomWidget,SIGNAL( zoomWidgetMovedBackground(int) ), mCoverFlow, SLOT( zoomFinished(int) ) );
-        connect(mCoverFlow,SIGNAL( doubleTapEventReceived(QPointF) ), mZoomWidget, SLOT( animateZoomIn(QPointF) ) );
+    if( mCoverFlow && mZoomWidget ) {
+		connect( mZoomWidget, SIGNAL( pinchGestureReceived( int ) ), mCoverFlow, SLOT( zoomStarted( int ) ) );
+		connect( mZoomWidget, SIGNAL( zoomWidgetMovedBackground( int ) ), mCoverFlow, SLOT( zoomFinished( int ) ) );
+        connect( mCoverFlow, SIGNAL( doubleTapEventReceived( QPointF ) ), mZoomWidget, SLOT( animateZoomIn( QPointF ) ) );
 	}
 
-    connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation)));
+    connect( mWindow, SIGNAL( orientationChanged( Qt::Orientation ) ), this, SLOT( orientationChanged( Qt::Orientation ) ) );
 
     OstTraceFunctionExit0( GLXFULLSCREENVIEW_ADDCONNECTION_EXIT );
 }
@@ -675,8 +749,9 @@
     OstTraceFunctionEntry0( DUP1_GLXFULLSCREENVIEW_GLXFULLSCREENVIEW_ENTRY );
     
 	cleanUp();
-	
-	delete mIconItem ;
+	for ( int i = 0; i < NBR_ANIM_ITEM; i++ ) {
+	    delete mIconItems[ i ] ;
+	}
     delete mImageStrip;
     delete mFullScreenToolBar;
     delete mCoverFlow;
@@ -689,36 +764,73 @@
     
     HbEffect::remove( QString("HbGridView"), QString(":/data/transitionup.fxml"), QString( "TapShow" ));
     HbEffect::remove( QString("HbGridView"), QString(":/data/transitiondown.fxml"), QString( "TapHide" ));
-    HbEffect::remove( QString("HbGridViewItem"), QString(":/data/gridtofullscreenhide.fxml"), QString( "Select" ));
+    HbEffect::remove( QString( "HbGridViewItem" ), QString( ":/data/zoomin.fxml" ), QString( "SelectHide" ) );
+    HbEffect::remove( QString( "HbGridViewItem" ), QString( ":/data/zoomout.fxml" ), QString( "SelectShow" ) );
+    HbEffect::remove( QString( "HbIconItem" ), QString( ":/data/rotatefslandscape.fxml" ), QString( "RotateFSLS" ) );
+    HbEffect::remove( QString( "HbIconItem" ), QString( ":/data/rotatefsprotrait.fxml" ), QString( "RotateFSPT" ) );
+        
+    OstTraceFunctionExit0( DUP1_GLXFULLSCREENVIEW_GLXFULLSCREENVIEW_EXIT );
+}
 
-    OstTraceFunctionExit0( DUP1_GLXFULLSCREENVIEW_GLXFULLSCREENVIEW_EXIT );
+void GlxFullScreenView::initAnimationItem()
+{
+    if( mIconItems[0] == NULL ) {
+        for( int i = 0; i < NBR_ANIM_ITEM; i++ ) {
+            mIconItems[ i ] = new HbIconItem( mImageStrip->parentItem() );
+            mIconItems[ i ]->setBrush( QBrush( Qt::black ) );
+            mIconItems[ i ]->setZValue( mImageStrip->zValue() - 2 );
+            mIconItems[ i ]->setPos( 0, 0 );
+            mIconItems[ i ]->setAlignment( Qt::AlignCenter );
+        }
+    }
 }
 
 void GlxFullScreenView::imageSelectionAnimation(const QModelIndex &index)
 {
     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_IMAGESELECTIONANIMATION_ENTRY );
-
-    if ( mIconItem == NULL ) {
-        mIconItem = new HbIconItem( mCoverFlow );
-        mIconItem->setBrush( QBrush( Qt::black ) );
-        mIconItem->setZValue( mCoverFlow->zValue() );
+    
+    initAnimationItem();
+    for ( int i = 0; i < NBR_ANIM_ITEM; i++ ) {
+        mIconItems[ i ]->setVisible( true );
+        mIconItems[ i ]->setSize( screenSize() );
     }
     
-    HbAbstractViewItem *mItem = mImageStrip->itemByIndex( index );    
-    mIconItem->setSize( mItem->size() );    
-    mIconItem->setPos( mItem->sceneTransform().map( QPoint(0,0)).x() , screenSize().height() - 2 * mItem->size().height() ); 
-    mIconItem->setVisible( true );
+    mIconItems[ 0 ]->setIcon( mCoverFlow->getIcon( mCoverFlow->getFocusIndex() ) );    
+    mIconItems[ 1 ]->setIcon( mCoverFlow->getIcon( index.row() ) );   
+    mCoverFlow->setVisible( false );
+    mZoomWidget->setVisible( false );
     
-    QVariant variant = mModel->data( index, Qt::DecorationRole );
-    if ( variant.isValid() &&  variant.canConvert<HbIcon> () ) {
-        mIconItem->setIcon ( variant.value<HbIcon>() ) ; 
+    HbEffect::start( mIconItems[ 0 ], QString( "HbGridViewItem" ), QString( "SelectHide" ) );
+    HbEffect::start( mIconItems[ 1 ], QString( "HbGridViewItem" ), QString( "SelectShow" ), this, "imageSelectionEffectFinished" );
+
+    OstTraceFunctionExit0( GLXFULLSCREENVIEW_IMAGESELECTIONANIMATION_EXIT );
+}
+
+void GlxFullScreenView::cancelSelectionAnimation()
+{
+    if ( mIconItems[0] && HbEffect::effectRunning( mIconItems[1], QString( "SelectShow" ) ) ) {
+        HbEffect::cancel( mIconItems[0], QString( "SelectHide" ), false, false, true );
+        HbEffect::cancel( mIconItems[1], QString( "SelectShow" ), false, true, true );
+    }
+}
+
+void GlxFullScreenView::playOrientChangeAnim()
+{
+    qDebug("GlxFullScreenView::playOrientChangeAnim()");
+    initAnimationItem();
+    mIconItems[ 0 ]->setOpacity( 1 );
+    mIconItems[ 0 ]->setSize( screenSize() );
+    mIconItems[ 0 ]->setVisible( true );
+    mIconItems[ 0 ]->setIcon( mCoverFlow->getIcon( mCoverFlow->getFocusIndex() ) );
+    
+    mCoverFlow->setVisible( false );
+    mZoomWidget->setVisible( false );
+    if ( mWindow->orientation() == Qt::Horizontal ) {
+        HbEffect::start( mIconItems[0], QString( "HbIconItem" ), QString( "RotateFSLS" ), this, "orientChangeAnimFinished" );
     }
     else {
-        mIconItem->setIcon( HbIcon() );
-    }    
-    HbEffect::start( mIconItem, QString("HbGridViewItem"), QString("Select"), this, "imageSelectionEffectFinished" ); 
-
-    OstTraceFunctionExit0( GLXFULLSCREENVIEW_IMAGESELECTIONANIMATION_EXIT );
+        HbEffect::start( mIconItems[0], QString( "HbIconItem" ), QString( "RotateFSPT" ), this, "orientChangeAnimFinished" );
+    }
 }
 	
 void GlxFullScreenView::handleToolBarAction()
@@ -752,9 +864,15 @@
         GLX_LOG_INFO("GlxFullScreenView::event() shift to native - CGlxHdmi");
         mTvOutWrapper->setToNativeMode();    
     }
-    if ( ev->type() ==  QEvent::ApplicationDeactivate && mTvOutWrapper) {
-        GLX_LOG_INFO("GlxFullScreenView::event() shift to Clone - CGlxHdmi");
-        mTvOutWrapper->setToCloningMode();    
+    if (ev->type() ==  QEvent::ApplicationDeactivate)
+    {
+        if(mZoomWidget) {
+            mZoomWidget->forceZoomToBackground();
+        }
+        if (mTvOutWrapper) {
+            GLX_LOG_INFO("GlxFullScreenView::event() shift to Clone - CGlxHdmi");
+            mTvOutWrapper->setToCloningMode();    
+        }
     }
     return HbView::eventFilter(obj,ev);
 }