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 __TMULTCON_H__ sl@0: #define __TMULTCON_H__ sl@0: sl@0: #include 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 CTMultiCon; sl@0: class CMcWindowBase; sl@0: sl@0: class CMcConnectionBase : public CTClient sl@0: { sl@0: public: sl@0: CMcConnectionBase(CTMultiCon *aTest); sl@0: ~CMcConnectionBase(); sl@0: virtual void ConstructL(); sl@0: void SubStateChanged(); sl@0: protected: sl@0: CTMultiCon *iTest; sl@0: CMcWindowBase *iWin; sl@0: CWindowGc *iGc; sl@0: }; sl@0: sl@0: class CMcConnection : public CMcConnectionBase // Sets AutoForeground off sl@0: { sl@0: public: sl@0: CMcConnection(CTMultiCon *aTest); sl@0: void ConstructL(); sl@0: }; sl@0: sl@0: class CMcWindowGroupAf : public CTWindowGroup sl@0: { sl@0: public: sl@0: CMcWindowGroupAf(CTClient *aClient); sl@0: void KeyL(const TKeyEvent &aKey, const TTime &aTime); sl@0: }; sl@0: sl@0: class CMcConnectionAf : public CMcConnectionBase // Sets AutoForeground on sl@0: { sl@0: public: sl@0: CMcConnectionAf(CTMultiCon *aTest); sl@0: void ConstructL(); sl@0: void KeyL(const TKeyEvent &aKey); sl@0: }; sl@0: sl@0: class CMcConnectionDef : public CMcConnectionBase // Leaves AutoForeground as the default value sl@0: { sl@0: public: sl@0: CMcConnectionDef(CTMultiCon *aTest); sl@0: void ConstructL(); sl@0: }; sl@0: sl@0: class CMcWindowBase : public CTWin sl@0: { sl@0: public: sl@0: CMcWindowBase(CTMultiCon *aTest); sl@0: void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc); sl@0: virtual void Draw()=0; sl@0: virtual void PointerL(const TPointerEvent &pointer,const TTime &)=0; sl@0: protected: sl@0: CTMultiCon *iTest; sl@0: TRgb iBack; sl@0: }; sl@0: sl@0: class CMcWindow : public CMcWindowBase sl@0: { sl@0: public: sl@0: CMcWindow(CTMultiCon *aTest); sl@0: virtual void Draw(); sl@0: virtual void PointerL(const TPointerEvent &pointer,const TTime &); sl@0: }; sl@0: sl@0: class CMcWindowAf : public CMcWindowBase sl@0: { sl@0: public: sl@0: CMcWindowAf(CTMultiCon *aTest); sl@0: virtual void Draw(); sl@0: virtual void PointerL(const TPointerEvent &pointer,const TTime &); sl@0: void ConstructL(); sl@0: }; sl@0: sl@0: class CMcWindowDef : public CMcWindowBase sl@0: { sl@0: public: sl@0: CMcWindowDef(CTMultiCon *aTest); sl@0: virtual void Draw(); sl@0: virtual void PointerL(const TPointerEvent &pointer,const TTime &); sl@0: }; sl@0: sl@0: class CTMultiCon : public CTWsGraphicsBase sl@0: { sl@0: public: sl@0: enum {KTimeOutAfter=10000000}; //10secs sl@0: public: sl@0: CTMultiCon(CTestStep* aStep); sl@0: ~CTMultiCon(); sl@0: void ConstructL(); sl@0: void EndAutoForegroundTest(); sl@0: TInt SubState() const; sl@0: void IncSubState(); sl@0: static TInt TimeOut(TAny* aTest); sl@0: void TimeOut(); sl@0: inline TInt ScreenNumber() const {return(iTest->ScreenNumber());} sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual void RunTestCaseL(TInt aCurTestCase); sl@0: private: sl@0: void SendEvents(); sl@0: private: sl@0: CTimeOut* iTimeOut; sl@0: TInt iTimeOutCount; sl@0: CMcConnectionAf *iConn1; sl@0: CMcConnection *iConn2; sl@0: CMcConnectionDef *iConn3; sl@0: TSize iScreenSize; sl@0: //TInt iState; sl@0: TInt iSubState; sl@0: }; sl@0: sl@0: class CTMultiConStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTMultiConStep(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: }; sl@0: sl@0: _LIT(KTMultiConStep,"TMultiCon"); sl@0: sl@0: sl@0: #endif