1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TMULTCON.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,157 @@
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 __TMULTCON_H__
1.27 +#define __TMULTCON_H__
1.28 +
1.29 +#include <e32std.h>
1.30 +#include <e32svr.h>
1.31 +#include <w32std.h>
1.32 +#include "../tlib/testbase.h"
1.33 +#include "AUTO.H"
1.34 +#include "TGraphicsHarness.h"
1.35 +
1.36 +class CTMultiCon;
1.37 +class CMcWindowBase;
1.38 +
1.39 +class CMcConnectionBase : public CTClient
1.40 + {
1.41 +public:
1.42 + CMcConnectionBase(CTMultiCon *aTest);
1.43 + ~CMcConnectionBase();
1.44 + virtual void ConstructL();
1.45 + void SubStateChanged();
1.46 +protected:
1.47 + CTMultiCon *iTest;
1.48 + CMcWindowBase *iWin;
1.49 + CWindowGc *iGc;
1.50 + };
1.51 +
1.52 +class CMcConnection : public CMcConnectionBase // Sets AutoForeground off
1.53 + {
1.54 +public:
1.55 + CMcConnection(CTMultiCon *aTest);
1.56 + void ConstructL();
1.57 + };
1.58 +
1.59 +class CMcWindowGroupAf : public CTWindowGroup
1.60 + {
1.61 +public:
1.62 + CMcWindowGroupAf(CTClient *aClient);
1.63 + void KeyL(const TKeyEvent &aKey, const TTime &aTime);
1.64 + };
1.65 +
1.66 +class CMcConnectionAf : public CMcConnectionBase // Sets AutoForeground on
1.67 + {
1.68 +public:
1.69 + CMcConnectionAf(CTMultiCon *aTest);
1.70 + void ConstructL();
1.71 + void KeyL(const TKeyEvent &aKey);
1.72 + };
1.73 +
1.74 +class CMcConnectionDef : public CMcConnectionBase // Leaves AutoForeground as the default value
1.75 + {
1.76 +public:
1.77 + CMcConnectionDef(CTMultiCon *aTest);
1.78 + void ConstructL();
1.79 + };
1.80 +
1.81 +class CMcWindowBase : public CTWin
1.82 + {
1.83 +public:
1.84 + CMcWindowBase(CTMultiCon *aTest);
1.85 + void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
1.86 + virtual void Draw()=0;
1.87 + virtual void PointerL(const TPointerEvent &pointer,const TTime &)=0;
1.88 +protected:
1.89 + CTMultiCon *iTest;
1.90 + TRgb iBack;
1.91 + };
1.92 +
1.93 +class CMcWindow : public CMcWindowBase
1.94 + {
1.95 +public:
1.96 + CMcWindow(CTMultiCon *aTest);
1.97 + virtual void Draw();
1.98 + virtual void PointerL(const TPointerEvent &pointer,const TTime &);
1.99 + };
1.100 +
1.101 +class CMcWindowAf : public CMcWindowBase
1.102 + {
1.103 +public:
1.104 + CMcWindowAf(CTMultiCon *aTest);
1.105 + virtual void Draw();
1.106 + virtual void PointerL(const TPointerEvent &pointer,const TTime &);
1.107 + void ConstructL();
1.108 + };
1.109 +
1.110 +class CMcWindowDef : public CMcWindowBase
1.111 + {
1.112 +public:
1.113 + CMcWindowDef(CTMultiCon *aTest);
1.114 + virtual void Draw();
1.115 + virtual void PointerL(const TPointerEvent &pointer,const TTime &);
1.116 + };
1.117 +
1.118 +class CTMultiCon : public CTWsGraphicsBase
1.119 + {
1.120 +public:
1.121 + enum {KTimeOutAfter=10000000}; //10secs
1.122 +public:
1.123 + CTMultiCon(CTestStep* aStep);
1.124 + ~CTMultiCon();
1.125 + void ConstructL();
1.126 + void EndAutoForegroundTest();
1.127 + TInt SubState() const;
1.128 + void IncSubState();
1.129 + static TInt TimeOut(TAny* aTest);
1.130 + void TimeOut();
1.131 + inline TInt ScreenNumber() const {return(iTest->ScreenNumber());}
1.132 +protected:
1.133 +//from CTGraphicsStep
1.134 + virtual void RunTestCaseL(TInt aCurTestCase);
1.135 +private:
1.136 + void SendEvents();
1.137 +private:
1.138 + CTimeOut* iTimeOut;
1.139 + TInt iTimeOutCount;
1.140 + CMcConnectionAf *iConn1;
1.141 + CMcConnection *iConn2;
1.142 + CMcConnectionDef *iConn3;
1.143 + TSize iScreenSize;
1.144 + //TInt iState;
1.145 + TInt iSubState;
1.146 + };
1.147 +
1.148 +class CTMultiConStep : public CTGraphicsStep
1.149 + {
1.150 +public:
1.151 + CTMultiConStep();
1.152 +protected:
1.153 + //from CTGraphicsStep
1.154 + virtual CTGraphicsBase* CreateTestL();
1.155 + };
1.156 +
1.157 +_LIT(KTMultiConStep,"TMultiCon");
1.158 +
1.159 +
1.160 +#endif