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