First public contribution.
2 // Copyright (c) 2008-2009 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".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
20 @internalComponent - Internal Symbian test code
22 #ifndef __TTRANSPTANIM__
23 #define __TTRANSPTANIM__
28 #include "../tlib/testbase.h"
38 class CTransAnimTimer;
39 class CTTransparentAnim;
41 class MAnimationObserver;
43 class CTTransparentAnim : public CTWsGraphicsBase
46 static CTTestCase* CreateTestCaseL(CTTransparentAnim*, TInt);
48 CTTransparentAnim(CTestStep*);
49 virtual ~CTTransparentAnim();
52 void SetCurrent(CTTestCase*);
53 CTTestCase* GetCurrent();
55 virtual void RunTestCaseL(TInt);
58 CTTestCase* iCurrentTestCase;
61 class CTTransparentAnimStep : public CTGraphicsStep
64 CTTransparentAnimStep();
67 virtual CTGraphicsBase* CreateTestL();
70 class CTransAnimTimer : public CTimer
76 void Start(TTimeIntervalMicroSeconds32 aInterval,TCallBack aCallBack);
85 CTTAnimation(CTWin*, TInt);
90 void SetCurrentFrameSet(TInt);
92 void Attach(MAnimationObserver*);
94 static TInt NextFrame(TAny*);
99 MAnimationObserver* iObserver;
102 CTransAnimTimer iAnimTimer;
104 TInt iCurrentFrameSet;
109 template <TBool AlphaTransparency = EFalse>
110 class CTAnimWin : public CTWin
113 static CTWin* NewL(TPoint aPosition, TSize aSize)
115 CTAnimWin* w = new(ELeave) CTAnimWin();
117 CleanupStack::PushL(w);
118 w->ConstructL(aPosition, aSize);
124 virtual ~CTAnimWin(){}
130 void ConstructL(TPoint aPoint, TSize aSize)
132 TRgb bgColor(150, 150, 150);
133 ConstructExtLD(*TheClient->iGroup, aPoint, aSize);
134 AssignGC(*TheClient->iGc);
135 Win()->SetRequiredDisplayMode(EColor16MA);
136 if (AlphaTransparency)
138 Win()->SetTransparencyAlphaChannel();
139 bgColor.SetAlpha(150);
141 Win()->SetBackgroundColor(bgColor);
146 //*****************************************************************************
147 class MAnimationObserver
150 virtual void Update(CTTAnimation*) = 0;
153 class CTTestCase : public MAnimationObserver
157 virtual ~CTTestCase() {}
159 TBool IsAlreadyRunning();
165 // Implemented for MAnimationObserver
166 virtual void Update(CTTAnimation*);
167 virtual void ConstructL() = 0;
168 virtual TPtrC TestCaseName() = 0;
171 virtual void RunTestCaseL() = 0;
172 void SetIsCompleted(TBool);
180 class CTGraphicsWServ0483 : public CTTestCase
183 static CTGraphicsWServ0483* NewL();
186 virtual ~CTGraphicsWServ0483();
187 virtual void RunTestCaseL();
189 void Update(CTTAnimation*);
192 CTGraphicsWServ0483(){}
193 virtual void ConstructL();
194 virtual TPtrC TestCaseName();
198 CTTAnimation* iCheckAnim;
201 _LIT(KTTransparentAnimStep,"TTransparentAnim");
203 #endif // __TTRANSPTANIM__