uifw/AvKon/src/AknSettingPage.cpp
branchRCL_3
changeset 56 d48ab3b357f1
parent 55 aecbbf00d063
child 72 a5e7a4f63858
--- a/uifw/AvKon/src/AknSettingPage.cpp	Tue Aug 31 15:28:30 2010 +0300
+++ b/uifw/AvKon/src/AknSettingPage.cpp	Wed Sep 01 12:16:19 2010 +0100
@@ -45,9 +45,21 @@
 //For MCoeCaptionRetrieverForFep
 #include <fepbase.h>
 #include <AknPopupFader.h>
+#include <gfxtranseffect/gfxtranseffect.h>
+#include <akntransitionutils.h>
+#include <touchfeedback.h>
+#include <akntranseffect.h>
 #include "aknitemactionmenuregister.h"
 #include "aknqueryeditorindicator.h"
 
+
+
+//
+// the function's definition is in the AknNoteDialog.cpp
+//
+TBool IsFocusedWindowGroup( const CCoeControl* aControl );
+
+
 // This determines the maximum number of digits in the optional number displayed on the
 // top left of the setting page
 const TInt KAknSettingPageMaxOrdinalDigits = 3;
@@ -568,9 +580,19 @@
 EXPORT_C CAknSettingPage::~CAknSettingPage()
 	{
 	AKNTASHOOK_REMOVE();
+
+    StopActiveScheduler();
+
+    // If navi pane context is not poped out yet, pop it now.
+	PopNaviDecoratorIfRequired();
+    if ( GfxTransEffect::IsRegistered( this ) )
+        {
+        GfxTransEffect::Deregister( this );
+        }
+
 	iEikonEnv->EikAppUi()->RemoveFromStack(this);
 
-    AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( NULL );
+    TRAP_IGNORE(AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( NULL ));
     
 	if (iMenuBar)
 		{
@@ -585,12 +607,9 @@
 	delete iHintText;
 	delete iCba;
 	delete iExtension;
+    iExtension = NULL;
 
-    // If navi pane context is not poped out yet, pop it now.
-	PopNaviDecoratorIfRequired();
 	delete iNaviDecorator;
-
-	StopActiveScheduler();
 	}
 
 void CAknSettingPage::StopActiveScheduler()
@@ -770,9 +789,6 @@
 	{
 	CreateWindowL();
 
-	SetGloballyCapturing( ETrue );
-    SetPointerCapture(ETrue);
-
     if( NULL == iExtension )
         {
         iExtension = CAknSettingPageExtension::NewL( this );
@@ -886,6 +902,12 @@
 	        }
 	    }
 	
+	if(iExtension->iEmbeddedSoftkeys)
+		{
+		SetGloballyCapturing( ETrue );
+    	SetPointerCapture(ETrue);	
+		}
+
     AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( this );
 
 	if ( !iExtension->iEmbeddedSoftkeys )
@@ -899,15 +921,16 @@
         iCba = CEikButtonGroupContainer::NewL( CEikButtonGroupContainer::ECba,
             CEikButtonGroupContainer::EHorizontal, 
             this, resourceId, *this, CEikButtonGroupContainer::EIsEmbedded | 
-            CEikButtonGroupContainer::EAddToStack );
+            CEikButtonGroupContainer::EAddToStack | 
+            CEikButtonGroupContainer::EAlwaysShown );
 	    }
 	
 	iExtension->CreateBackgroundContextL();
 
-    if ( iExtension->iEmbeddedSoftkeys && 
-            CAknEnv::Static()->TransparencyEnabled() )
+    if ( iExtension->iEmbeddedSoftkeys )
         {
         EnableWindowTransparency();
+        GfxTransEffect::Register( this, KGfxPopupDefaultControlUid );
         }
 
 	// Make the menu bar
@@ -915,7 +938,6 @@
 	iMenuBar->ConstructL( this, NULL, iMenuBarId ) ;
 	iEikonEnv->EikAppUi()->AddToStackL(iMenuBar,ECoeStackPriorityMenu,ECoeStackFlagRefusesFocus);
 	
-
 	iTextLabel = new(ELeave) CEikLabel( );
     iTextLabel->UseLogicalToVisualConversion(ETrue);
 	iTextLabel->SetContainerWindowL(*this);
