sl@0
|
1 |
|
sl@0
|
2 |
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
// All rights reserved.
|
sl@0
|
4 |
// This component and the accompanying materials are made available
|
sl@0
|
5 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
// which accompanies this distribution, and is available
|
sl@0
|
7 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
//
|
sl@0
|
9 |
// Initial Contributors:
|
sl@0
|
10 |
// Nokia Corporation - initial contribution.
|
sl@0
|
11 |
//
|
sl@0
|
12 |
// Contributors:
|
sl@0
|
13 |
//
|
sl@0
|
14 |
// Description:
|
sl@0
|
15 |
//
|
sl@0
|
16 |
|
sl@0
|
17 |
/**
|
sl@0
|
18 |
@file
|
sl@0
|
19 |
@test
|
sl@0
|
20 |
@internalComponent - Internal Symbian test code
|
sl@0
|
21 |
*/
|
sl@0
|
22 |
|
sl@0
|
23 |
#ifndef __TORDINAL_H__
|
sl@0
|
24 |
#define __TORDINAL_H__
|
sl@0
|
25 |
|
sl@0
|
26 |
#include <e32std.h>
|
sl@0
|
27 |
#include <w32std.h>
|
sl@0
|
28 |
#include "../tlib/testbase.h"
|
sl@0
|
29 |
#include "AUTO.H"
|
sl@0
|
30 |
#include "TGraphicsHarness.h"
|
sl@0
|
31 |
|
sl@0
|
32 |
class CTOrdinal;
|
sl@0
|
33 |
|
sl@0
|
34 |
class COrdinalClient : public CTClient
|
sl@0
|
35 |
{
|
sl@0
|
36 |
public:
|
sl@0
|
37 |
COrdinalClient();
|
sl@0
|
38 |
virtual void KeyL(const TKeyEvent &aKey,const TTime &aTime);
|
sl@0
|
39 |
virtual void ConstructL();
|
sl@0
|
40 |
~COrdinalClient();
|
sl@0
|
41 |
};
|
sl@0
|
42 |
|
sl@0
|
43 |
class COrdinalWindowBase : public CBase
|
sl@0
|
44 |
{
|
sl@0
|
45 |
public:
|
sl@0
|
46 |
COrdinalWindowBase(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
|
sl@0
|
47 |
~COrdinalWindowBase();
|
sl@0
|
48 |
TInt OrdinalPosition();
|
sl@0
|
49 |
void SetOrdinalPosition(TInt aPos);
|
sl@0
|
50 |
void SetOrdinalPosition(TInt aPos,TInt aPri);
|
sl@0
|
51 |
virtual void Draw();
|
sl@0
|
52 |
void TestOP(TInt aTestPos);
|
sl@0
|
53 |
TInt SetToLastAndGetOP();
|
sl@0
|
54 |
TInt SetToLastAndGetOPPri(TInt aPri);
|
sl@0
|
55 |
void SetAndTestOP(TInt aPos);
|
sl@0
|
56 |
void SetAndTestOP(TInt aPos,TInt aTestPos);
|
sl@0
|
57 |
void SetAndTestOPPri(TInt aPos,TInt aPri,TInt aTestPos);
|
sl@0
|
58 |
void SetAndTestOPPri(TInt aPos,TInt aPri);
|
sl@0
|
59 |
inline COrdinalWindowBase* NextSibling() const;
|
sl@0
|
60 |
inline COrdinalWindowBase* PrevSibling() const;
|
sl@0
|
61 |
inline RWindowTreeNode* WinTreeNode();
|
sl@0
|
62 |
inline TUint32 Handle();
|
sl@0
|
63 |
protected:
|
sl@0
|
64 |
RWindowTreeNode* iWin;
|
sl@0
|
65 |
private:
|
sl@0
|
66 |
CTClient* iClient;
|
sl@0
|
67 |
CTestBase* iTest;
|
sl@0
|
68 |
CTestStep* iTestStep;
|
sl@0
|
69 |
};
|
sl@0
|
70 |
|
sl@0
|
71 |
class COrdinalWindow : public COrdinalWindowBase
|
sl@0
|
72 |
{
|
sl@0
|
73 |
public:
|
sl@0
|
74 |
COrdinalWindow(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
|
sl@0
|
75 |
static COrdinalWindowBase *NewL(CTClient *aClient, RWindowTreeNode *parent, CTestBase* aTest, CTestStep* aTestStep);
|
sl@0
|
76 |
private:
|
sl@0
|
77 |
RWindow iClientWin;
|
sl@0
|
78 |
};
|
sl@0
|
79 |
|
sl@0
|
80 |
class COrdinalWindowGroup : public COrdinalWindowBase
|
sl@0
|
81 |
{
|
sl@0
|
82 |
public:
|
sl@0
|
83 |
COrdinalWindowGroup(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
|
sl@0
|
84 |
static COrdinalWindowBase *NewL(CTClient *aClient, CTestBase* aTest, CTestStep* aTestStep);
|
sl@0
|
85 |
private:
|
sl@0
|
86 |
RWindowGroup iGroupWin;
|
sl@0
|
87 |
};
|
sl@0
|
88 |
|
sl@0
|
89 |
class CTOrdinal : public CTWsGraphicsBase
|
sl@0
|
90 |
{
|
sl@0
|
91 |
public:
|
sl@0
|
92 |
CTOrdinal(CTestStep* aStep);
|
sl@0
|
93 |
~CTOrdinal();
|
sl@0
|
94 |
void DestroyWindows();
|
sl@0
|
95 |
void OrdinalPos();
|
sl@0
|
96 |
void OrdinalPriority();
|
sl@0
|
97 |
void ConstructL();
|
sl@0
|
98 |
void CreateWindowsL(TInt aMode);
|
sl@0
|
99 |
protected: //virtual function from CTGraphicsStep
|
sl@0
|
100 |
void RunTestCaseL(TInt aCurTestCase);
|
sl@0
|
101 |
private:
|
sl@0
|
102 |
void TestWindowOrderNext(TInt aBefore,TInt aAfter);
|
sl@0
|
103 |
void TestWindowOrderNext(TInt aLast);
|
sl@0
|
104 |
void TestWindowOrderPrev(TInt aAfter,TInt aBefore);
|
sl@0
|
105 |
void TestWindowOrderPrev(TInt aFirst);
|
sl@0
|
106 |
void CheckHandlesOnNewWindow(CTWindowGroup* aParent,COrdinalWindowBase* aWin);
|
sl@0
|
107 |
void CheckHandlesOnNewWindow(COrdinalWindowBase* aParent,COrdinalWindowBase* aWin);
|
sl@0
|
108 |
void CheckHandlesOnNewWindow(TInt aErrors,COrdinalWindowBase* aWin);
|
sl@0
|
109 |
void CheckHandles(TUint aParent);
|
sl@0
|
110 |
private:
|
sl@0
|
111 |
enum {ENumChildren=6};
|
sl@0
|
112 |
private:
|
sl@0
|
113 |
COrdinalClient* iClient;
|
sl@0
|
114 |
TSize iWinSize;
|
sl@0
|
115 |
TBool iGroupTest;
|
sl@0
|
116 |
COrdinalWindowBase* iParent;
|
sl@0
|
117 |
COrdinalWindowBase* iParent2;
|
sl@0
|
118 |
COrdinalWindowBase* iParent3;
|
sl@0
|
119 |
COrdinalWindowBase* iChild[ENumChildren];
|
sl@0
|
120 |
};
|
sl@0
|
121 |
|
sl@0
|
122 |
class CTOrdinalStep : public CTGraphicsStep
|
sl@0
|
123 |
{
|
sl@0
|
124 |
public:
|
sl@0
|
125 |
CTOrdinalStep();
|
sl@0
|
126 |
protected:
|
sl@0
|
127 |
//from CTGraphicsStep
|
sl@0
|
128 |
virtual CTGraphicsBase* CreateTestL();
|
sl@0
|
129 |
};
|
sl@0
|
130 |
|
sl@0
|
131 |
_LIT(KTOrdinalStep,"TOrdinal");
|
sl@0
|
132 |
|
sl@0
|
133 |
|
sl@0
|
134 |
#endif
|