os/graphics/windowing/windowserver/test/tauto/TTEXTCURS.H
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
sl@0
     2
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
// All rights reserved.
sl@0
     4
// This component and the accompanying materials are made available
sl@0
     5
// under the terms of "Eclipse Public License v1.0"
sl@0
     6
// which accompanies this distribution, and is available
sl@0
     7
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
//
sl@0
     9
// Initial Contributors:
sl@0
    10
// Nokia Corporation - initial contribution.
sl@0
    11
//
sl@0
    12
// Contributors:
sl@0
    13
//
sl@0
    14
// Description:
sl@0
    15
//
sl@0
    16
sl@0
    17
/**
sl@0
    18
 @file
sl@0
    19
 @test
sl@0
    20
 @internalComponent - Internal Symbian test code
sl@0
    21
*/
sl@0
    22
sl@0
    23
#ifndef __TTEXTCURS_H__
sl@0
    24
#define __TTEXTCURS_H__
sl@0
    25
sl@0
    26
#include <e32std.h>
sl@0
    27
#include <w32std.h>
sl@0
    28
#include "../tlib/testbase.h"
sl@0
    29
#include "AUTO.H"
sl@0
    30
#include "TGraphicsHarness.h"
sl@0
    31
sl@0
    32
/*
sl@0
    33
 * Wrapper class for a custom text cursor.
sl@0
    34
 */
sl@0
    35
class CCustomTextCursor : public CBase
sl@0
    36
	{
sl@0
    37
public:
sl@0
    38
	static CCustomTextCursor* CreateCustomTextCursorL(TInt aScreenNumber,TInt aBmpIndex,CTestBase* aTest);
sl@0
    39
	~CCustomTextCursor();
sl@0
    40
	
sl@0
    41
private:
sl@0
    42
	CCustomTextCursor(CTestBase* aTest);
sl@0
    43
	void ConstructL(TInt aScreenNumber,TInt aBmpIndex);
sl@0
    44
	
sl@0
    45
public:
sl@0
    46
	TInt iIdentifier;
sl@0
    47
	RArray<TSpriteMember> iSpriteMemberArray;
sl@0
    48
	TUint iSpriteFlags;
sl@0
    49
	RWsSession::TCustomTextCursorAlignment iAlignment;
sl@0
    50
	CTestBase* iTest;
sl@0
    51
	};
sl@0
    52
	
sl@0
    53
