commonuisupport/uikon/test/tsprites/thlsprite/thlsprite.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 // The test step performs tests to display sprites from a sprite set.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent - Internal Symbian test code
       
    21 */
       
    22 
       
    23 
       
    24 #ifndef		__THLSPRITE_H
       
    25 #define		__THLSPRITE_H
       
    26 
       
    27 
       
    28 #include "appfwk_test_AppUi.h"
       
    29 
       
    30 _LIT(KHlSpriteStep, "THlSprite");
       
    31 
       
    32 //!  A CTestThlspriteStep test class. 
       
    33 /**
       
    34  The class creates & sets the application's user interface object.
       
    35 */
       
    36 class CTestThlspriteStep : public CTmsTestStep
       
    37 	{
       
    38 public:
       
    39 	CTestThlspriteStep();
       
    40 	~CTestThlspriteStep();
       
    41 	//virtual TVerdict doTestStepPreambleL();
       
    42 	virtual TVerdict doTestStepL();
       
    43 	void ConstructAppL(CEikonEnv* aCoe);
       
    44 private:
       
    45 	};
       
    46 
       
    47 
       
    48 //!  A CHLSpriteAppView test class. 
       
    49 /**
       
    50  The class provides a view on which the sprite is displayed.
       
    51 */
       
    52 class CHLSpriteAppView : public CCoeControl
       
    53 	{
       
    54 public:
       
    55 	~CHLSpriteAppView();
       
    56 	void ConstructL(const TRect& aRect);
       
    57 	void TryCreateSpriteSetL();
       
    58 	void HandleTimerCallbackL();
       
    59 	void DrawTargetSpriteNowL() const;
       
    60 private:	// from CCoeControl
       
    61 	void Draw(const TRect&) const;
       
    62 public:
       
    63 	CSpriteSet::TSpriteResizeMode iResizeMode;
       
    64 	TInt iSpriteSideLength;
       
    65 	TPoint iTargetSpriteTl;
       
    66 	TBool iSpriteIsDisplayed;
       
    67 	TBool iMaskIsInverted;
       
    68 	TRect iClippingRect;
       
    69 	CSpriteSet* iSourceSpriteSet;
       
    70 	CSpriteSet* iTargetSpriteSet;
       
    71 	};
       
    72 
       
    73 
       
    74 
       
    75 //!  A CHLSpriteAppUi test class. 
       
    76 /**
       
    77  The class performs tests on the CSpriteSet Api's.
       
    78 */
       
    79 class CHLSpriteAppUi : public CTestAppUi
       
    80 	{
       
    81 public:
       
    82 	CHLSpriteAppUi(CTmsTestStep *aStep);
       
    83 	void ConstructL();
       
    84 	~CHLSpriteAppUi();
       
    85 	static TInt TimerCallbackL(TAny* aPtr);
       
    86 private:
       
    87 	TSpriteMember CreateSpriteMember(TInt aBmpIndex, TInt aMaskIndex, TInt aInterval=0,  const TPoint& aOffset = TPoint(0,0));
       
    88 private:	// from CEikAppUi
       
    89 	void HandleCommandL(TInt aCommand);
       
    90 	//void DynInitMenuPaneL(TInt aMenuId,CEikMenuPane* aMenuPane);
       
    91 	//from CTestAppUi
       
    92 	void RunTestStepL(TInt aNumStep);
       
    93 private:
       
    94 	TPoint iTranslateOffset; // use for auto mode
       
    95 
       
    96 	CHLSpriteAppView* iAppView;
       
    97 	CPeriodic* iTimer;
       
    98 	TInt64 iSeed;
       
    99 	};
       
   100 
       
   101 
       
   102 #endif
       
   103 
       
   104