sl@0: 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 __TORDINAL_H__ sl@0: #define __TORDINAL_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include "../tlib/testbase.h" sl@0: #include "AUTO.H" sl@0: #include "TGraphicsHarness.h" sl@0: sl@0: class CTOrdinal; sl@0: sl@0: class COrdinalClient : public CTClient sl@0: { sl@0: public: sl@0: COrdinalClient(); sl@0: virtual void KeyL(const TKeyEvent &aKey,const TTime &aTime); sl@0: virtual void ConstructL(); sl@0: ~COrdinalClient(); sl@0: }; sl@0: sl@0: class COrdinalWindowBase : public CBase sl@0: { sl@0: public: sl@0: COrdinalWindowBase(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep); sl@0: ~COrdinalWindowBase(); sl@0: TInt OrdinalPosition(); sl@0: void SetOrdinalPosition(TInt aPos); sl@0: void SetOrdinalPosition(TInt aPos,TInt aPri); sl@0: virtual void Draw(); sl@0: void TestOP(TInt aTestPos); sl@0: TInt SetToLastAndGetOP(); sl@0: TInt SetToLastAndGetOPPri(TInt aPri); sl@0: void SetAndTestOP(TInt aPos); sl@0: void SetAndTestOP(TInt aPos,TInt aTestPos); sl@0: void SetAndTestOPPri(TInt aPos,TInt aPri,TInt aTestPos); sl@0: void SetAndTestOPPri(TInt aPos,TInt aPri); sl@0: inline COrdinalWindowBase* NextSibling() const; sl@0: inline COrdinalWindowBase* PrevSibling() const; sl@0: inline RWindowTreeNode* WinTreeNode(); sl@0: inline TUint32 Handle(); sl@0: protected: sl@0: RWindowTreeNode* iWin; sl@0: private: sl@0: CTClient* iClient; sl@0: CTestBase* iTest; sl@0: CTestStep* iTestStep; sl@0: }; sl@0: sl@0: class COrdinalWindow : public COrdinalWindowBase sl@0: { sl@0: public: sl@0: COrdinalWindow(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep); sl@0: static COrdinalWindowBase *NewL(CTClient *aClient, RWindowTreeNode *parent, CTestBase* aTest, CTestStep* aTestStep); sl@0: private: sl@0: RWindow iClientWin; sl@0: }; sl@0: sl@0: class COrdinalWindowGroup : public COrdinalWindowBase sl@0: { sl@0: public: sl@0: COrdinalWindowGroup(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep); sl@0: static COrdinalWindowBase *NewL(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep); sl@0: private: sl@0: RWindowGroup iGroupWin; sl@0: }; sl@0: sl@0: class CTOrdinal : public CTWsGraphicsBase sl@0: { sl@0: public: sl@0: CTOrdinal(CTestStep* aStep); sl@0: ~CTOrdinal(); sl@0: void DestroyWindows(); sl@0: void OrdinalPos(); sl@0: void OrdinalPriority(); sl@0: void ConstructL(); sl@0: void CreateWindowsL(TInt aMode); sl@0: protected: //virtual function from CTGraphicsStep sl@0: void RunTestCaseL(TInt aCurTestCase); sl@0: private: sl@0: void TestWindowOrderNext(TInt aBefore,TInt aAfter); sl@0: void TestWindowOrderNext(TInt aLast); sl@0: void TestWindowOrderPrev(TInt aAfter,TInt aBefore); sl@0: void TestWindowOrderPrev(TInt aFirst); sl@0: void CheckHandlesOnNewWindow(CTWindowGroup* aParent,COrdinalWindowBase* aWin); sl@0: void CheckHandlesOnNewWindow(COrdinalWindowBase* aParent,COrdinalWindowBase* aWin); sl@0: void CheckHandlesOnNewWindow(TInt aErrors,COrdinalWindowBase* aWin); sl@0: void CheckHandles(TUint aParent); sl@0: private: sl@0: enum {ENumChildren=6}; sl@0: private: sl@0: COrdinalClient* iClient; sl@0: TSize iWinSize; sl@0: TBool iGroupTest; sl@0: COrdinalWindowBase* iParent; sl@0: COrdinalWindowBase* iParent2; sl@0: COrdinalWindowBase* iParent3; sl@0: COrdinalWindowBase* iChild[ENumChildren]; sl@0: }; sl@0: sl@0: class CTOrdinalStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTOrdinalStep(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: }; sl@0: sl@0: _LIT(KTOrdinalStep,"TOrdinal"); sl@0: sl@0: sl@0: #endif