class CTCursorTest : public CTWsGraphicsBase
sl@0
    54
	{
sl@0
    55
public:
sl@0
    56
	CTCursorTest(CTestStep* aStep);
sl@0
    57
	~CTCursorTest();
sl@0
    58
protected:
sl@0
    59
//from 	CTGraphicsStep
sl@0
    60
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
    61
private:
sl@0
    62
	void SetCursor(const TPoint &aPos,const TSize &aSize,TRgb aColor, TUint aFlags=0);
sl@0
    63
	void SetCursor(const TPoint &aPos,const TSize &aSize,TRgb aColor, const TRect &aRect, TUint aFlags=0);
sl@0
    64
	void SetCursorPlusBox(const TPoint &aPos,const TSize &aSize,TRgb aColor, const TRect *aRect, TUint aFlags=0);
sl@0
    65
	void CancelTextCursor();
sl@0
    66
	void ConstructL();
sl@0
    67
	void doMoveWindowTestL();
sl@0
    68
	TBool MoveWindow();
sl@0
    69
	void TestPanicsL();
sl@0
    70
	void ScrollTest();
sl@0
    71
	void GeneralTestsL();
sl@0
    72
	void MoveWindowTest1L();
sl@0
    73
	void MoveWindowTest2L();
sl@0
    74
	void INC041278L();
sl@0
    75
	void INC040489L();
sl@0
    76
	void CursorUpdatedBeforeWindowRenderedL();
sl@0
    77
	void INC097774();
sl@0
    78
	void INC117232();
sl@0
    79
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
sl@0
    80
	void TextCursorNoFlashTestL();
sl@0
    81
	void TextCursorFlashTestL();
sl@0
    82
	void CheckCursorDoesNotFlash(const TSize& aSize);
sl@0
    83
	void UpdateCountersOnCursorTransition(
sl@0
    84
			const TBool	aTransitionedToOn,
sl@0
    85
			TTime& 		aNow,
sl@0
    86
			TInt64&		aDeltaTime,
sl@0
    87
			TTime&		aLastDeltaTime,
sl@0
    88
			TInt&		aWarmUpIterations,
sl@0
    89
			const TInt&	aFlashChangeTime,
sl@0
    90
			const TInt&	aToleranceMargin,
sl@0
    91
			TInt&		aSampleNumber,
sl@0
    92
			TInt&		aToleranceViolations
sl@0
    93
			);
sl@0
    94
	void CheckCursorDoesFlash(const TPoint& aPos, const TTextCursor& aTextCursor, TRgb aBackgroundColor);
sl@0
    95
	void DrawTextCursorSimilarToRenderStage(CWindowGc& aGc, RWindow& aWin, const TPoint& aPos, const TTextCursor& aTextCursor);
sl@0
    96
#endif
sl@0
    97
	TBool IncrementCursorType();
sl@0
    98
	CTSprite* CreateTestSpriteLC(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aCount);
sl@0
    99
	void TestForArtifacts(CBlankWindow* aWin1, TTextCursor& aCursor);
sl@0
   100
	void CheckNoDoubleCursorTest1L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
sl@0
   101
	void CheckNoDoubleCursorTest2L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
sl@0
   102
	void CheckNoDoubleCursorTest3L(CBlankWindow* aWin1, CBlankWindow* win2, TTextCursor& aTextCursor,TTextCursor& aCustomCursor, CWindowGc* winGc);
sl@0
   103
	void MakeCursors(TTextCursor& aTextCursor, TTextCursor& aCustomCursor);										  
sl@0
   104
	void StartDoubleCursorTestL(TInt aTestNumber);
sl@0
   105
	void doCheckNoDoubleCursor(CBlankWindow* aWin1,
sl@0
   106
								CBlankWindow* aWin2,
sl@0
   107
								const TPoint& aWin1Tl,
sl@0
   108
								const TPoint& aWin1T2,
sl@0
   109
								const TTextCursor& aCursor,
sl@0
   110
								const TSize& aCursorSize,
sl@0
   111
								CWsScreenDevice::TSpriteInCompare aFlags);
sl@0
   112
	
sl@0
   113
	void ResetWindows(CWindowGc* aWinGc,CBlankWindow* aWin1,CBlankWindow* aWin2);
sl@0
   114
	void ValidateWin(TestWindow *aWin, TRgb aColor);
sl@0
   115
	void RedrawWin(RWindow &aWin, TRgb aColor);
sl@0
   116
	void DeleteMoveWindows();
sl@0
   117
	void ResetMoveWindowsL();
sl@0
   118
	static TInt DoPanicTest(TInt aInt, TAny *aScreenNumber);
sl@0
   119
	void TextCursorSetLCoverageTests();
sl@0
   120
	
sl@0
   121
private:
sl@0
   122
	TSize iWinSize;
sl@0
   123
	TPoint iWinPos;
sl@0
   124
	TInt iWinState;
sl@0
   125
	CBlankWindow *iMoveWin;
sl@0
   126
	CBlankWindow *iCheckWin;
sl@0
   127
	CBlankWindow *iWorkInProgress;
sl@0
   128
	CBlankWindow *iComparisonWindow;
sl@0
   129
	TTextCursor::EType iCursorType;
sl@0
   130
	static CTestBase* iStaticTest;	// static because it is used by DoPanicTest
sl@0
   131
	};
sl@0
   132
sl@0
   133
sl@0
   134
class CTCursorTestStep : public CTGraphicsStep
sl@0
   135
	{
sl@0
   136
public:
sl@0
   137
	CTCursorTestStep();
sl@0
   138
protected:	
sl@0
   139
	//from CTGraphicsStep
sl@0
   140
	virtual CTGraphicsBase* CreateTestL();
sl@0
   141
	};
sl@0
   142
sl@0
   143
_LIT(KTCursorTestStep,"TCursorTest");
sl@0
   144
sl@0
   145
sl@0
   146
#endif