photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 18 78ad99c24f08
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
    49 
    49 
    50 // For transition effects
    50 // For transition effects
    51 #include <akntranseffect.h>                             
    51 #include <akntranseffect.h>                             
    52 #include <gfxtranseffect/gfxtranseffect.h>
    52 #include <gfxtranseffect/gfxtranseffect.h>
    53 #include "glxgfxtranseffect.h"  // For transition effects
    53 #include "glxgfxtranseffect.h"  // For transition effects
    54     
    54 #include <akntransitionutils.h> //For CAknTransitionUtils
       
    55 
    55 const TInt KViewId = 0x200071B7;
    56 const TInt KViewId = 0x200071B7;
       
    57 
       
    58 //Transition animation used for Cloud view activation
       
    59 _LIT( KTfxResourceActivate , "z:\\resource\\effects\\photos_gridview_appear.fxml");
       
    60 _LIT( KTfxResourceNoEffect, "");
    56 
    61 
    57 using namespace Alf;
    62 using namespace Alf;
    58 // ======== MEMBER FUNCTIONS ========
    63 // ======== MEMBER FUNCTIONS ========
    59 
    64 
    60 // ---------------------------------------------------------------------------
    65 // ---------------------------------------------------------------------------
   137 // ---------------------------------------------------------------------------
   142 // ---------------------------------------------------------------------------
   138 //
   143 //
   139 CGlxCloudViewImp::~CGlxCloudViewImp()
   144 CGlxCloudViewImp::~CGlxCloudViewImp()
   140     {
   145     {
   141     TRACER("GLX_CLOUD::CGlxCloudViewImp::~CGlxCloudViewImp");
   146     TRACER("GLX_CLOUD::CGlxCloudViewImp::~CGlxCloudViewImp");
   142         
   147     if(iAlfEffectObs)
       
   148 		{
       
   149 		delete iAlfEffectObs;
       
   150 		}  
       
   151     
   143     CleanupVisuals ();
   152     CleanupVisuals ();
   144     delete iEmptyListText;
   153     delete iEmptyListText;
   145     if ( iResourceOffset )
   154     if ( iResourceOffset )
   146         {
   155         {
   147         CCoeEnv::Static()->DeleteResourceFile (iResourceOffset);
   156         CCoeEnv::Static()->DeleteResourceFile (iResourceOffset);
   210 void CGlxCloudViewImp::DoMLViewActivateL(const TVwsViewId & /* aPrevViewId */,
   219 void CGlxCloudViewImp::DoMLViewActivateL(const TVwsViewId & /* aPrevViewId */,
   211 		TUid /* aCustomMessageId */, const TDesC8 & /* aCustomMessage */)
   220 		TUid /* aCustomMessageId */, const TDesC8 & /* aCustomMessage */)
   212     {
   221     {
   213     TRACER("GLX_CLOUD::CGlxCloudViewImp::DoMLViewActivateL");
   222     TRACER("GLX_CLOUD::CGlxCloudViewImp::DoMLViewActivateL");
   214         
   223         
   215     TUint transitionID = (iUiUtility->ViewNavigationDirection()==
       
   216           EGlxNavigationForwards)?KActivateTransitionId:KDeActivateTransitionId; 
       
   217     
       
   218     GfxTransEffect::BeginFullScreen( transitionID, TRect(),
       
   219             AknTransEffect::EParameterType, 
       
   220             AknTransEffect::GfxTransParam( KPhotosUid,
       
   221             AknTransEffect::TParameter::EEnableEffects) );   
       
   222 
       
   223     
       
   224     if(StatusPane())
   224     if(StatusPane())
   225         {
   225         {
   226         StatusPane()->MakeVisible(ETrue);
   226         StatusPane()->MakeVisible(ETrue);
   227         }
   227         }
       
   228     
   228     ConstructCloudControlL();
   229     ConstructCloudControlL();
   229     GLX_LOG_INFO("CGlxCloudViewImp::DoMLViewActivateL Cloud View Control Created" );  
   230     GLX_LOG_INFO("CGlxCloudViewImp::DoMLViewActivateL Cloud View Control Created" );  
   230     
   231     
   231     GfxTransEffect::EndFullScreen();
       
   232 	
       
   233     // set app state to tag-browser view
   232     // set app state to tag-browser view
   234     GlxSetAppState::SetState (EGlxInTagBrowserView);
   233     GlxSetAppState::SetState (EGlxInTagBrowserView);
   235     iMMCNotifier = CGlxMMCNotifier::NewL(*this);
   234     iMMCNotifier = CGlxMMCNotifier::NewL(*this);
       
   235     
       
   236     //Set the ALF animation effect to CAlfAnchorLayout since the animation
       
   237     //does not work for both avkon and alf together.
       
   238     //Check if the transitions are enabled from themes
       
   239     if (CAknTransitionUtils::TransitionsEnabled( AknTransEffect::EFullScreenTransitionsOff ))
       
   240 		{
       
   241 		if(!iAlfEffectObs)
       
   242 			{
       
   243 			iAlfEffectObs = CAlfEffectObserver::NewL();
       
   244 			}
       
   245 		
       
   246 		iAnchorlayout->SetEffectL( KTfxResourceActivate );
       
   247 		iEffectHandle = iAnchorlayout->Identifier();
       
   248 		iAlfEffectObs->SubscribeCallbackL(this,iEffectHandle);
       
   249 		}
       
   250 
   236     }
   251     }
   237 
   252 
   238 // ---------------------------------------------------------------------------
   253 // ---------------------------------------------------------------------------
   239 // From CAknView
   254 // From CAknView
   240 // View deactivation function.
   255 // View deactivation function.
   332 	const char* KVerScrollbarWidgetName("alfscrollbarwidget_ver");
   347 	const char* KVerScrollbarWidgetName("alfscrollbarwidget_ver");
   333 	const char* KScrollBarModel(/*"mulmodel"*/"scrollbarmodel");
   348 	const char* KScrollBarModel(/*"mulmodel"*/"scrollbarmodel");
   334 
   349 
   335 	IAlfWidgetFactory& widgetFactory = AlfWidgetEnvExtension::widgetFactory(*(iUiUtility->Env ())); 
   350 	IAlfWidgetFactory& widgetFactory = AlfWidgetEnvExtension::widgetFactory(*(iUiUtility->Env ())); 
   336 
   351 
   337     iViewWidget = widgetFactory.createViewWidget("viewwidget", 0,0,iDisplay);
   352     iViewWidget = widgetFactory.createViewWidget("viewwidget", 0, 0, iDisplay);
   338     
   353 	iViewWidget->setRect(ClientRect());
   339     iViewWidget->setRect( ClientRect() );
   354 	iViewWidget->show(true);
   340    iViewWidget->show(true); 
   355 
   341     
   356 	IAlfLayoutManager* layoutmanager = IAlfInterfaceBase::makeInterface<
   342     IAlfLayoutManager* layoutmanager = IAlfInterfaceBase::makeInterface<IAlfLayoutManager>(iViewWidget->control());
   357 			IAlfLayoutManager>(iViewWidget->control());
   343     iViewWidget->setRect(ClientRect());
   358 	iViewWidget->setRect(ClientRect());
   344    
   359    
   345     // parent layout handle for scrollbar
   360     // parent layout handle for scrollbar
   346     iScrollPaneHandle = AknLayoutScalable_UiAccel::aa_scroll_pane(0).LayoutLine();
   361     iScrollPaneHandle = AknLayoutScalable_UiAccel::aa_scroll_pane(0).LayoutLine();
   347 
   362 
   348     iAnchorlayout = &((CAlfAnchorLayout&)layoutmanager->getLayout());
   363     iAnchorlayout = &((CAlfAnchorLayout&)layoutmanager->getLayout());
   490         {
   505         {
   491         iMMCState = EFalse;
   506         iMMCState = EFalse;
   492         ProcessCommandL(EAknSoftkeyClose);
   507         ProcessCommandL(EAknSoftkeyClose);
   493         }
   508         }
   494     }
   509     }
       
   510 
       
   511 // ---------------------------------------------------------------------------
       
   512 // HandleEffectCallback
       
   513 // 
       
   514 // ---------------------------------------------------------------------------
       
   515 //
       
   516 void CGlxCloudViewImp::HandleEffectCallback(TInt aType, TInt aHandle, TInt /*aStatus*/)
       
   517     {
       
   518     TRACER("CGlxCloudViewImp::HandleEffectCallback()");
       
   519     if (aHandle == iEffectHandle && aType == EAlfEffectComplete
       
   520 			&& iAnchorlayout)
       
   521         {
       
   522         TRAP_IGNORE(iAnchorlayout->SetEffectL(KTfxResourceNoEffect));
       
   523         }
       
   524     }
       
   525