uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h
branchRCL_3
changeset 10 88b23e2e82e1
parent 8 10534483575f
child 22 7c5dd702d6d3
--- a/uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h	Mon Mar 15 12:43:37 2010 +0200
+++ b/uiacceltk/hitchcock/ServerCore/Inc/alfeffectutils.h	Wed Mar 31 23:03:58 2010 +0300
@@ -31,7 +31,7 @@
         virtual ~CAlfRosterFreezeEndTimer();
 
     public: // New functions
-        void Start( TTimeIntervalMicroSeconds32 aPeriod );
+        void Start( TTimeIntervalMicroSeconds32 aPeriod, TCallBack aCallBack  );
         
     protected:  // Functions from base classes
         void DoCancel();
@@ -45,7 +45,7 @@
         CAlfBridge& iBridge;
  	public:
 	   	TInt iSafeCounter;
-                
+        TCallBack iCallBack;        
     };
 
 
@@ -84,6 +84,25 @@
 //
 NONSHARABLE_CLASS( CAlfLayoutSwitchEffectCoordinator ) : public CBase, public MAlfGfxEffectObserver
     {
+    public:
+        enum TEvent
+            {
+            EEventLayoutSwitch,
+            EEventBlankOn,
+            EEventBlankOff,
+            EEventLowMemory
+            };
+    
+        enum TState
+            {
+            EStateIdle,
+            EStateFreezeFx,
+            EStateBlankFx,
+            EStateThemeFx
+            };
+
+        typedef TState (*TStateFunction)(TEvent aEvent);
+
     public:  // Constructors and destructor
         CAlfLayoutSwitchEffectCoordinator( CAlfBridge& aBridge );
         virtual ~CAlfLayoutSwitchEffectCoordinator();
@@ -92,9 +111,25 @@
         void AlfGfxEffectEndCallBack( TInt aHandle );
     
     public:
+        void Blank(TBool aEnabled);
+        void LowMemoryEvent();
         void BeginLayoutSwitch();
-        void Cancel();
-        TBool LayoutSwitchEffectsExist();
+        
+        void Event(TEvent aEvent);
+        void Transition(TState aNewState, TState aPreviousState);
+
+    private:
+        TState NextIdleState(TEvent aEvent);
+        TState NextFreezeState(TEvent aEvent);
+        TState NextBlankState(TEvent aEvent);
+        TState NextThemeState(TEvent aEvent);
+
+        void FreezeFinished();
+
+    public:            
+        TBool IsThemeEffectEnabled() const;
+        TBool LayoutSwitchEffectsExist() const;
+
 		void EnableSafeCounter(TBool aEnable)
 			{
 			if (iRosterFreezeEndTimer)
@@ -109,16 +144,25 @@
 					}
 				}
 			}        
+    
     private:
         AknTransEffect::TContext NextLayoutSwitchContext();
         void SetLayoutSwitchEffect(AknTransEffect::TContext aContext);
         
+        void FreezeRoster(TBool aFrozen);
+        
+        static TInt DoFreezeFinished(TAny* aAny);
+        
     private: // Data
         
         CAlfBridge& iBridge;
         AknTransEffect::TContext iLayoutSwitchEffectContext;
         TThreadPriority iOriginalPriority;
         CAlfRosterFreezeEndTimer* iRosterFreezeEndTimer;
+        TBool iBlankEnabled;
+        
+        TState iCurrentState;
+        TBool iLayoutSwitchNotCompleted;
 	};
 
 // ---------------------------------------------------------
@@ -175,10 +219,6 @@
         
         void ConstructL(TInt aAction, RMemReadStream& aStream);
         
-        TBool InitDelayedEffectL(CAlfBridge* aBridge, TSize aDisplaySize);
-        
-        void NotifyDrawingTimeout();
-
         // Information from BeginFullScreen
         TInt iType;
         TInt iToWg;