uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/alfserverdrawer.h
changeset 0 15bf7259bb7c
child 6 10534483575f
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2008-2008 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:   window server plugin, used by transition server to control
       
    15 *                framebuffers.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __ALFSERVERDRAWER_H__
       
    22 #define __ALFSERVERDRAWER_H__
       
    23 
       
    24 #include <e32std.h>
       
    25 #include <w32std.h>
       
    26 #include <e32property.h>
       
    27 
       
    28 #include "alfdrawerengine.h"
       
    29 
       
    30 class CWsServerDrawerController;
       
    31 class CIdle;
       
    32 class RWsSession;
       
    33 class CAlfWindowManager;
       
    34 class CAlfWindow;
       
    35 class CPolicyHandler;
       
    36 class CAlfFinishTimer;
       
    37 class CPSObserver;
       
    38 
       
    39 /**
       
    40  *  crp used by the server to control framebuffers, and used as proxy for
       
    41  *  fullscreen messages.
       
    42  *
       
    43  *  @since S60 3.2
       
    44  */
       
    45  NONSHARABLE_CLASS(CAlfServerDrawer): public CBase, public MAlfDrawerEngine 
       
    46 	{
       
    47 public:
       
    48 
       
    49 	static CAlfServerDrawer* NewL( CAlfWindowManager* aWindowManager,
       
    50 	    CPolicyHandler& aPolicyHandler );
       
    51 
       
    52     enum TScreenModeChangedStates
       
    53         {
       
    54         EScreenModeChangedIdle,
       
    55         EScreenModeBeginHasBeenCalled,
       
    56         EScreenModeChangedWaitingForScreenUpdated
       
    57         };
       
    58 
       
    59     ~CAlfServerDrawer();
       
    60 
       
    61 	TInt BeginControlTransition( TUint aAction, TUid aControlUid,
       
    62 	    TInt aWindowGroup, TInt aWindowHandle );
       
    63 	void EndControlTransition( TInt aHandle );
       
    64 	void UnredirectEvent( TInt aHandle );
       
    65 
       
    66     void PrepareFullscreen();
       
    67     // parameters are analyzed by CAlfGfxEffects
       
    68     
       
    69     void BeginFullscreen( TInt aAction, const TRect& aEffectRect, 
       
    70 						TInt aType, const TUid aUid1, const TUid aUid2, TInt aData );
       
    71     void EndFullscreen();
       
    72     void CancelFullscreen();
       
    73     void AbortFullscreen();
       
    74     void RegisterAlfFullScreenEffect( TInt aAction, const TDesC& aResourceDir,
       
    75             const TDesC& aFileName);
       
    76     void UnregisterAlfFullScreenEffect( TInt aAction );
       
    77     void UnregisterAllAlfFullScreenEffect();
       
    78     void BeginSyncronizedGroup(TInt aGroupId);
       
    79     void EndSyncronizedGroup(TInt aGroupId, TBool aForced = EFalse);
       
    80     
       
    81     /**
       
    82     * From MAlfDrawerEngine
       
    83     */
       
    84 	
       
    85 	TUid& FromUid();
       
    86 	TUid& ToUid();
       
    87 	TUint& Action();
       
    88 	TInt& Flags();
       
    89 
       
    90 	void IncreaseHandle();
       
    91 	TInt CurrentHandle();
       
    92 	
       
    93 	void StartEndChecker();
       
    94 	void CancelEndChecker();
       
    95 
       
    96 	TInt SendBeginFullscreen(TInt aHandle, TUint aAction, const TUid& aUid, 
       
    97 							 const TUid& aPreviousUid, const TRect& aEffectRect);
       
    98 	TInt SendEndFullscreen();
       
    99 	TInt SendAbortFullscreen();
       
   100 	TInt SendAbortControlTransition();
       
   101 	void SendBeginFullscreen();
       
   102     void DoSendBeginFullscreenL();
       
   103 	TInt SendBeginControlTransition();
       
   104 	TInt SendFinishControlTransition();
       
   105 	
       
   106     TBool EffectFinishedFullScreen() const;
       
   107     
       
   108 	static TInt FailedFullscreen(TAny* aArg);
       
   109 
       
   110     TBool ScreenModeChanged() const;
       
   111     
       
   112     
       
   113 private:
       
   114 	CAlfServerDrawer( CAlfWindowManager* aWindowManager, CPolicyHandler& aPolicyHandler );
       
   115 	void ConstructL();
       
   116 	static TInt AsyncConstruct(TAny* aThis);
       
   117 
       
   118 	TAny* ResolveObjectInterface(TUint aTypeId);
       
   119 	
       
   120 private:
       
   121     static TInt ScreenModeChangedTimeoutL( TAny* aServerDrawer );
       
   122     void HandleScreenModeChangedTimeoutL();
       
   123     
       
   124     static TInt FullScreenTimeout( TAny* aServerDrawer );
       
   125     void HandleFullScreenTimeout();
       
   126     
       
   127     static TInt FinishFullScreenTimeout( TAny* aServerDrawer );
       
   128     void HandleFinishFullScreenTimeout();
       
   129 
       
   130     static TInt ControlTimeout( TAny* aServerDrawer );
       
   131     void HandleControlTimeout();
       
   132     
       
   133     static TInt TransitionFinished( TAny* aServerDrawer );
       
   134     void HandleTransitionFinished(); 
       
   135     
       
   136     TBool FileExistsL( TPtrC& aResourceDir, TPtrC& aFileName );
       
   137         
       
   138 private: // data
       
   139 
       
   140 public:
       
   141 	CWsServerDrawerController* iController;
       
   142 	CAlfWindowManager* iWindowManager;
       
   143     CPolicyHandler& iPolicyHandler;
       
   144 	TBool iInScreenModeChange;
       
   145 
       
   146     CIdle* iIdle; //CIdle for async function calls.
       
   147 
       
   148     TInt iCurrHandle;
       
   149 
       
   150     TUint iAction;
       
   151     TUint iOldAction;
       
   152     TInt iFlags;
       
   153     TRect iEffectRect;
       
   154     TRect iControlRect; // demarcation rectangle for control effects
       
   155     TUid iFromUid;
       
   156     TUid iToUid;
       
   157     
       
   158     TInt iFromWg;
       
   159     TInt iToWg;
       
   160     TBool iWaitingForRootWgId;
       
   161     TInt iFromScreen;
       
   162     TInt iToScreen;
       
   163     
       
   164     TUid iParentUid;
       
   165     TInt iFocusWg;
       
   166     
       
   167     // Component transition data
       
   168     TUint iControlAction;
       
   169     TUid iControlUid;
       
   170     TInt iControlWindowGroup;
       
   171     TInt iControlHandle;
       
   172     
       
   173     TInt iType; // parameter type for GFX parameters
       
   174     TScreenModeChangedStates iScrModeChangedState;
       
   175     CAlfFinishTimer* iFullScreenTimeout;
       
   176     CAlfFinishTimer* iFinishFullScreen;
       
   177     
       
   178     // This variable tells if the full screen transition was finished
       
   179     // by a signal from Effect Engine (via AlfBridge)
       
   180     // or if timeout finished the transaction.
       
   181     TBool iFullScreenFinished;
       
   182 
       
   183     // This is an array of reserverd windows
       
   184     // We do not own these pointers, and must not delete them.
       
   185     RPointerArray<CAlfWindow> iReservedWindows;
       
   186     
       
   187     CPSObserver* iTransitionEndObserver;
       
   188     RProperty iProperty;
       
   189     
       
   190     TBool iDoNotClearEffectRect;
       
   191     
       
   192     RFs iFs;
       
   193     TBool iFullScreenFxSent;
       
   194     TBool iFullScreenEndSent;
       
   195     };
       
   196 
       
   197 
       
   198 #endif //__ALFSERVERDRAWER_H__