First public contribution.
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".
9 // Initial Contributors:
10 // Nokia Corporation - initial contribution.
20 @internalComponent - Internal Symbian test code
29 #include "../tlib/testbase.h"
31 #include "TGraphicsHarness.h"
39 EDragDropCaptureAllGroups,
40 ENormalCaptureWithoutFocus,
59 const TInt ESubStates1=2;
60 const TInt ESubStates2=5;
61 const TInt ESubStates3=5;
62 const TInt ESubStates4=5;
63 const TInt ESubStates5=5;
64 const TInt ESubStates6=5;
66 const TInt EWinBorderSize=10;
69 class CTPointerCapture;
71 class CPcConnection : public CTClient
74 CPcConnection(CTPointerCapture *aTest);
76 virtual void ConstructL();
78 CTPointerCapture *iTest;
81 class CPcWindowBase : public CTWin
84 CPcWindowBase(CTPointerCapture *aTest);
85 void SetUpL(TPoint pos,TSize size,CTWinBase *parent);
86 void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
87 void Draw(TDesC &aBuf);
88 void PointerL(const TPointerEvent &pointer,const TTime &);
89 void DragDropL(const TPointerEvent &pointer,const TTime &);
90 virtual TPointerCheckRet PointerDown()=0;
91 virtual TPointerCheckRet DragDrop()=0;
92 virtual void SubStateChanged();
94 CTPointerCapture *iTest;
98 class CPcWindowChild : public CPcWindowBase
101 CPcWindowChild(CTPointerCapture *aTest);
103 TPointerCheckRet PointerDown();
104 TPointerCheckRet DragDrop();
107 class CPcWindowMain : public CPcWindowBase
110 CPcWindowMain(CTPointerCapture *aTest);
112 TPointerCheckRet PointerDown();
113 TPointerCheckRet DragDrop();
114 void WinKeyL(const TKeyEvent &aKey,const TTime &aTime);
117 class CPcWindowAltGroup : public CPcWindowBase
120 CPcWindowAltGroup(CTPointerCapture *aTest);
122 TPointerCheckRet PointerDown();
123 TPointerCheckRet DragDrop();
126 class CPcWindowNickFocusGroup : public CTWindowGroup
129 CPcWindowNickFocusGroup(CTPointerCapture *aTest, CTClient *aClient);
130 void KeyL(const TKeyEvent &aKey,const TTime &aTime);
132 CTPointerCapture *iTest;
135 class CPcWindowAltConnection : public CPcWindowBase
138 CPcWindowAltConnection(CTPointerCapture *aTest);
140 TPointerCheckRet PointerDown();
141 TPointerCheckRet DragDrop();
144 class CTPointerCapture : public CTWsGraphicsBase
147 enum TDState {DDStateNull, DDStateGot, DDStateWaiting};
149 CTPointerCapture(CTestStep* aStep);
155 TInt SubState() const;
156 void doIncSubStateL();
157 void IncSubStateL(TBool aNeedsDD=EFalse);
162 void SetCapture(TInt aCaptureFlags);
163 inline TestClient* Client() {return TheClient;}
165 //from CTGraphicsStep
166 virtual void RunTestCaseL(TInt aCurTestCase);
168 TInt doTestFailedL();
171 CPcConnection *iAltConnection;
172 CTWindowGroup *iMainGroup;
173 CTWindowGroup *iAltGroup;
174 CPcWindowChild *iChildWin;
175 CPcWindowMain *iMainWin;
176 CPcWindowAltGroup *iAltGroupWin;
177 CPcWindowAltConnection *iAltConnectionWin;
178 CPcWindowNickFocusGroup *iNickFocusGroup;
179 CTBlankWindow *iNickFocusBlankWin;
188 class CTPointerCaptureStep : public CTGraphicsStep
191 CTPointerCaptureStep();
193 //from CTGraphicsStep
194 virtual CTGraphicsBase* CreateTestL();
197 _LIT(KTPointerCaptureStep,"TPointerCapture");