1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TORDINAL.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,134 @@
1.4 +
1.5 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +/**
1.21 + @file
1.22 + @test
1.23 + @internalComponent - Internal Symbian test code
1.24 +*/
1.25 +
1.26 +#ifndef __TORDINAL_H__
1.27 +#define __TORDINAL_H__
1.28 +
1.29 +#include <e32std.h>
1.30 +#include <w32std.h>
1.31 +#include "../tlib/testbase.h"
1.32 +#include "AUTO.H"
1.33 +#include "TGraphicsHarness.h"
1.34 +
1.35 +class CTOrdinal;
1.36 +
1.37 +class COrdinalClient : public CTClient
1.38 + {
1.39 +public:
1.40 + COrdinalClient();
1.41 + virtual void KeyL(const TKeyEvent &aKey,const TTime &aTime);
1.42 + virtual void ConstructL();
1.43 + ~COrdinalClient();
1.44 + };
1.45 +
1.46 +class COrdinalWindowBase : public CBase
1.47 + {
1.48 +public:
1.49 + COrdinalWindowBase(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
1.50 + ~COrdinalWindowBase();
1.51 + TInt OrdinalPosition();
1.52 + void SetOrdinalPosition(TInt aPos);
1.53 + void SetOrdinalPosition(TInt aPos,TInt aPri);
1.54 + virtual void Draw();
1.55 + void TestOP(TInt aTestPos);
1.56 + TInt SetToLastAndGetOP();
1.57 + TInt SetToLastAndGetOPPri(TInt aPri);
1.58 + void SetAndTestOP(TInt aPos);
1.59 + void SetAndTestOP(TInt aPos,TInt aTestPos);
1.60 + void SetAndTestOPPri(TInt aPos,TInt aPri,TInt aTestPos);
1.61 + void SetAndTestOPPri(TInt aPos,TInt aPri);
1.62 + inline COrdinalWindowBase* NextSibling() const;
1.63 + inline COrdinalWindowBase* PrevSibling() const;
1.64 + inline RWindowTreeNode* WinTreeNode();
1.65 + inline TUint32 Handle();
1.66 +protected:
1.67 + RWindowTreeNode* iWin;
1.68 +private:
1.69 + CTClient* iClient;
1.70 + CTestBase* iTest;
1.71 + CTestStep* iTestStep;
1.72 + };
1.73 +
1.74 +class COrdinalWindow : public COrdinalWindowBase
1.75 + {
1.76 +public:
1.77 + COrdinalWindow(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
1.78 + static COrdinalWindowBase *NewL(CTClient *aClient, RWindowTreeNode *parent, CTestBase* aTest, CTestStep* aTestStep);
1.79 +private:
1.80 + RWindow iClientWin;
1.81 + };
1.82 +
1.83 +class COrdinalWindowGroup : public COrdinalWindowBase
1.84 + {
1.85 +public:
1.86 + COrdinalWindowGroup(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
1.87 + static COrdinalWindowBase *NewL(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
1.88 +private:
1.89 + RWindowGroup iGroupWin;
1.90 + };
1.91 +
1.92 +class CTOrdinal : public CTWsGraphicsBase
1.93 + {
1.94 +public:
1.95 + CTOrdinal(CTestStep* aStep);
1.96 + ~CTOrdinal();
1.97 + void DestroyWindows();
1.98 + void OrdinalPos();
1.99 + void OrdinalPriority();
1.100 + void ConstructL();
1.101 + void CreateWindowsL(TInt aMode);
1.102 +protected: //virtual function from CTGraphicsStep
1.103 + void RunTestCaseL(TInt aCurTestCase);
1.104 +private:
1.105 + void TestWindowOrderNext(TInt aBefore,TInt aAfter);
1.106 + void TestWindowOrderNext(TInt aLast);
1.107 + void TestWindowOrderPrev(TInt aAfter,TInt aBefore);
1.108 + void TestWindowOrderPrev(TInt aFirst);
1.109 + void CheckHandlesOnNewWindow(CTWindowGroup* aParent,COrdinalWindowBase* aWin);
1.110 + void CheckHandlesOnNewWindow(COrdinalWindowBase* aParent,COrdinalWindowBase* aWin);
1.111 + void CheckHandlesOnNewWindow(TInt aErrors,COrdinalWindowBase* aWin);
1.112 + void CheckHandles(TUint aParent);
1.113 +private:
1.114 + enum {ENumChildren=6};
1.115 +private:
1.116 + COrdinalClient* iClient;
1.117 + TSize iWinSize;
1.118 + TBool iGroupTest;
1.119 + COrdinalWindowBase* iParent;
1.120 + COrdinalWindowBase* iParent2;
1.121 + COrdinalWindowBase* iParent3;
1.122 + COrdinalWindowBase* iChild[ENumChildren];
1.123 + };
1.124 +
1.125 +class CTOrdinalStep : public CTGraphicsStep
1.126 + {
1.127 +public:
1.128 + CTOrdinalStep();
1.129 +protected:
1.130 + //from CTGraphicsStep
1.131 + virtual CTGraphicsBase* CreateTestL();
1.132 + };
1.133 +
1.134 +_LIT(KTOrdinalStep,"TOrdinal");
1.135 +
1.136 +
1.137 +#endif