uifw/AvKon/inc/transitionmanager.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __TRANSITIONMANAGER_H__
       
    21 #define __TRANSITIONMANAGER_H__
       
    22 
       
    23 #include<eikenv.h>
       
    24 #include<akntranseffect.h>
       
    25 #include <coeview.h>
       
    26 
       
    27 class CCenRepListen;
       
    28 
       
    29 
       
    30 const TInt KAknTransitionEventAvkon = 999;
       
    31 const TInt KAknTransitionEventFlags = 998;
       
    32 const TInt KAknTransitionDeactivate = 997;
       
    33 const TInt KAknTransitionExitCancel = 996;
       
    34 
       
    35 NONSHARABLE_CLASS(MKeyValue)
       
    36 	{
       
    37 	public:
       
    38 		virtual TUint32 Key() const = 0;
       
    39 		virtual TInt Value() const = 0;
       
    40 	};
       
    41 	
       
    42 NONSHARABLE_CLASS(MKeyListener)
       
    43 	{
       
    44 	public:
       
    45 		 virtual void KeyChangedL(const MKeyValue& aKeyValue) = 0;
       
    46 	};
       
    47 	
       
    48 NONSHARABLE_CLASS(MExit)
       
    49 	{
       
    50 	public:
       
    51 		virtual void DoExit() = 0;
       
    52 	};
       
    53 	
       
    54 NONSHARABLE_CLASS(CTransitionManager) : public CBase, public MKeyListener, public MExit,
       
    55                                         public MCoeViewObserver
       
    56 	{
       
    57 	public:
       
    58         static CTransitionManager* NewL(CEikonEnv& aEnv);
       
    59 		~CTransitionManager();
       
    60 		void SetAvkon();
       
    61 		void CheckFlags();
       
    62 		void AppStartup(TInt aContext, const TUid& aUid);
       
    63 		void AppSwitch(TInt aContext); 
       
    64 		void AppExit(TInt aContext, const TUid& aUid);
       
    65 		void AppStartupComplete();
       
    66 		void SetEmbedded(); 
       
    67 		void CancelExit();
       
    68 	private:
       
    69  	    static TBool AppStartupCb(TAny* aEnv);
       
    70     	TBool CheckPropertyKeys() const;
       
    71     	void Startup();
       
    72 		CTransitionManager(CEikonEnv& aEnv);
       
    73 		void ConstructL();
       
    74 		TBool Ready();
       
    75 		void KeyChangedL(const MKeyValue& aKeyValue);
       
    76 		void CheckEffectsL(TBool aWait);
       
    77 		void SetDisableEffects(TBool aDisable); 
       
    78 		TBool IsFullScreen() const;
       
    79 		void SendAvkonInfo();
       
    80 		void GetRootAppL(TUid& aRootAppUid);
       
    81 		void DoExit();
       
    82 
       
    83         // Implementation of void MCoeViewObserver
       
    84         void HandleViewEventL( const TVwsViewEvent& aEvent );
       
    85     private:
       
    86     	CEikonEnv& iEikEnv;
       
    87     	CIdle* iAppStartupIdle;
       
    88     	enum
       
    89     		{
       
    90     		EStarted 			= 0x1,
       
    91     		EEmbedded 			= 0x2,
       
    92     		ENoEndKeyClose 		= 0x4,
       
    93     		EEnviromentReady 	= 0x8,
       
    94     		EExitCompleted   	= 0x10,
       
    95     		EStartupComplete 	= 0x20,
       
    96     		EStartupStarted		= 0x40,
       
    97     		EffectsEnabled		= 0x80,
       
    98     		EAvkonApp			= 0x100,
       
    99     		};
       
   100 
       
   101         enum TTransEffectState
       
   102             {
       
   103             ETransEffectIdle,
       
   104             ETransEffectWaitingForAppSwitch,
       
   105             ETransEffectWaitingForViewSwitch,
       
   106             ETransEffectWaitingForIdleCall
       
   107             };
       
   108 
       
   109     	TInt iFlags;
       
   110     	TUid iAppUid;
       
   111         TTransEffectState iStartIdleState;
       
   112     	CCenRepListen* iCRListen;
       
   113 	};
       
   114 	
       
   115 #endif