lafagnosticuifoundation/graphicseffects/ClientInc/TransitionParticipant.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef _TRANSITIONPARTICIPANT_H_
       
    17 #define _TRANSITIONPARTICIPANT_H_
       
    18 
       
    19 #include <coecntrl.h>
       
    20 
       
    21 #include "GfxTransDataType.h"
       
    22 #include "TransitionControl.h"
       
    23 #include <graphics/remotegc.h>
       
    24 
       
    25 
       
    26 class CTransitionControl;
       
    27 
       
    28 /**
       
    29 A participant in a transition.
       
    30 @internalTechnology
       
    31 */
       
    32 NONSHARABLE_CLASS(CTransitionParticipant) : public CBase,
       
    33 											public MCommandBufferObserver
       
    34 	{
       
    35 public:	
       
    36 	enum TCaptureState 
       
    37 		{
       
    38 		ENoCapture = 0x0,
       
    39 		EBeginCapture = 0x1,
       
    40 		EEndCapture = 0x2
       
    41 		};
       
    42 	enum TCaptureType
       
    43 		{
       
    44 		EDeep,
       
    45 		EShallow,
       
    46 		ERect
       
    47 		};
       
    48 	enum TCoordinateRef
       
    49 		{
       
    50 		EWindowOwning,
       
    51 		EScreen
       
    52 		};
       
    53 	static CTransitionParticipant* New(	const CCoeControl* aKey,
       
    54 										CTransitionControl* aTransControl,
       
    55 										TUint aFlags);
       
    56 	~CTransitionParticipant();
       
    57 	//Capture
       
    58 	TInt CaptureBegin(const CCoeControl* aControl, TCaptureType aCaptureType, TInt aZDepth);
       
    59 	TInt CaptureEnd(const CCoeControl* aControl, TCaptureType aCaptureType, TInt aZDepth);
       
    60 	inline TCaptureState CaptureState();
       
    61 	inline TBool HaveImageCapture();
       
    62 	//demark
       
    63 	void SetBeginDemarcation(TRect& aBeginRect, TCoordinateRef aCoordRef = CTransitionParticipant::EWindowOwning);
       
    64 	void SetEndDemarcation(TRect& aBeginRect, TCoordinateRef aCoordRef = CTransitionParticipant::EWindowOwning);
       
    65 	void ModifyCoordinates(TPoint& aBeginRef, TPoint& aEndRef);
       
    66 	//hints
       
    67 	inline void Invalidate();
       
    68 	inline void SetFlags(TUint aFlags);
       
    69 	inline void SetLayerType(TUid aLayerType);
       
    70 	inline TUint Flags();
       
    71 	//getters
       
    72 	inline TBool Invalidated();
       
    73 	inline const CCoeControl* Control();
       
    74 	inline const CParticipantData* Data();
       
    75 	//MCommandBufferObserver
       
    76 	inline void SetListenForUpdates(TBool aListen);
       
    77 	void CommandBufferUpdated(const TRect& aDrawRect, const TRect& aBoundingRect);
       
    78     inline CRemoteGc* RemoteGc();
       
    79 private:
       
    80 	//construct
       
    81 	CTransitionParticipant(CTransitionControl* aTransControl);
       
    82 	//data
       
    83 	TCoordinateRef iCoordRefBegin;
       
    84 	TCoordinateRef iCoordRefEnd;
       
    85 	TCaptureState iCaptureState;
       
    86 	CRemoteGc* iRemoteGc;
       
    87 	CParticipantData* iData;
       
    88 	CTransitionControl* iTransControl;
       
    89 	//hints
       
    90 	TBool iInvalidated;
       
    91 	TBool iCaptureEndCalled;
       
    92 	TBool iInCapture;
       
    93 	TBool iCommandsReceived;
       
    94 	TBool iCapturedGc;
       
    95 	TBool iListensForUpdates;
       
    96 	};
       
    97 
       
    98 // inlines
       
    99 
       
   100 CRemoteGc* CTransitionParticipant::RemoteGc()
       
   101     {
       
   102     return iRemoteGc;
       
   103     }
       
   104 
       
   105 CTransitionParticipant::TCaptureState CTransitionParticipant::CaptureState()
       
   106 	{
       
   107 	return iCaptureState;
       
   108 	}
       
   109 
       
   110 void CTransitionParticipant::Invalidate()
       
   111 	{
       
   112 	iInvalidated = ETrue;
       
   113 	}
       
   114 	
       
   115 TBool CTransitionParticipant::Invalidated()
       
   116 	{
       
   117 	return iInvalidated;
       
   118 	}
       
   119 
       
   120 void CTransitionParticipant::SetFlags(TUint aFlags)
       
   121 	{
       
   122 	iData->iFlags = aFlags;
       
   123 	}
       
   124 
       
   125 void CTransitionParticipant::SetLayerType(TUid aLayerType)
       
   126 	{
       
   127 	iData->iLayerType = aLayerType;
       
   128 	}
       
   129 
       
   130 TUint CTransitionParticipant::Flags()
       
   131 	{
       
   132 	return iData->iFlags;
       
   133 	}
       
   134 
       
   135 TBool CTransitionParticipant::HaveImageCapture()
       
   136 	{
       
   137 	return (iData->iBeginCapture || iData->iEndCapture);
       
   138 	}
       
   139 
       
   140 const CCoeControl* CTransitionParticipant::Control()
       
   141 	{
       
   142 	return iData->iKey;
       
   143 	}
       
   144 	
       
   145 const CParticipantData* CTransitionParticipant::Data()
       
   146 	{
       
   147 	return iData;
       
   148 	}
       
   149 
       
   150 void CTransitionParticipant::SetListenForUpdates(TBool aListen)
       
   151 	{
       
   152 	iListensForUpdates = aListen;
       
   153 	}
       
   154 #endif //_TRANSITIONPARTICIPANT_H_
       
   155