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: #ifndef __TWINDOW_H__ sl@0: #define __TWINDOW_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include "AUTO.H" sl@0: sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA sl@0: #include "../nonnga/CLIENT/w32comm.h" sl@0: #endif sl@0: sl@0: #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA sl@0: #include "../nga/CLIENT/w32comm.h" sl@0: #endif sl@0: sl@0: #include "../tlib/testbase.h" sl@0: #include "TGraphicsHarness.h" sl@0: sl@0: struct TWindowThreadParam sl@0: { sl@0: TInt iCommand; sl@0: TInt iScreenNumber; sl@0: }; sl@0: sl@0: class CWinTestWindow : public CBlankWindow sl@0: { sl@0: public: sl@0: CWinTestWindow(TRgb aCol); sl@0: ~CWinTestWindow(); sl@0: void ConstructL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc, TInt aDepth); sl@0: public: sl@0: CWinTestWindow *iChild; sl@0: }; sl@0: sl@0: class CEvWindowGroup : public CTWindowGroup sl@0: { sl@0: public: sl@0: static CEvWindowGroup* NewLC(CTClient* aClient,CTWsGraphicsBase* aTest); sl@0: CEvWindowGroup(CTClient* aClient,CTWsGraphicsBase* aTest); sl@0: void SetExpectedEvent(TInt aType); sl@0: void SendEvent(TInt aType); sl@0: //Virtual functions from CTWindowGroup sl@0: void ConstructL(); sl@0: void UserEvent(TInt aEventType); sl@0: private: sl@0: CTWsGraphicsBase* iTest; sl@0: TInt iExpectedEvent; sl@0: TBool iExpectingEvent; sl@0: }; sl@0: sl@0: class CTWindowTest : public CTWsGraphicsBase sl@0: { sl@0: public: sl@0: enum {EWinTypeFactor=1000}; sl@0: enum sl@0: { sl@0: EIdMask=0x0000FFFF, sl@0: EPosMask=0xFFFF0000, sl@0: EPosShift=16 sl@0: }; sl@0: private: sl@0: enum TCorner {ECornerTL,ECornerTR,ECornerBL,ECornerBR}; sl@0: public: sl@0: CTWindowTest(CTestStep* aStep); sl@0: ~CTWindowTest(); sl@0: TestState DoTestL(); sl@0: void ConstructL(); sl@0: void CreateTestWindowL(); sl@0: void CheckAndDestroyWindows(); sl@0: void DestroyWindowWithActiveGc(); sl@0: void DestroyWindowWithActiveGc2L(); sl@0: void DrawWindows(CWinTestWindow *aWin); sl@0: void ClearRedraw(RWindow &aWindow, TRgb aRgb); sl@0: void TestInvalidFunctionsL(); sl@0: void ShadowAutoClearTest(); sl@0: void CreateMegaTree(); sl@0: void TiledWindowTestL(); sl@0: void TiledWindowTest2L(); sl@0: void CornerTests(); sl@0: void ColorTestL(); sl@0: void TestInvalidFunctions2L(); sl@0: void Bug1L(); sl@0: void Bug2L(); sl@0: void Bug3L(); sl@0: void TestDeletedParentPanics1L(); sl@0: void TestDeletedParentPanics2L(); sl@0: void BackColorBugL(); sl@0: void FocusChangedL(); sl@0: void FadeRegionsL(); sl@0: void FadeRegionsWithRedrawStoringL(); sl@0: void EventsToAllL(); sl@0: void ErrorCodesL(); sl@0: void GroupIdL(); sl@0: void doCornerTestsL(); sl@0: void doCornerTest(TCornerType aCornerType, TInt aFlags); sl@0: void CheckCorner(TCorner aCorner, const TInt *aInsetList); sl@0: void ShadowTestL(); sl@0: void TestWindowDelete(); sl@0: void SaturateSendEvent(); sl@0: void TestNotSupportedFunctionality(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual void RunTestCaseL(TInt aCurTestCase); sl@0: private: sl@0: static TInt MoveGroup(TAny* aParam); sl@0: void DoFadeRegionsL(TBool aRedrawStoring); sl@0: private: sl@0: CWinTestWindow *iWin; sl@0: CTBlankWindow *iBlankWin1; sl@0: CTBlankWindow *iBlankWin2; sl@0: CWsScreenDevice *iScreenDev; sl@0: TThreadStartUp iFirstFunction; sl@0: TWindowThreadParam iThreadParam; sl@0: }; sl@0: sl@0: class CTWindowTestStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTWindowTestStep(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: }; sl@0: sl@0: _LIT(KTWindowTestStep,"TWindowTest"); sl@0: sl@0: sl@0: #endif