ui/views/fullscreenview/src/glxfullscreenview.cpp
changeset 52 a3a4c0de738e
parent 50 a0f57508af73
child 54 0f0f3f26f787
equal deleted inserted replaced
50:a0f57508af73 52:a3a4c0de738e
   181     if( !mCoverFlow ) {
   181     if( !mCoverFlow ) {
   182         loadWidgets();  //retrives the widgets
   182         loadWidgets();  //retrives the widgets
   183     }
   183     }
   184     //Loads the widgets corresponding to the orientation.
   184     //Loads the widgets corresponding to the orientation.
   185     loadViewSection();
   185     loadViewSection();
       
   186 	
       
   187     HbView::HbViewFlags flags( HbView::ViewTitleBarTransparent | HbView::ViewStatusBarTransparent);
       
   188     setViewFlags(flags);
       
   189 	
   186 	// In case of fetcher don't hide status pane and title bar
   190 	// In case of fetcher don't hide status pane and title bar
   187     if(!(XQServiceUtil::isService() && (0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch"))))){
   191     if(!(XQServiceUtil::isService() && (0 == XQServiceUtil::interfaceName().compare(QLatin1String("com.nokia.symbian.IImageFetch"))))){
   188 	    setStatusBarVisible(FALSE);
   192 	    setStatusBarVisible(FALSE);
   189 	    setTitleBarVisible(FALSE);
   193 	    setTitleBarVisible(FALSE);
   190 		mUiOff = true;
   194 		mUiOff = true;
   221 
   225 
   222 void GlxFullScreenView::resetView()
   226 void GlxFullScreenView::resetView()
   223 {
   227 {
   224     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_RESETVIEW_ENTRY );    
   228     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_RESETVIEW_ENTRY );    
   225 
   229 
       
   230     cancelSelectionAnimation(); //cancel the image selection effect before cleaning the view
   226     //Clean up the rest of the resources allocated
   231     //Clean up the rest of the resources allocated
   227     cleanUp(); 
   232     cleanUp(); 
   228         
   233         
   229     //Clear the 4 icons present in the Coverflow,so that the transition between the views are smooth
   234     //Clear the 4 icons present in the Coverflow,so that the transition between the views are smooth
   230     mCoverFlow->partiallyClean();
   235     mCoverFlow->partiallyClean();
   234 
   239 
   235 void GlxFullScreenView::deActivate()
   240 void GlxFullScreenView::deActivate()
   236 { 
   241 { 
   237     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_DEACTIVATE_ENTRY );    
   242     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_DEACTIVATE_ENTRY );    
   238     
   243     
       
   244     cancelSelectionAnimation(); //cancel the image selection effect before cleaning the view
   239 	//Clean up the rest of the resources allocated
   245 	//Clean up the rest of the resources allocated
   240     cleanUp();
   246     cleanUp();
   241     QCoreApplication::instance()->removeEventFilter(this);
   247     QCoreApplication::instance()->removeEventFilter(this);
   242     //deletes the iconitems in the coverflow   
   248     //deletes the iconitems in the coverflow   
   243     mCoverFlow->ClearCoverFlow();
   249     mCoverFlow->ClearCoverFlow();
   263         mUiOffTimer = NULL;
   269         mUiOffTimer = NULL;
   264     }
   270     }
   265 
   271 
   266     if(mFullScreenToolBar) {
   272     if(mFullScreenToolBar) {
   267        mFullScreenToolBar->clearActions();
   273        mFullScreenToolBar->clearActions();
       
   274        mFullScreenToolBar->hide();
   268        mFullScreenToolBar = NULL;
   275        mFullScreenToolBar = NULL;
   269     }
   276     }
   270     
   277     
   271     if (mTvOutWrapper) {
   278     if (mTvOutWrapper) {
   272         delete mTvOutWrapper;
   279         delete mTvOutWrapper;
   313 }
   320 }
   314 
   321 
   315 void GlxFullScreenView::setHdmiModel(QAbstractItemModel* model)
   322 void GlxFullScreenView::setHdmiModel(QAbstractItemModel* model)
   316 {
   323 {
   317     if (mTvOutWrapper) {
   324     if (mTvOutWrapper) {
   318         mTvOutWrapper->setModel(model); 
   325         mTvOutWrapper->setModel(model, screenSize()); 
   319         mTvOutWrapper->setImagetoHDMI(); // for the first image on screen
   326         mTvOutWrapper->setImagetoHDMI(); // for the first image on screen
   320     }    
   327     }    
   321 }
   328 }
   322 
   329 
   323 void GlxFullScreenView::setModelContext()
   330 void GlxFullScreenView::setModelContext()
   369             mImageStrip->setCurrentIndex ( mModel->index( variant.value<int>(), 0) );    
   376             mImageStrip->setCurrentIndex ( mModel->index( variant.value<int>(), 0) );    
   370             mImageStrip->scrollTo( mModel->index( variant.value<int>(), 0), HbGridView::PositionAtTop ); 
   377             mImageStrip->scrollTo( mModel->index( variant.value<int>(), 0), HbGridView::PositionAtTop ); 
   371         }
   378         }
   372         
   379         
   373         mFullScreenToolBar->show();
   380         mFullScreenToolBar->show();
   374 		setStatusBarVisible(TRUE);
   381 		setStatusBarVisible( TRUE );
   375         setTitleBarVisible(TRUE);
   382         setTitleBarVisible( TRUE );
   376        
   383        
   377         if ( mImageStrip && getSubState() != IMAGEVIEWER_S) {
   384         if ( mImageStrip && getSubState() != IMAGEVIEWER_S) {
   378             mImageStrip->show(); 
   385             mImageStrip->show(); 
   379             HbEffect::start(mImageStrip, QString("HbGridView"), QString("TapShow"), this, "effectFinished" );
   386             HbEffect::start(mImageStrip, QString("HbGridView"), QString("TapShow"), this, "effectFinished" );
   380         }
   387         }
   619 {
   626 {
   620     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_ADDCONNECTION_ENTRY );
   627     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_ADDCONNECTION_ENTRY );
   621     
   628     
   622     if ( mCoverFlow ) {    
   629     if ( mCoverFlow ) {    
   623         connect( mCoverFlow, SIGNAL( coverFlowEvent( GlxCoverFlowEvent ) ), this, SLOT( coverFlowEventHandle( GlxCoverFlowEvent ) ) );
   630         connect( mCoverFlow, SIGNAL( coverFlowEvent( GlxCoverFlowEvent ) ), this, SLOT( coverFlowEventHandle( GlxCoverFlowEvent ) ) );
   624         connect( mCoverFlow, SIGNAL(changeSelectedIndex(const QModelIndex &)), this, SLOT( changeSelectedIndex( const QModelIndex & )));
   631         connect( mCoverFlow, SIGNAL( changeSelectedIndex( const QModelIndex & ) ), this, SLOT( changeSelectedIndex( const QModelIndex & ) ) );
   625     }
   632     }
   626 
   633 
   627     if ( mImageStrip ) {
   634     if ( mImageStrip ) {
   628         connect(mImageStrip, SIGNAL( activated(const QModelIndex &) ), this, SLOT( indexChanged(const QModelIndex &) ));
   635         connect( mImageStrip, SIGNAL( activated(const QModelIndex &) ), this, SLOT( indexChanged(const QModelIndex &) ) );
   629         connect(mImageStrip, SIGNAL( scrollingStarted()),  this, SLOT( scrollingStarted()));
   636         connect( mImageStrip, SIGNAL( scrollingStarted()), this, SLOT( scrollingStarted() ) );
   630         connect(mImageStrip, SIGNAL( scrollingEnded()),    this, SLOT( scrollingEnded()));
   637         connect( mImageStrip, SIGNAL( scrollingEnded()), this, SLOT( scrollingEnded() ) );
   631         connect(mImageStrip, SIGNAL( pressed(const QModelIndex &) ),      this, SLOT( pressed(const QModelIndex &) ));
   638         connect( mImageStrip, SIGNAL( pressed( const QModelIndex & ) ), this, SLOT( pressed( const QModelIndex & ) ) );
   632         connect(mImageStrip, SIGNAL( released(const QModelIndex &) ),     this, SLOT( released(const QModelIndex &) ));
   639         connect( mImageStrip, SIGNAL( released( const QModelIndex & ) ),     this, SLOT( released( const QModelIndex & ) ) );
   633     }
   640     }
   634 
   641 
   635     if ( mUiOffTimer ) {
   642     if ( mUiOffTimer ) {
   636         connect(mUiOffTimer, SIGNAL(timeout()), this, SLOT(hideUi()));
   643         connect( mUiOffTimer, SIGNAL( timeout() ), this, SLOT( hideUi() ) );
   637     }
   644     }
   638     
   645     
   639     if(mCoverFlow && mZoomWidget) {
   646     if( mCoverFlow && mZoomWidget ) {
   640 		connect(mZoomWidget,SIGNAL( pinchGestureReceived(int) ), mCoverFlow, SLOT( zoomStarted(int) ) );
   647 		connect( mZoomWidget, SIGNAL( pinchGestureReceived( int ) ), mCoverFlow, SLOT( zoomStarted( int ) ) );
   641 		connect(mZoomWidget,SIGNAL( zoomWidgetMovedBackground(int) ), mCoverFlow, SLOT( zoomFinished(int) ) );
   648 		connect( mZoomWidget, SIGNAL( zoomWidgetMovedBackground( int ) ), mCoverFlow, SLOT( zoomFinished( int ) ) );
   642         connect(mCoverFlow,SIGNAL( doubleTapEventReceived(QPointF) ), mZoomWidget, SLOT( animateZoomIn(QPointF) ) );
   649         connect( mCoverFlow, SIGNAL( doubleTapEventReceived( QPointF ) ), mZoomWidget, SLOT( animateZoomIn( QPointF ) ) );
   643 	}
   650 	}
   644 
   651 
   645     connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation)));
   652     connect( mWindow, SIGNAL( orientationChanged( Qt::Orientation ) ), this, SLOT( orientationChanged( Qt::Orientation ) ) );
   646 
   653 
   647     OstTraceFunctionExit0( GLXFULLSCREENVIEW_ADDCONNECTION_EXIT );
   654     OstTraceFunctionExit0( GLXFULLSCREENVIEW_ADDCONNECTION_EXIT );
   648 }
   655 }
   649 
   656 
   650 void GlxFullScreenView::removeConnection()
   657 void GlxFullScreenView::removeConnection()
   748     HbEffect::start( mIconItems[ 0 ], QString( "HbGridViewItem" ), QString( "SelectHide" ) );
   755     HbEffect::start( mIconItems[ 0 ], QString( "HbGridViewItem" ), QString( "SelectHide" ) );
   749     HbEffect::start( mIconItems[ 1 ], QString( "HbGridViewItem" ), QString( "SelectShow" ), this, "imageSelectionEffectFinished" );
   756     HbEffect::start( mIconItems[ 1 ], QString( "HbGridViewItem" ), QString( "SelectShow" ), this, "imageSelectionEffectFinished" );
   750 
   757 
   751     OstTraceFunctionExit0( GLXFULLSCREENVIEW_IMAGESELECTIONANIMATION_EXIT );
   758     OstTraceFunctionExit0( GLXFULLSCREENVIEW_IMAGESELECTIONANIMATION_EXIT );
   752 }
   759 }
       
   760 
       
   761 void GlxFullScreenView::cancelSelectionAnimation()
       
   762 {
       
   763     if ( mIconItems[0] && HbEffect::effectRunning( mIconItems[1], QString( "SelectShow" ) ) ) {
       
   764         HbEffect::cancel( mIconItems[0], QString( "SelectHide" ), false, false, true );
       
   765         HbEffect::cancel( mIconItems[1], QString( "SelectShow" ), false, true, true );
       
   766     }
       
   767 }
   753 	
   768 	
   754 void GlxFullScreenView::handleToolBarAction()
   769 void GlxFullScreenView::handleToolBarAction()
   755 {
   770 {
   756     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_HANDLETOOLBARACTION_ENTRY );
   771     OstTraceFunctionEntry0( GLXFULLSCREENVIEW_HANDLETOOLBARACTION_ENTRY );
   757     
   772