sl@0: // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: /**
sl@0:  @file
sl@0:  @test
sl@0:  @internalComponent - Internal Symbian test code
sl@0: */
sl@0: 
sl@0: 
sl@0: #ifndef __TSCREENMODEPOSITIONING_H__
sl@0: #define __TSCREENMODEPOSITIONING_H__
sl@0: 
sl@0: #include <e32std.h>
sl@0: #include <w32std.h>
sl@0: #include "../tlib/testbase.h"
sl@0: #include "AUTO.H"
sl@0: #include "TScreenModeScaling.h"
sl@0: #include "TGraphicsHarness.h"
sl@0: 
sl@0: class CConnection2;
sl@0: 
sl@0: class CConnection2Group : public CTWindowGroup
sl@0: 	{
sl@0: public:
sl@0: 	CConnection2Group(CTClient *aClient, CConnection2 *aSecondConnection, CTestBase *aTest);
sl@0: private:
sl@0: 	CTestBase* iTest;
sl@0: public:
sl@0: 	CConnection2* iConnection2;
sl@0: 	};
sl@0: 
sl@0: class CConnection2 : public CBase
sl@0: 	{
sl@0: public:
sl@0: 	~CConnection2();
sl@0: 	void ConstructL(CTestBase *aTest,CFbsBitmap& aBitmap);
sl@0: 	void DrawBitmapWin();
sl@0: 	CBmpWin* BitmapWin() {return iBitmapWin;}
sl@0: public:
sl@0: 	CTClient* iClient;
sl@0: 	CFbsBitmap* iScreenBitmap;
sl@0: 	CSpriteWin*	iSpriteWin;
sl@0: private:
sl@0: 	CConnection2Group *iGroup;
sl@0: 	CBmpWin* iBitmapWin;
sl@0: 	};
sl@0: 
sl@0: 
sl@0: 
sl@0: class CTScreenModePositioning : public CTWsGraphicsBase
sl@0: 	{
sl@0: public:
sl@0: 	CTScreenModePositioning(CTestStep* aStep);
sl@0: 	~CTScreenModePositioning();
sl@0: 	void ConstructL();
sl@0: 
sl@0: 	void WindowTestsL();
sl@0: 	void SpriteTestL();
sl@0: 	void RotationTestsL();
sl@0: 	TBool ScalingSupportedByDisplayMode();
sl@0: 
sl@0: protected:
sl@0: 	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0: private:
sl@0: 	TBool TestRect();
sl@0: 	void CopyScreenAndChangeBackToDefScrModeL();
sl@0: 	void PositionTest1L(TPoint aPosTSize);
sl@0: 	void PositionTest2L(TPoint aPos);
sl@0: 	void GetInvalidRegionTestL(TPoint aPos);
sl@0: 	void DoWindowTestsL();
sl@0: 	void CreateWindowsTestL(TPoint aPos);
sl@0: 	void NextScreenModeTestL(TPoint aPos);
sl@0: 	void ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TInt aMode);
sl@0: 	void ChangeScreenMode(CTClient* aClient,TPixelsAndRotation aPixelsAndRotation,TScreenModeEnforcement aScreenModeEnforcement,TInt aMode);
sl@0: 	void SetScreenMode(CTClient* aClient,TInt aMode,TScreenModeEnforcement aScreenModeEnforcement);
sl@0: 	void SetUpSpriteLC(RWsSprite &aSprite, RWsSession &aSession, RWindowTreeNode &aWindow,TInt aFlags=ESpriteNoShadows);
sl@0: 	void CompareRegionsL(const TRegion &aRegion1,const TRegion &aRegion2);
sl@0: 	void TestGetInvalidRegionL(TRect& aRect);
sl@0: 	void TestTopClientWindowPositionAPIs(TPoint aPos,RWindowBase* aWin);
sl@0: 	void TestChildWindowPositionAPIs(TPoint aPos,TPoint aParentPos,RWindowBase* aWin,RWindowBase* aParentWin);
sl@0: 	void CopyAndCompareL(TPoint aPos);
sl@0: 	void RestoreScreenMode();
sl@0: private:
sl@0: 	CFbsBitmap iSpriteBitmap;
sl@0: 	CConnection2* iConnection2;
sl@0: 	CBasicWin *iTestWin;
sl@0: 	CTBackedUpWin* iBackedUpWin;
sl@0: 	CTBlankWindow* iBlankWin;
sl@0: 	CTBlankWindow* iTestChildWin;
sl@0: 	TInt iCurrentMode;
sl@0: 	TSize iTestWinSize;
sl@0: 	TPoint iCurrentScreenModeOrigin;
sl@0: 	TSize iCurrentScreenModeScale;
sl@0: 	TSize iCurrentScreenModeSize;
sl@0: 	TInt iScalingSupported;
sl@0:  	};
sl@0: 
sl@0: class CTScreenModePositioningStep : public CTGraphicsStep
sl@0: 	{
sl@0: public:
sl@0: 	CTScreenModePositioningStep();
sl@0: protected:	
sl@0: 	//from CTGraphicsStep
sl@0: 	virtual CTGraphicsBase* CreateTestL();
sl@0: 	};
sl@0: 
sl@0: _LIT(KTScreenModePositioningStep,"TScreenModePositioning");
sl@0: 
sl@0: 
sl@0: #endif