Update contrib.
1 // Copyright (c) 2004-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined(__TSCDVDEVORIENTATION_H__)
17 #define __TSCDVDEVORIENTATION_H__
19 #include "TGraphicsHarness.h"
20 #include <graphics/surface.h>
21 #include <pixelformats.h>
22 #include <bitdrawsurface.h>
25 LOCAL_D const TUint KPanicThreadHeapSize=0x4000;
26 _LIT(KSCDVPanicCategory,"SCDV");
31 typedef TInt (*TPanicFunction)(TDeviceOrientation aOrientation, TDisplayMode aDisplayMode,TInt aScreenNo);
35 TPanicFunction functionName;
36 TDeviceOrientation* pointerDeviceOrientation;
37 TDisplayMode* pointerDisplayMode;
38 TInt* pointerScreenNo;
41 enum TPanicExitReasons
43 EWsExitReasonBad=0x12345678,
49 EAutoPanicTestFailed=0xBAADF00D,
50 EAutoPanicPanicFailed=0xF00DBAAD
53 class CPanicTest : public CBase
58 TInt LaunchPanicThread(RThread &aThread, SPanicParams *aPtr);
59 TInt TestInvalidModePanicL(TPanicFunction aFunction, TScreenDriverPanic aExitReason,TDisplayMode* aPtr2, TDeviceOrientation* aPtr, TInt* aPtrScreenNo, TBool* aTestFinished = NULL);
61 TInt TestPanicL(SPanicParams *aPtr, TInt aExitReason, const TDesC &aCategory, TBool* aTestFinished=NULL);
62 TInt TestPanicL(TPanicFunction aFunction, TInt aExitReason, const TDesC &aCategory, TDisplayMode* aPtr2,TDeviceOrientation* aPtr, TInt* aPtrScreenNo, TBool* aTestFinished=NULL);
63 TInt iActualPanicCode;
69 class CTDevOrientation: public CTGraphicsBase
73 CTDevOrientation(CTestStep *aTest, RArray<TInt> aArrayDispModes);
74 CTDevOrientation(CTestStep *aTest);
76 void RunTestCaseL(TInt aCurTestCase);
78 TBool GetSurfaceIdInterfaceL(const TInt& aScreenNo,const TDisplayMode& aDisplayMode, CFbsDrawDevice*& aDrawScreenDevice, MSurfaceId*& aSurfaceIdInterface );
80 TBool ChooseOrientationMode( MSurfaceId* aSurfaceIdInterface);
82 void TestValidButUnavailableOrientationL(MSurfaceId* aSurfaceIdInterface,TDisplayMode aDisplayMode);
83 void TestSetDeviceOrientationWithInvalidModeL(TDisplayMode aDisplayMode);
84 void TestGetSurfaceWithValidDispModeL( const MSurfaceId* aSurfaceIdInterface, const TDisplayMode& aDisplayMode, TInt aScreenNo);
85 void TestGetDeviceOrientation(MSurfaceId* aSurfaceIdInterface);
86 void TestDeviceOrientationSettingandGetting( MSurfaceId* aSurfaceIdInterface);
87 void TestHorizontalVerticalTwips(const CFbsDrawDevice* aDrawScreenDevice, MSurfaceId* aSurfaceIdInterface, TDisplayMode aDisplayMode, TInt aScreenNo);
88 void TestSetDeviceOrientationWithValidMode(const CFbsDrawDevice* aDrawScreenDevice, MSurfaceId* aSurfaceIdInterface, TDisplayMode aDisplayMode, TInt aScreenNo);
89 void TestSetDisplayMode(CFbsDrawDevice* aDrawScreenDevice,MSurfaceId* aSurfaceIdInterface);
94 TBool ReqBppAndPixelFormat(TDisplayMode aDisplayMode, TInt& aBpp, TUint32& aPixelFormat);
98 RArray<TDeviceOrientation> iArrayOrientation;
99 // handle to initiate the panic tests
100 CPanicTest *iPanicTest;
101 RArray<TInt> iArrayDispModesPerScreen;
106 class CTDevOrientationStep : public CTGraphicsStep
109 CTDevOrientationStep();
111 //from CTGraphicsStep
112 virtual CTGraphicsBase* CreateTestL();
113 virtual void TestSetupL();
116 _LIT(KTDevOrientationStep,"TDevOrientation");