os/graphics/windowing/windowserver/test/tauto/TTEXTCURS.H
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TTEXTCURS.H	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,146 @@
     1.4 +
     1.5 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// under the terms of "Eclipse Public License v1.0"
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +/**
    1.21 + @file
    1.22 + @test
    1.23 + @internalComponent - Internal Symbian test code
    1.24 +*/
    1.25 +
    1.26 +#ifndef __TTEXTCURS_H__
    1.27 +#define __TTEXTCURS_H__
    1.28 +
    1.29 +#include <e32std.h>
    1.30 +#include <w32std.h>
    1.31 +#include "../tlib/testbase.h"
    1.32 +#include "AUTO.H"
    1.33 +#include "TGraphicsHarness.h"
    1.34 +
    1.35 +/*
    1.36 + * Wrapper class for a custom text cursor.
    1.37 + */
    1.38 +class CCustomTextCursor : public CBase
    1.39 +	{
    1.40 +public:
    1.41 +	static CCustomTextCursor* CreateCustomTextCursorL(TInt aScreenNumber,TInt aBmpIndex,CTestBase* aTest);
    1.42 +	~CCustomTextCursor();
    1.43 +	
    1.44 +private:
    1.45 +	CCustomTextCursor(CTestBase* aTest);
    1.46 +	void ConstructL(TInt aScreenNumber,TInt aBmpIndex);
    1.47 +	
    1.48 +public:
    1.49 +	TInt iIdentifier;
    1.50 +	RArray<TSpriteMember> iSpriteMemberArray;
    1.51 +	TUint iSpriteFlags;
    1.52 +	RWsSession::TCustomTextCursorAlignment iAlignment;
    1.53 +	CTestBase* iTest;
    1.54 +	};
    1.55 +	
    1.56 +class CTCursorTest : public CTWsGraphicsBase
    1.57 +	{
    1.58 +public:
    1.59 +	CTCursorTest(CTestStep* aStep);
    1.60 +	~CTCursorTest();
    1.61 +protected:
    1.62 +//from 	CTGraphicsStep
    1.63 +	virtual void RunTestCaseL(TInt aCurTestCase);
    1.64 +private:
    1.65 +	void SetCursor(const TPoint &aPos,const TSize &aSize,TRgb aColor, TUint aFlags=0);
    1.66 +	void SetCursor(const TPoint &aPos,const TSize &aSize,TRgb aColor, const TRect &aRect, TUint aFlags=0);
    1.67 +	void SetCursorPlusBox(const TPoint &aPos,const TSize &aSize,TRgb aColor, const TRect *aRect, TUint aFlags=0);
    1.68 +	void CancelTextCursor();
    1.69 +	void ConstructL();
    1.70 +	void doMoveWindowTestL();
    1.71 +	TBool MoveWindow();
    1.72 +	void TestPanicsL();
    1.73 +	void ScrollTest();
    1.74 +	void GeneralTestsL();
    1.75 +	void MoveWindowTest1L();
    1.76 +	void MoveWindowTest2L();
    1.77 +	void INC041278L();
    1.78 +	void INC040489L();
    1.79 +	void CursorUpdatedBeforeWindowRenderedL();
    1.80 +	void INC097774();
    1.81 +	void INC117232();
    1.82 +#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
    1.83 +	void TextCursorNoFlashTestL();
    1.84 +	void TextCursorFlashTestL();
    1.85 +	void CheckCursorDoesNotFlash(const TSize& aSize);
    1.86 +	void UpdateCountersOnCursorTransition(
    1.87 +			const TBool	aTransitionedToOn,
    1.88 +			TTime& 		aNow,
    1.89 +			TInt64&		aDeltaTime,
    1.90 +			TTime&		aLastDeltaTime,
    1.91 +			TInt&		aWarmUpIterations,
    1.92 +			const TInt&	aFlashChangeTime,
    1.93 +			const TInt&	aToleranceMargin,
    1.94 +			TInt&		aSampleNumber,
    1.95 +			TInt&		aToleranceViolations
    1.96 +			);
    1.97 +	void CheckCursorDoesFlash(const TPoint& aPos, const TTextCursor& aTextCursor, TRgb aBackgroundColor);
    1.98 +	void DrawTextCursorSimilarToRenderStage(CWindowGc& aGc, RWindow& aWin, const TPoint& aPos, const TTextCursor& aTextCursor);
    1.99 +#endif
   1.100 +	TBool IncrementCursorType();
   1.101 +	CTSprite* CreateTestSpriteLC(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aCount);
   1.102 +	void TestForArtifacts(CBlankWindow* aWin1, TTextCursor& aCursor);
   1.103 +	void CheckNoDoubleCursorTest1L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
   1.104 +	void CheckNoDoubleCursorTest2L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
   1.105 +	void CheckNoDoubleCursorTest3L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
   1.106 +	void MakeCursors(TTextCursor& aTextCursor, TTextCursor& aCustomCursor);										  
   1.107 +	void StartDoubleCursorTestL(TInt aTestNumber);
   1.108 +	void doCheckNoDoubleCursor(CBlankWindow* aWin1,
   1.109 +								CBlankWindow* aWin2,
   1.110 +								const TPoint& aWin1Tl,
   1.111 +								const TPoint& aWin1T2,
   1.112 +								const TTextCursor& aCursor,
   1.113 +								const TSize& aCursorSize,
   1.114 +								CWsScreenDevice::TSpriteInCompare aFlags);
   1.115 +	
   1.116 +	void ResetWindows(CWindowGc* aWinGc,CBlankWindow* aWin1,CBlankWindow* aWin2);
   1.117 +	void ValidateWin(TestWindow *aWin, TRgb aColor);
   1.118 +	void RedrawWin(RWindow &aWin, TRgb aColor);
   1.119 +	void DeleteMoveWindows();
   1.120 +	void ResetMoveWindowsL();
   1.121 +	static TInt DoPanicTest(TInt aInt, TAny *aScreenNumber);
   1.122 +	void TextCursorSetLCoverageTests();
   1.123 +	
   1.124 +private:
   1.125 +	TSize iWinSize;
   1.126 +	TPoint iWinPos;
   1.127 +	TInt iWinState;
   1.128 +	CBlankWindow *iMoveWin;
   1.129 +	CBlankWindow *iCheckWin;
   1.130 +	CBlankWindow *iWorkInProgress;
   1.131 +	CBlankWindow *iComparisonWindow;
   1.132 +	TTextCursor::EType iCursorType;
   1.133 +	static CTestBase* iStaticTest;	// static because it is used by DoPanicTest
   1.134 +	};
   1.135 +
   1.136 +
   1.137 +class CTCursorTestStep : public CTGraphicsStep
   1.138 +	{
   1.139 +public:
   1.140 +	CTCursorTestStep();
   1.141 +protected:	
   1.142 +	//from CTGraphicsStep
   1.143 +	virtual CTGraphicsBase* CreateTestL();
   1.144 +	};
   1.145 +
   1.146 +_LIT(KTCursorTestStep,"TCursorTest");
   1.147 +
   1.148 +
   1.149 +#endif