lafagnosticuifoundation/animation/tef/TFrames.h
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2005-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 /**
       
    17  @file
       
    18  @internalComponent - Internal Symbian test code 
       
    19 */
       
    20 
       
    21 
       
    22 #ifndef __TFRAMES_H__
       
    23 #define __TFRAMES_H__
       
    24 
       
    25 #include "AnimationTestStep.h"
       
    26 
       
    27 #include "TestWindows.h"
       
    28 #include "BasicAnimation.h"
       
    29 #include "SpriteAnimation.h"
       
    30 #include "ICLAnimationDataProvider.h"
       
    31 
       
    32 _LIT(KFramesStep, "Frames");
       
    33 
       
    34 //
       
    35 // Windows used in this test step:
       
    36 //
       
    37 class CFramesTestWindow : public CTestWindow
       
    38 	{
       
    39 public:
       
    40 	CFramesTestWindow(RWsSession& aWs, CTestWindowGroup& aGroup, CWindowGc& aGc);
       
    41 	void DrawL();
       
    42 	void SetLined(TBool aLined) { iLined = aLined; }
       
    43 	void SetOpaque(TBool aOpaque) { iOpaque = aOpaque; }
       
    44 protected:
       
    45 	TBool iLined;
       
    46 	TBool iOpaque;
       
    47 	};
       
    48 
       
    49 class CFramesAnimationWindow : public CFramesTestWindow
       
    50 	{
       
    51 public:
       
    52 	CFramesAnimationWindow(RWsSession& aWs, CTestWindowGroup& aGroup, CWindowGc& aGc);
       
    53 	void DrawL();
       
    54 	void SetAnimations(RPointerArray<CAnimation>* aAnimations, TBool aBasic = ETrue);
       
    55 protected:
       
    56 	TBool iBasicAnimations;
       
    57 	RPointerArray<CAnimation>* iAnimations;
       
    58 	};
       
    59 
       
    60 class CAnimationTestServer;
       
    61 
       
    62 class CFramesFrameWindow : public CFramesTestWindow
       
    63 	{
       
    64 public:
       
    65 	CFramesFrameWindow(RWsSession& aWs, CTestWindowGroup& aGroup, CWindowGc& aGc);
       
    66 	~CFramesFrameWindow();
       
    67 	TInt LoadL(const TDesC& aFile);
       
    68 	void FreeData();
       
    69 	void DrawL();
       
    70 	TSize Size() { if (iFrames.Count() > 0) return iFrames[0]->SizeInPixels(); else return TSize(0,0); }
       
    71 	TInt Count() { return iFrames.Count(); }
       
    72 protected:
       
    73 	RPointerArray<CFbsBitmap> iFrames;
       
    74 	RPointerArray<CFbsBitmap> iMasks;
       
    75 	};
       
    76 
       
    77 //
       
    78 // The test:
       
    79 //
       
    80 class CFrames : public CAnimationTestStep
       
    81 	{
       
    82 public:
       
    83 	enum Flags
       
    84 		{
       
    85 		ENoSprites = 0x001,
       
    86 		};
       
    87 public:
       
    88 	CFrames();
       
    89 	~CFrames();
       
    90 	void TestFramesL(TInt aFlags = 0);
       
    91 	void TestFramesL(const TDesC& aFile, const TDesC& aMbm, TInt aFlags = 0);
       
    92 	void TestFramesL(CFramesAnimationWindow& aBasicAnimWin, CFramesAnimationWindow& aSpriteAnimWin, const TDesC& aFile, CFramesFrameWindow& aFrameWin, const TDesC& aMbm, TInt aFlags = 0);
       
    93 	void InitialiseL();
       
    94 	// From CActiveTestStep:
       
    95 	virtual TVerdict doActiveTestStepL();
       
    96 protected:
       
    97 	RPointerArray<CAnimation> iBasicAnimations;
       
    98 	RPointerArray<CAnimation> iSpriteAnimations;
       
    99 	TInt iCase;
       
   100 	
       
   101 	TSize iWinSize;
       
   102 	TPoint iBasicAnimWinPosition;
       
   103 	TPoint iSpriteAnimWinPosition;
       
   104 	TPoint iFrameWinPosition;
       
   105 	CFramesAnimationWindow* iBasicAnimWin;
       
   106 	CFramesAnimationWindow* iTransBasicAnimWin;
       
   107 	CFramesAnimationWindow* iSpriteAnimWin;
       
   108 	CFramesAnimationWindow* iTransSpriteAnimWin;
       
   109 	CFramesFrameWindow* iFrameWin;
       
   110 	CFramesFrameWindow* iTransFrameWin;
       
   111 	};
       
   112 
       
   113 #endif //__TFRAMES_H__