@@ -1378,8 +1400,26 @@
  */
 EXPORT_C void CAknSettingPage::DismissL(TBool aAccept)
 	{
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        MTouchFeedback* feedback = MTouchFeedback::Instance();
+        if ( feedback )
+            {
+            TTouchLogicalFeedback fbLogicalType = ETouchFeedbackPopUp;
+            if ( CAknTransitionUtils::TransitionsEnabled(
+                    AknTransEffect::EComponentTransitionsOff ) )
+                {
+                fbLogicalType = ETouchFeedbackDecreasingPopUp;
+                }
+            feedback->InstantFeedback(
+                                   this,
+                                   fbLogicalType,
+                                   ETouchFeedbackVibra,
+                                   TPointerEvent() );
+            }
+        }
+    
     AknItemActionMenuRegister::SetOverridingMenuBarOwnerL( NULL );
-    MakeVisible( EFalse );
 
 	if ( aAccept )
 		{
@@ -1393,6 +1433,17 @@
 		if ( iSettingPageObserver )
 			iSettingPageObserver->HandleSettingPageEventL(this, MAknSettingPageObserver::EEventSettingCancelled);
 		}
+	
+	if ( GfxTransEffect::IsRegistered( this ) && IsFocusedWindowGroup( this ) && IsVisible() )
+	    {
+        GfxTransEffect::Begin( this, KGfxControlDisappearAction );
+        MakeVisible( EFalse );
+        GfxTransEffect::End( this );
+	    }
+	else
+	    {
+        MakeVisible( EFalse );
+	    }
 
 	iEikonEnv->RemoveFromStack(iCba);
 	delete iCba;
@@ -1633,6 +1684,30 @@
 // Ensure we have a menu bar by this point
 	__ASSERT_DEBUG( iMenuBar, Panic( EAknPanicSettingPageNoMenuBar ) ) ;
 
+    if ( AknLayoutUtils::PenEnabled() )
+        {
+        MTouchFeedback* feedback = MTouchFeedback::Instance();
+        if ( feedback )
+            {
+            TTouchLogicalFeedback fbLogicalType = ETouchFeedbackPopUp;
+            if ( CAknTransitionUtils::TransitionsEnabled(
+                    AknTransEffect::EComponentTransitionsOff ) )
+                {
+                fbLogicalType = ETouchFeedbackIncreasingPopUp;
+                }
+            feedback->InstantFeedback(
+                                   this,
+                                   fbLogicalType,
+                                   ETouchFeedbackVibra,
+                                   TPointerEvent() );
+            }
+        }
+    
+	//
+  	// Set editor control to be invisible
+  	//
+	iEditorControl->MakeVisible( EFalse );
+
 	DynamicInitL();
 	ActivateL();
 
@@ -1640,10 +1715,25 @@
 	    {
 	    iExtension->iFader.FadeBehindPopup( iExtension, this, ETrue );
 	    }
-	
-	// Catch up with editor's brute draw (in editor setting page)
-	DrawNow();   //  EECO-7QYCR4 and TSAA-7Q3D2J is conflict , so make an extra draw operation here
-    DrawDeferred();
+
+    if ( GfxTransEffect::IsRegistered( this ) )
+        {
+        GfxTransEffect::Begin( this, KGfxControlAppearAction );
+
+        TRect demarcation;
+        CAknTransitionUtils::GetDemarcation( CAknTransitionUtils::EPopup, 
+                demarcation );
+        GfxTransEffect::SetDemarcation( this, demarcation );
+
+		iEditorControl->MakeVisible( ETrue );
+        MakeVisible( ETrue );
+        GfxTransEffect::End( this );
+        }
+    else
+        {
+        iEditorControl->MakeVisible( ETrue );
+        MakeVisible( ETrue );
+        }
 
 	iEditorControl->SetObserver( this );
 	iEikonEnv->EikAppUi()->AddToStackL(this,ECoeStackPriorityDialog);
@@ -1703,7 +1793,9 @@
 		StartActiveScheduler();
 		}
 	else
-		AttemptExitL(EFalse);
+		{
+        AttemptExitL(EFalse);	
+        }
 	
 	iEikonEnv->EikAppUi()->RemoveFromStack(this);
 	CleanupStack::Pop(); // this
@@ -2058,6 +2150,10 @@
         {
         return SupplyMopObject( aId, iExtension->iEditIndicator );
         }
+    else if( aId.iUid == MAknsControlContext::ETypeId)
+        {
+        return MAknsControlContext::SupplyMopObject(aId, iExtension->iSettingPageBgContext);
+        } 
 
     return SupplyMopObject( aId, iCba, iMenuBar );
 	}
@@ -2121,7 +2217,7 @@
 
 void CAknSettingPage::PopNaviDecoratorIfRequired()
     {
-    if ( iNaviPane && !iExtension->iEmbeddedSoftkeys )
+    if ( iNaviPane && iExtension && !iExtension->iEmbeddedSoftkeys )
         {
         iNaviPane->Pop( iNaviDecorator ); // iNaviDecorator is not to be detroyed yet