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