photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp
branchRCL_3
changeset 18 bcb43dc84c44
parent 14 ce1c7ad1f18b
child 22 2dac0fdba72b
--- a/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp	Mon Mar 15 12:40:30 2010 +0200
+++ b/photosgallery/viewframework/views/cloudview/src/glxcloudviewimp.cpp	Wed Mar 31 21:31:03 2010 +0300
@@ -44,6 +44,11 @@
 #include <glxtagsbrowserview.rsg>               // For resources
 
 #include "glxcloudviewcontrol.h"//cloud view control
+
+// For transition effects
+#include <AknTransEffect.h>                             
+#include <GfxTransEffect/GfxTransEffect.h>
+#include "glxgfxtranseffect.h"  // For transition effects
     
 const TInt KViewId = 0x200071B7;
 
@@ -103,12 +108,7 @@
 
 	{
 	TRACER("GLX_CLOUD::CGlxCloudViewImp::ConstructL");
-	TInt err = iHarvesterClient.Connect();
-    GLX_LOG_INFO1("iHarvesterClient.Connect() err = %d",err);
-    if(err == KErrNone)
-        {
-        iHarvesterClient.AddHarvesterEventObserver(*this, EHEObserverTypeMMC, 1000);
-        }
+	
 	TFileName resourceFile(KDC_APP_RESOURCE_DIR);
 	resourceFile.Append (aFileName);
 	CGlxResourceUtilities::GetResourceFilenameL (resourceFile);
@@ -128,7 +128,6 @@
         {
         toolbar->DisableToolbarL(ETrue);  
         }
-//	SetSoftkeysFromResourceIdL (iSoftkeyMskDisabledId); //initially load empty msk
 	}
 
 // ---------------------------------------------------------------------------
@@ -138,7 +137,10 @@
 CGlxCloudViewImp::~CGlxCloudViewImp()
     {
     TRACER("GLX_CLOUD::CGlxCloudViewImp::~CGlxCloudViewImp");
-    iHarvesterClient.Close();
+    
+    delete iMMCNotifier;
+    iMMCNotifier = NULL;
+        
     CleanupVisuals ();
     delete iEmptyListText;
     if ( iResourceOffset )
@@ -199,12 +201,25 @@
 		TUid /* aCustomMessageId */, const TDesC8 & /* aCustomMessage */)
     {
     TRACER("GLX_CLOUD::CGlxCloudViewImp::DoMLViewActivateL");
+        
+    TUint transitionID = (iUiUtility->ViewNavigationDirection()==
+          EGlxNavigationForwards)?KActivateTransitionId:KDeActivateTransitionId; 
+    
+    GfxTransEffect::BeginFullScreen( transitionID, TRect(),
+            AknTransEffect::EParameterType, 
+            AknTransEffect::GfxTransParam( KPhotosUid,
+            AknTransEffect::TParameter::EEnableEffects) );   
+
+    
     if(StatusPane())
         {
         StatusPane()->MakeVisible(ETrue);
         }
     ConstructCloudControlL();
     GLX_LOG_INFO("CGlxCloudViewImp::DoMLViewActivateL Cloud View Control Created" );  
+    
+    GfxTransEffect::EndFullScreen();
+	
     // set app state to tag-browser view
     GlxSetAppState::SetState (EGlxInTagBrowserView);
     }
@@ -235,7 +250,6 @@
     TRACER("GLX_CLOUD ::CGlxCloudViewImp::HandleMskChangedL");
     GLX_LOG_INFO1("GLX_CLOUD ::GLX_CLOUD ::CGlxCloudViewImp::HandleMskChangedL MSk State  %d ",
         aMskEnabled);
-    //iViewWidget->setRect( ClientRect() );
 	 }
 
 // ---------------------------------------------------------------------------
@@ -277,14 +291,10 @@
         }
     if( iUiUtility )
         {
-
 		IAlfWidgetFactory& widgetFactory = AlfWidgetEnvExtension::widgetFactory(*(iUiUtility->Env ())); 
         widgetFactory.destroyWidget(iViewWidget);
-    
         }
     iViewWidget = NULL; 
-    // delete iCloudControl;
-    //  iCloudControl = NULL;  
     iScrollbarDefaultBaseElement = NULL;
     }
 
@@ -358,6 +368,8 @@
     
      //acquire the focus so as to get events to your control instead of widgets
     iCloudControl->AcquireFocus();
+    
+    iMMCNotifier = CGlxMMCNotifier::NewL(*this);
     }
 // ---------------------------------------------------------------------------
 // SetScrollBarRect()
@@ -430,19 +442,39 @@
         iCloudControl->ShowContextItemMenu(EFalse);
         }
     }
+
 // ---------------------------------------------------------------------------
-// HarvestingUpdated
+// HandleMMCInsertionL
 // 
 // ---------------------------------------------------------------------------
+void CGlxCloudViewImp::HandleMMCInsertionL()
+    {
+    TRACER("CGlxCloudViewImp::HandleMMCInsertionL()");
+    iMMCState = ETrue;
+    ProcessCommandL(EAknSoftkeyClose);
+    }
+
+// ---------------------------------------------------------------------------
+// HandleMMCRemovalL
+// 
+// ---------------------------------------------------------------------------
+void CGlxCloudViewImp::HandleMMCRemovalL()
+    {
+    TRACER("CGlxCloudViewImp::HandleMMCRemovalL()");
+    ProcessCommandL(EAknSoftkeyExit);
+    }
+
+// ---------------------------------------------------------------------------
+// Foreground event handling function.
+// ---------------------------------------------------------------------------
 //
-void CGlxCloudViewImp::HarvestingUpdated( 
-                HarvesterEventObserverType HarvestingUpdated, 
-                HarvesterEventState /*aHarvesterEventState*/,
-                TInt /*aItemsLeft*/ )
+void CGlxCloudViewImp::HandleForegroundEventL(TBool aForeground)
     {
-    TRACER("CGlxCloudViewImp::HarvestingUpdated()");
-    if(HarvestingUpdated == EHEObserverTypeMMC)
+    TRACER("CGlxCloudViewImp::HandleForegroundEventL");
+    CAknView::HandleForegroundEventL(aForeground);
+    if(iMMCState)
         {
+        iMMCState = EFalse;
         ProcessCommandL(EAknSoftkeyClose);
         }
     }